// rest api

Connect any service. Trigger any workflow.

The ServerEngine v5 control API runs jobs through the ServerEngine service — Bearer-token secured, HTTPS by default on 127.0.0.1:5001, local only (put your own reverse proxy in front for remote access).

Endpoints

Base URL: https://127.0.0.1:5001/api/v1 — grab your se_…token from the app's API tab.

GET/healthService health, license and queue counts
POST/jobsRun a script, runbook or installer right now
GET/jobsList jobs and their status
GET/jobs/<id>/outputRead a job's console output
DELETE/jobs/<id>Cancel a job
POST/jobs/<id>/restartRetry a job
GET/logs?tail=50Tail the service log
PUT/schedules/<id>Schedule a run (creates a Windows Scheduled Task)
POST/run-schedule/<id>Run a saved schedule now — hands off to S.E.N.T.R.I when its target is the agent

Request fields

target"(This Computer)", a host FQDN, or a group name
runScript, .runbook, or installer name
parameters[VAR:xTest1,VAL:someText] — every xTest1 in your script is replaced before it runs
time / dateSchedules: "HH:mm" and "yyyy.MM.dd, DayName"
intervalOne time · Every (5m…12h) · Daily (24h) · Weekly · Monthly
state"Enabled" / "Disabled"

Straight from the app

The same ready-to-run samples you'll find in ServerEngine under Settings → API.

# ServerEngine v5 - jobs run through the ServerEngine service.
# Copy the API token from the app's API tab (Copy button). The control
# API serves HTTPS on 127.0.0.1:5001 by default (local only - use a
# reverse proxy of your choice for remote access). The certificate is
# self-signed: import the ServerEngine-CA to trust it, or on
# PowerShell 7+ add -SkipCertificateCheck to each call.
$token = "se_paste-your-token-here"
$base  = "https://127.0.0.1:5001/api/v1"

$headers = @{
    "Content-Type"  = "application/json"
    "Authorization" = "Bearer $token"
}

# --- Run a script, runbook or installer right now ---
$body = @{
    target     = "(This Computer)"   # host FQDN or group name
    run        = "myscript.ps1"      # script, .runbook or installer

    # dynamic parameters: every xTest1 in your script is
    # replaced with someText before it runs
    parameters = "[VAR:xTest1,VAL:someText][VAR:xTest2,VAL:more]"
} | ConvertTo-Json

$job = Invoke-RestMethod -Uri "$base/jobs" -Method POST -Headers $headers -Body $body
$id  = $job.jobIds[0]

# --- Wait for the job to finish, then print its console output ---
do {
    Start-Sleep -Seconds 2
    $state = (Invoke-RestMethod -Uri "$base/jobs" -Headers $headers) |
             Where-Object id -eq $id
} while ($state -and $state.status -notmatch "Completed|Failed")

(Invoke-RestMethod -Uri "$base/jobs/$id/output" -Headers $headers).output

# --- Or schedule it instead (creates a Windows Scheduled Task) ---
$sid  = [guid]::NewGuid().ToString("N")
$body = @{
    time    = (Get-Date).AddMinutes(5).ToString("HH:mm")
    date    = (Get-Date).ToString("yyyy.MM.dd, dddd",
              [Globalization.CultureInfo]::InvariantCulture)
    interval = "One time"  # or: Every (5m/15m/30m/1h/2h/3h/6h/12h),
                           # Daily (24h), Weekly (7 days), Monthly (28 days)
    target   = "(This Computer)"
    run      = "myscript.ps1"
    state    = "Enabled"
} | ConvertTo-Json
Invoke-RestMethod -Uri "$base/schedules/$sid" -Method PUT -Headers $headers -Body $body

Run S.E.N.T.R.I from the API

A schedule whose target is S.E.N.T.R.I runs the agent instead of the job queue. POST /run-schedule/<id> checks the target and hands the run to the agent — the request body is ignored, so the prompt always comes from the schedule itself. Save it once in the Job Planner, then trigger it as often as you like.

On an agent schedule

target"S.E.N.T.R.I" — this is what routes the run to the agent instead of the job queue
runThe prompt itself — on an agent schedule this field is the instruction, not a script name
state"Enabled" — a disabled schedule answers 409
aiSystemPromptSystem prompt the run starts from
aiProviderOpenRouter · Claude · Ollama
aiModelModel id for that provider
aiEffortReasoning effort for the run
aiAllowedSkillsThe skills this run may call — its scope

Every ai… field is required. If the Job Planner never published them, the run stops and asks you to re-save the schedule there.

Define it, run it, watch it

sentri-run.sh
# 1 — define the prompt and the model on the schedule
curl -k -X PUT https://127.0.0.1:5001/api/v1/schedules/nightly-triage \
  -H "Authorization: Bearer se_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "S.E.N.T.R.I",
    "state": "Enabled",
    "run": "Check every host for failed services and open a Jira ticket for each",
    "aiSystemPrompt": "You are the night-shift sysadmin.",
    "aiProvider": "OpenRouter",
    "aiModel": "anthropic/claude-sonnet-4.5",
    "aiEffort": "Medium",
    "aiAllowedSkills": ["Check Events", "Check Logs", "Jira Tickets"]
  }'

# 2 — run it now; the response carries the job id
curl -k -X POST https://127.0.0.1:5001/api/v1/run-schedule/nightly-triage \
  -H "Authorization: Bearer se_your_token"

# 3 — poll the transcript while it thinks
curl -k https://127.0.0.1:5001/api/v1/jobs/<jobId>/output \
  -H "Authorization: Bearer se_your_token"

Worth knowing

  • The schedule has to be Enabled — a disabled one answers 409.
  • Runs are serialized: one agent run at a time, capped at 25 turns or 15 minutes.
  • The transcript streams into the job's output while it runs, and is written to Logs\Sentri\ when it finishes.

Ready when you are.

Remote Manager, Admin Console, and Script Editor are free for up to 25 devices — upgrade whenever automation should take over.