Skip to content

API reference

Monitoring and system

Panel host monitoring, notifications, the dashboard and the System page.

Monitoring

Panel host metrics, services, alert rules and the health check.

GET /api/monitor/system

Get panel host stats

Returns a live CPU, RAM, disk, swap and uptime snapshot of the panel host (the machine the API runs on). Sizes are in bytes.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • cpu.percent is load1 / cores Γ— 100, capped at 100 β€” a load estimate, not a sampled CPU utilisation.
  • disk is for the / filesystem. Disk and swap fall back to zeros when df/free are unavailable.
cURL
curl "https://panel.example.com/api/monitor/system" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "cpu": {
        "load1": 0.42,
        "load5": 0.38,
        "load15": 0.3,
        "cores": 4,
        "percent": 11
    },
    "ram": {
        "total": 8340000000,
        "used": 4120000000,
        "free": 4220000000,
        "percent": 49
    },
    "disk": {
        "total": 85000000000,
        "used": 31000000000,
        "percent": 37
    },
    "swap": {
        "total": 2147483648,
        "used": 104857600,
        "percent": 5
    },
    "uptime": 1209600,
    "hostname": "panel-01"
}
GET /api/monitor/history

Get metric history

Returns the stored CPU/RAM/disk percentage samples captured by the metrics monitor for the last N hours, oldest first. Without serverId it returns the panel host's own history.

  • Token or session
  • Admin

Query parameters

hours integer
Look-back window in hours.1–168, default 24
serverId integer
Fleet server id; omit for the panel host (samples with serverId null).

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Unknown query parameters are removed silently (additionalProperties false). An unknown serverId simply returns an empty samples array.
cURL
curl "https://panel.example.com/api/monitor/history" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "hours": 24,
    "samples": [
        {
            "cpuPercent": 12,
            "ramPercent": 48,
            "diskPercent": 37,
            "checkedAt": "2026-11-27T10:00:00.000Z"
        }
    ]
}
GET /api/monitor/processes

List top processes

Returns the panel host's top resource consumers, grouped by command into services (e.g. all php-fpm workers summed as PHP-FPM), sorted by CPU descending.

  • Token or session
  • Admin

Query parameters

limit integer
Number of service groups to return.1–25, default 8

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • cpuPercent is summed over processes and can exceed 100 on multi-core hosts.
  • Uses GNU ps; on hosts without it services is an empty array.
cURL
curl "https://panel.example.com/api/monitor/processes" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "cores": 4,
    "services": [
        {
            "name": "PHP-FPM",
            "cpuPercent": 38.5,
            "memPercent": 12.1,
            "rssBytes": 1010000000,
            "count": 9
        }
    ],
    "capturedAt": "2026-11-27T10:00:00.000Z"
}
GET /api/monitor/apm

Get response-time percentiles

For every site with uptime monitoring enabled, computes uptime % and response-time statistics (avg, p50, p95, p99, max in ms) from the stored uptime checks of the last N hours. Sites are sorted by p95, slowest first.

  • Token or session
  • Admin

Query parameters

hours integer
Look-back window in hours.1–168, default 24

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Statistics are null when a site has no checks (or no response times) in the window. Read-only; it sends no requests to the sites.
cURL
curl "https://panel.example.com/api/monitor/apm" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "hours": 24,
    "sites": [
        {
            "siteId": 12,
            "domain": "shop.example.com",
            "samples": 288,
            "uptimePct": 99.7,
            "avg": 182,
            "p50": 160,
            "p95": 410,
            "p99": 780,
            "max": 1250
        }
    ]
}
GET /api/monitor/services

List core service status

Reports whether each core service on the panel host is active according to systemctl is-active. The fixed catalogue is nginx, mysql (mysql or mariadb), redis (redis-server or redis), php-fpm (php8.3-fpm, php8.2-fpm or php8.1-fpm) and supervisor.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • status is active or inactive only; a service that is not installed reports inactive.
  • Only checks the panel host, not remote fleet servers.
cURL
curl "https://panel.example.com/api/monitor/services" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
[
    {
        "key": "nginx",
        "name": "Nginx",
        "status": "active"
    },
    {
        "key": "redis",
        "name": "Redis",
        "status": "inactive"
    }
]
POST /api/monitor/services/{key}/control

Start, stop or restart a service

Runs systemctl <action> on the panel host for one catalogue service and returns the command output and the service status afterwards. The unit name is the first installed candidate for the key.

  • Token or session
  • Admin

Path parameters

key stringrequired
Service key.one of: nginx, mysql, redis, php-fpm, supervisor

Body

action stringrequired
systemctl action.one of: start, stop, restart, reload

Errors

400
Invalid action: <action> action is not allowed (normally caught earlier by schema validation).
400
Unknown service: <key> key is not in the catalogue.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • systemctl is called directly without sudo, so it only succeeds when the API has the privileges to manage units.
  • Not audited.
  • Stopping nginx makes the panel itself unreachable behind its reverse proxy.
cURL
curl -X POST "https://panel.example.com/api/monitor/services/nginx/control" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "restart"
}'
200Response Β· application/json
{
    "ok": true,
    "key": "nginx",
    "serviceName": "nginx",
    "action": "restart",
    "status": "active",
    "output": ""
}
GET /api/monitor/services/{key}/logs

Stream service logs

Server-Sent Events stream of journalctl -u <unit> -f on the panel host: the last 100 lines, then new lines as they are written, until the client disconnects.

  • Token or session
  • Admin
  • Server-Sent Events

Path parameters

key stringrequired
Service key.one of: nginx, mysql, redis, php-fpm, supervisor

Errors

400
Unknown service: <key> key is not in the catalogue (sent before the stream starts).
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Event payloads: {"line": "<one log line, short-iso format>"} per line; {"error": "<stderr text>"} for journalctl stderr.
  • End signal: {"done": true} when journalctl exits, or {"error": "<message>", "done": true} when journalctl cannot be started; then the response ends. With -f it normally runs until the client closes the connection.
  • A comment line ": ka" is sent every 20 seconds as keep-alive.
  • EventSource cannot send an Authorization header; the web client reads the stream with fetch() and a Bearer header.
cURL
curl -N "https://panel.example.com/api/monitor/services/nginx/logs" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· text/event-stream

SSE stream; every event is a single "data: <json>" line.

GET /api/monitor/stats/history

Get 7-day deploy counts

Returns, for each of the last 7 days including today, the number of successful and failed deployments across all sites, oldest day first.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Day boundaries use the API server's local midnight, while date is printed from the UTC ISO string, so labels can be shifted by one day on servers not running in UTC.
cURL
curl "https://panel.example.com/api/monitor/stats/history" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "days": [
        {
            "date": "2026-11-21",
            "success": 4,
            "failed": 0
        },
        {
            "date": "2026-11-27",
            "success": 2,
            "failed": 1
        }
    ]
}
GET /api/monitor/ssl

Check SSL expiry for all sites

Opens a live TLS connection to port 443 of every active site with SSL enabled and reports the certificate's expiry date and days left.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Each site has a 10-second timeout (error "Timeout"); a handshake without a certificate gives error "No certificate"; connection errors give the socket error message.
  • Certificates are read with rejectUnauthorized false, so invalid or self-signed certificates still report an expiry.
cURL
curl "https://panel.example.com/api/monitor/ssl" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "sites": [
        {
            "siteId": 12,
            "domain": "shop.example.com",
            "daysLeft": 63,
            "expiresAt": "2027-01-29T10:00:00.000Z",
            "error": null
        },
        {
            "siteId": 14,
            "domain": "blog.example.com",
            "daysLeft": null,
            "expiresAt": null,
            "error": "Timeout"
        }
    ]
}
GET /api/monitor/health-score/{siteId}

Get a site's health score

Computes a 0–100 health score for a site: uptime over the last 24 h (40 points), last deployment status (30: success 30, failed 0, none or other 15), SSL enabled (20) and not in maintenance (10). A billing-suspended or archived site always scores 0 with suspended=true.

  • Token or session
  • Any role
  • Needs site access

Path parameters

siteId integerrequired
Site id.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: no access to this site Non-admin caller without a grant for this site.
  • An unknown site id (for an admin) returns 200 with {"score": 0, "breakdown": {}} instead of 404.
  • With no uptime checks in the last 24 h the uptime component counts as 100% (40 points).
  • enforcementLevel is the billing subscription's level (none, banner, restrict, suspend, archived); suspend and archived force score 0.
cURL
curl "https://panel.example.com/api/monitor/health-score/12" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "score": 92,
    "suspended": false,
    "enforcementLevel": "none",
    "breakdown": {
        "uptime": 32,
        "deploy": 30,
        "ssl": 20,
        "maintenance": 10
    }
}
GET /api/monitor/logs/{siteId}/stream

Stream a site's Laravel log

Server-Sent Events stream of tail -F -n 100 on <rootPath>/current/storage/logs/laravel.log, run on the site's own server (locally or over SSH). Sends the last 100 lines, then follows new output until the client disconnects.

  • Token or session
  • Any role
  • Needs site access
  • Server-Sent Events

Path parameters

siteId integerrequired
Site id.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: no access to this site Non-admin caller without a grant for this site.
404
Site not found No site with this id (sent before the stream starts).
  • Event payloads: {"line": "<raw output chunk>"} β€” one event per stdout chunk, which may contain several log lines (not split on newlines); {"error": "<stderr text>"} for tail errors other than "No such file" messages.
  • End signal: {"done": true} when tail exits, or {"error": "<message>", "done": true} when tail cannot be started; then the response ends. Normally it runs until the client disconnects.
  • A comment line ": ka" is sent every 20 seconds as keep-alive.
  • The log path is fixed to the Laravel location; a missing file produces no error event (tail -F waits for it).
cURL
curl -N "https://panel.example.com/api/monitor/logs/12/stream" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· text/event-stream

SSE stream; every event is a single "data: <json>" line.

GET /api/health

Check API liveness

Unauthenticated liveness probe. Returns ok with the server's current time whenever the API process is up and serving.

  • Public
  • It does not check the database or other dependencies. The panel self-update script uses it to verify a new build; in that smoke-test mode (ORCH_SMOKE_TEST=1) the process first reads each main table and exits on a mismatch, before serving.
  • Subject to the global rate limit (600 requests per minute per IP).
cURL
curl "https://panel.example.com/api/health"
200Response Β· application/json
{
    "status": "ok",
    "ts": "2026-11-27T10:00:00.000Z"
}
GET /api/alerts

List alert rules

Returns all threshold alert rules (panel host and fleet scopes), oldest first.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
cURL
curl "https://panel.example.com/api/alerts" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "rules": [
        {
            "id": 3,
            "metric": "disk",
            "operator": "gt",
            "threshold": 85,
            "enabled": true,
            "cooldownMins": 30,
            "lastTriggeredAt": null,
            "createdAt": "2026-11-27T10:00:00.000Z",
            "scope": "local",
            "serverId": null,
            "groupName": null,
            "durationSecs": 0
        }
    ]
}
POST /api/alerts

Create an alert rule

Creates a threshold alert rule. Scope local (the default) watches the panel host and supports cpu, ram, disk and swap only; scopes server, group and all are evaluated by the fleet engine and may also use load, inode and disk_forecast.

  • Token or session
  • Admin
  • Audit: alert.created

Body

metric stringrequired
Metric to watch.one of: cpu, ram, disk, swap, load, inode, disk_forecast; scope local allows only cpu, ram, disk, swap
threshold integerrequired
Threshold value: percent for most metrics, % of CPU cores for load, days for disk_forecast.schema 0–10000; then disk_forecast 1–365, load 1–10000, all others 0–100
operator string
gt fires above the threshold, lt below.one of: gt, lt; default gt
cooldownMins integer
Minimum minutes between two notifications.1–1440, default 30
scope string
What the rule watches.one of: local, server, group, all; default local
serverId integer
Fleet server id; required for scope server, ignored (stored null) otherwise.integer β‰₯ 1 or null
groupName string
Server group name; required for scope group (trimmed), ignored otherwise.max 100 chars or null
durationSecs integer
How long the condition must hold before firing. Forced to 0 for scope local.0–86400, default 0

Errors

400
Choose a group for this alert. scope group without a non-empty groupName.
400
Choose a server for this alert. scope server without serverId.
400
Selected server not found serverId does not match a fleet server.
400
The disk forecast threshold must be between 1 and 365 days. metric disk_forecast with threshold outside 1–365.
400
The load threshold must be between 1 and 10000 (% of CPU cores). metric load with threshold 0.
400
The panel host (scope "local") supports only the cpu, ram, disk and swap metrics. scope local with metric load, inode or disk_forecast.
400
The threshold must be between 0 and 100%. Any other metric with threshold above 100.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Rules are created enabled (schema default); enabled cannot be set on create.
  • Unknown body fields are removed silently.
cURL
curl -X POST "https://panel.example.com/api/alerts" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "metric": "disk",
    "operator": "gt",
    "threshold": 85,
    "cooldownMins": 60,
    "scope": "server",
    "serverId": 2,
    "durationSecs": 300
}'
201Response Β· application/json
{
    "id": 4,
    "metric": "disk",
    "operator": "gt",
    "threshold": 85,
    "enabled": true,
    "cooldownMins": 60,
    "lastTriggeredAt": null,
    "createdAt": "2026-11-27T10:00:00.000Z",
    "scope": "server",
    "serverId": 2,
    "groupName": null,
    "durationSecs": 300
}
PATCH /api/alerts/{id}

Update an alert rule

Partially updates a rule; omitted fields keep their stored values and the merged rule is validated with the same rules as on create. Switching scope clears the fields that do not belong to it (serverId outside server, groupName outside group, durationSecs forced to 0 for local).

  • Token or session
  • Admin
  • Audit: alert.updated

Path parameters

id integerrequired
Alert rule id.

Body

enabled boolean
Enable or pause the rule.
metric string
Metric to watch.one of: cpu, ram, disk, swap, load, inode, disk_forecast
operator string
Comparison.one of: gt, lt
threshold integer
Threshold value.schema 0–10000; metric-specific ranges as on create
cooldownMins integer
Minutes between notifications.1–1440
scope string
What the rule watches.one of: local, server, group, all
serverId integer
Fleet server id for scope server.integer β‰₯ 1 or null
groupName string
Group name for scope group.max 100 chars or null
durationSecs integer
Hold time before firing (fleet scopes).0–86400

Errors

400
Choose a group for this alert. The merged rule is scope group without groupName.
400
Choose a server for this alert. The merged rule is scope server without serverId.
400
Selected server not found A changed serverId does not match a fleet server.
400
The disk forecast threshold must be between 1 and 365 days. disk_forecast threshold outside 1–365.
400
The load threshold must be between 1 and 10000 (% of CPU cores). load threshold 0.
400
The panel host (scope "local") supports only the cpu, ram, disk and swap metrics. The merged rule is scope local with a fleet-only metric.
400
The threshold must be between 0 and 100%. Other metrics with threshold above 100.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
404
Rule not found No rule with this id (or the id is not an integer).
  • Changing only metric (e.g. to load) re-validates the stored threshold against the new metric's range.
cURL
curl -X PATCH "https://panel.example.com/api/alerts/2" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
}'
200Response Β· application/json
{
    "id": 4,
    "metric": "disk",
    "operator": "gt",
    "threshold": 85,
    "enabled": false,
    "cooldownMins": 60,
    "lastTriggeredAt": null,
    "createdAt": "2026-11-27T10:00:00.000Z",
    "scope": "server",
    "serverId": 2,
    "groupName": null,
    "durationSecs": 300
}
DELETE /api/alerts/{id}

Delete an alert rule

Deletes an alert rule.

  • Token or session
  • Admin
  • Audit: alert.deleted

Path parameters

id integerrequired
Alert rule id.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Idempotent: an unknown id still returns {"ok": true} and an alert.deleted audit entry is written anyway.
cURL
curl -X DELETE "https://panel.example.com/api/alerts/2" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}

Notifications

The notification bell.

GET /api/notifications

List notifications

Returns the 50 most recent in-app notifications (the bell feed) and the number of unread notifications. The feed is global to the panel: every user sees the same notifications and read state.

  • Token or session
  • Any role

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • type is one of deploy, alert, ssl, uptime, system; level is one of info, success, warning, critical.
  • meta is returned as the raw stored JSON string (or null), not as an object.
  • Notifications are not filtered by the caller's site access. The feed keeps only the latest 200 rows.
  • unread counts all unread notifications, not only the 50 returned.
cURL
curl "https://panel.example.com/api/notifications" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "notifications": [
        {
            "id": 301,
            "type": "deploy",
            "level": "success",
            "title": "Deploy succeeded",
            "body": "shop.example.com deployed a3f9c21",
            "meta": "{\"siteId\":12,\"domain\":\"shop.example.com\"}",
            "read": false,
            "createdAt": "2026-11-27T10:00:00.000Z"
        }
    ],
    "unread": 1
}
POST /api/notifications/read-all

Mark all notifications read

Marks every unread notification as read. Because the feed is global, this marks them read for all users.

  • Token or session
  • Any role

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Send no body (or no Content-Type: application/json header); an empty JSON body is rejected by Fastify with 400.
cURL
curl -X POST "https://panel.example.com/api/notifications/read-all" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}
POST /api/notifications/{id}/read

Mark a notification read

Marks one notification as read (for all users, as the feed is global).

  • Token or session
  • Any role

Path parameters

id integerrequired
Notification id.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Returns {"ok": true} even when no notification has this id (errors are swallowed).
cURL
curl -X POST "https://panel.example.com/api/notifications/51/read" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}
DELETE /api/notifications/{id}

Delete a notification

Removes one notification from the global feed. Admin only.

  • Token or session
  • Admin

Path parameters

id integerrequired
Notification id.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role The caller is not an admin.
  • Returns {"ok": true} even when no notification has this id.
cURL
curl -X DELETE "https://panel.example.com/api/notifications/51" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}
DELETE /api/notifications

Clear all notifications

Deletes every notification in the global feed. Admin only.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role The caller is not an admin.
  • Irreversible and affects all users.
cURL
curl -X DELETE "https://panel.example.com/api/notifications" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}

Dashboard

Dashboard layouts and directory helpers.

GET /api/dashboard

Get dashboard layouts

Returns the caller's current (auto-saved) monitoring dashboard layout and their named layout presets. Layouts are private to each user.

  • Token or session
  • Any role

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • config values are opaque strings stored as sent. The web client stores a JSON-encoded array of {id, width: "half"|"full", visible} widget entries.
  • auto is null until the working layout has been saved once. The auto layout is stored as a reserved preset named "__auto__", which is not included in presets.
cURL
curl "https://panel.example.com/api/dashboard" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "auto": "[{\"id\":\"metrics-history\",\"width\":\"full\",\"visible\":true},{\"id\":\"system-stats\",\"width\":\"half\",\"visible\":true}]",
    "presets": [
        {
            "id": 9,
            "name": "Incident view",
            "config": "[{\"id\":\"system-stats\",\"width\":\"full\",\"visible\":true}]",
            "updatedAt": "2026-11-27T10:00:00.000Z"
        }
    ]
}
PUT /api/dashboard/auto

Save the working layout

Creates or replaces the caller's current working dashboard layout. The web client calls it, debounced, whenever the layout changes.

  • Token or session
  • Any role

Body

config stringrequired
Layout as an opaque string (the web client sends a JSON-encoded widget array).max 20000 chars

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • The content of config is not parsed or validated beyond its length.
cURL
curl -X PUT "https://panel.example.com/api/dashboard/auto" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "config": "[{\"id\":\"metrics-history\",\"width\":\"full\",\"visible\":true}]"
}'
200Response Β· application/json
{
    "ok": true
}
POST /api/dashboard/presets

Save a named layout preset

Creates a named dashboard layout preset for the caller, or replaces the layout of the caller's existing preset with the same name.

  • Token or session
  • Any role

Body

name stringrequired
Preset name (leading/trailing spaces are trimmed). Unique per user.1–60 chars; "__auto__" is reserved
config stringrequired
Layout as an opaque string (the web client sends a JSON-encoded widget array).max 20000 chars

Errors

400
That name is reserved. The trimmed name is "__auto__".
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Returns 201 both when a preset is created and when an existing one with the same name is overwritten.
cURL
curl -X POST "https://panel.example.com/api/dashboard/presets" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Incident view",
    "config": "[{\"id\":\"system-stats\",\"width\":\"full\",\"visible\":true}]"
}'
201Response Β· application/json
{
    "id": 9,
    "name": "Incident view",
    "config": "[{\"id\":\"system-stats\",\"width\":\"full\",\"visible\":true}]",
    "updatedAt": "2026-11-27T10:00:00.000Z"
}
DELETE /api/dashboard/presets/{id}

Delete a layout preset

Deletes one of the caller's named dashboard presets.

  • Token or session
  • Any role

Path parameters

id integerrequired
Preset id.

Errors

400
The auto layout cannot be deleted. The id is that of the caller's working ("__auto__") layout.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
404
Preset not found No preset with this id, or it belongs to another user.
cURL
curl -X DELETE "https://panel.example.com/api/dashboard/presets/1" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true
}
GET /api/directory

List the user directory

Returns a minimal list of all panel users (id, email, role), sorted by email. Available to every role; used for assignee, share and attendee pickers.

  • Token or session
  • Any role

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Unlike GET /api/users this is not admin-only, and it exposes every user's email and role to any authenticated user.
cURL
curl "https://panel.example.com/api/directory" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "users": [
        {
            "id": 1,
            "email": "[email protected]",
            "role": "admin"
        },
        {
            "id": 12,
            "email": "[email protected]",
            "role": "developer"
        }
    ]
}

System

Packages, firewall, reboots, panel updates and the Doctor.

GET /api/system/info

Get host system info

Read-only snapshot of the panel host: hostname, kernel, OS name, uptime, number of pending apt upgrades (simulated, no changes), whether a reboot is required and the ufw firewall state.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • pendingUpdates is -1 when apt-get is unavailable or failed. ufwStatus is null when ufw is absent or passwordless sudo for ufw is not granted.
cURL
curl "https://panel.example.com/api/system/info" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "hostname": "panel-01",
    "kernel": "6.8.0-48-generic",
    "os": "Ubuntu 24.04.1 LTS",
    "uptimeSeconds": 1209600,
    "pendingUpdates": 7,
    "rebootRequired": false,
    "ufwStatus": "active"
}
GET /api/system/run/{key}/stream

Run a maintenance action

Runs one allow-listed, fixed maintenance command on the panel host and streams its output as Server-Sent Events. Commands are spawned with an argument array (no shell) through sudo -n, so passwordless sudo must be granted for them. Nothing the client sends becomes part of the command except the validated ufw target.

  • Token or session
  • Admin
  • Server-Sent Events
  • Audit: system.<key>

Path parameters

key stringrequired
Action key. apt-update: sudo -n apt-get update. apt-upgrade: sudo -n apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold upgrade (DEBIAN_FRONTEND=noninteractive). apt-dist-upgrade: same options with dist-upgrade. apt-autoremove: sudo -n apt-get -y autoremove --purge (noninteractive). apt-clean: sudo -n apt-get clean. journal-vacuum: sudo -n journalctl --vacuum-time=7d. ufw-status: sudo -n ufw status verbose. ufw-enable: sudo -n ufw --force enable. ufw-allow: sudo -n ufw allow <arg>. ufw-deny: sudo -n ufw deny <arg>. reboot: sudo -n reboot.one of: apt-update, apt-upgrade, apt-dist-upgrade, apt-autoremove, apt-clean, journal-vacuum, ufw-status, ufw-enable, ufw-allow, ufw-deny, reboot

Query parameters

arg string
Firewall target; required for ufw-allow and ufw-deny, ignored for other keys.a port 1–65535 optionally followed by /tcp or /udp (pattern ^\d{1,5}(/(tcp|udp))?$), or one of: ssh, http, https, ftp, smtp

Errors

400
Invalid firewall target. Use a port (e.g. 8080 or 8080/tcp) or ssh/http/https. ufw-allow or ufw-deny with a missing or invalid arg.
400
Unknown action: <key> key is not in the allow-list.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • The audit action is "system." + key (e.g. system.apt-upgrade, system.ufw-allow, system.reboot) with meta {label, arg}; it is written before the command starts, whatever its outcome.
  • Event payloads: first {"line": "$ <label> [arg]\n"} echoing the command, then {"line": "<text>"} for every non-empty stdout/stderr line, and {"line": "[error] <message>"} if the process cannot be spawned.
  • End signal: {"done": true, "status": "success"} (exit code 0) or {"done": true, "status": "failed"}, after which the response ends.
  • A comment line ": ka" is sent every 20 seconds as keep-alive. Closing the connection sends SIGTERM to the command.
  • This is a GET with side effects: actions such as reboot, apt-upgrade and ufw-enable change the host. reboot takes the panel down; ufw-enable without an ssh/port rule can lock out SSH.
  • Without passwordless sudo, sudo -n fails immediately and the stream ends with status failed.
  • EventSource cannot send an Authorization header; the web client reads the stream with fetch() and a Bearer header.
cURL
curl -N "https://panel.example.com/api/system/run/nginx/stream" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· text/event-stream

SSE stream; every event is a single "data: <json>" line.

GET /api/system/packages

List upgradable packages

Lists the apt packages that have an upgrade available on the panel host (apt list --upgradable, no sudo, no changes), with a count of security updates.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • On hosts without apt it returns {"available": false, "packages": [], "security": 0}. security is true when the suite contains "-security".
cURL
curl "https://panel.example.com/api/system/packages" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "available": true,
    "packages": [
        {
            "name": "openssl",
            "suite": "noble-updates,noble-security",
            "version": "3.0.13-0ubuntu3.4",
            "arch": "amd64",
            "current": "3.0.13-0ubuntu3.1",
            "security": true
        }
    ],
    "security": 1
}
GET /api/system/reboot-schedule

Get the scheduled reboot

Reports whether a reboot or shutdown is pending on the panel host (read from systemd's /run/systemd/shutdown/scheduled, so it also shows one scheduled from a shell), plus the server's current time and timezone.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • When nothing is pending the body is {"scheduled": false, "serverTime": …, "timezone": …}.
cURL
curl "https://panel.example.com/api/system/reboot-schedule" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "scheduled": true,
    "at": "2026-11-28T03:00:00.000Z",
    "mode": "reboot",
    "serverTime": "2026-11-27T10:00:00.000Z",
    "timezone": "UTC"
}
POST /api/system/reboot-schedule

Schedule a reboot

Schedules a reboot of the panel host at the given time with sudo -n shutdown -r +<minutes>, replacing any reboot already pending. The time is rounded up to whole minutes from now.

  • Token or session
  • Admin
  • Audit: system.reboot_scheduled

Body

at stringrequired
Reboot time, any string JavaScript Date can parse (ISO 8601 recommended).max 40 chars; must be 2 minutes to 7 days from now

Errors

400
Pick a time between 2 minutes and 7 days from now. at is unparsable or outside the allowed window.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
500
Could not schedule the reboot. shutdown failed (e.g. no passwordless sudo); the body also has details with the stderr text.
  • Unlike GET, the response has no serverTime/timezone fields.
cURL
curl -X POST "https://panel.example.com/api/system/reboot-schedule" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "at": "2026-11-28T03:00:00.000Z"
}'
200Response Β· application/json
{
    "ok": true,
    "scheduled": true,
    "at": "2026-11-28T03:00:00.000Z",
    "mode": "reboot"
}
DELETE /api/system/reboot-schedule

Cancel the scheduled reboot

Cancels any pending shutdown or reboot on the panel host with sudo -n shutdown -c.

  • Token or session
  • Admin
  • Audit: system.reboot_cancelled

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
500
Could not cancel the scheduled reboot. shutdown -c failed; the body also has details with the stderr text.
cURL
curl -X DELETE "https://panel.example.com/api/system/reboot-schedule" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true,
    "scheduled": false
}
GET /api/system/heartbeat

Check schedulers and queue workers

For every active site, reports whether its Laravel scheduler cron is enabled and recently ran, and the state of its supervisor queue workers. Each server is probed once (cron.d listing, the cron journal for the last 20 minutes, supervisorctl status), locally or over SSH. Read-only.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • scheduler.state: off (no cron file), ok (ran within the last 3 minutes), stale, unknown (journal not readable). workers.state: none, ok, degraded, down, unknown.
  • server is null for sites on the panel host, otherwise the remote server's name. reachable false (with scheduler and workers null) means the server probe failed.
  • workers.processes is capped at 20 entries.
cURL
curl "https://panel.example.com/api/system/heartbeat" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "generatedAt": "2026-11-27T10:00:00.000Z",
    "sites": [
        {
            "id": 12,
            "name": "Shop",
            "domain": "shop.example.com",
            "stackType": "laravel",
            "server": null,
            "reachable": true,
            "scheduler": {
                "enabled": true,
                "state": "ok",
                "lastRun": "2026-11-27T09:59:00.000Z"
            },
            "workers": {
                "state": "ok",
                "running": 2,
                "total": 2,
                "processes": [
                    {
                        "name": "shop.example.com-worker:shop.example.com-worker_00",
                        "state": "RUNNING"
                    }
                ]
            }
        },
        {
            "id": 15,
            "name": "Docs",
            "domain": "docs.example.com",
            "stackType": "static",
            "server": "edge-2",
            "reachable": false,
            "scheduler": null,
            "workers": null
        }
    ]
}
GET /api/system/doctor

Run the installation doctor

Runs a read-only health check of the panel installation and the host and returns every finding. Checks cover the panel (run user, file ownership, database and backups, git checkout and remote, secrets, restart capability, Node version, agent build), tools, systemd services and nginx -t, system resources (disk, inodes, memory, swap, reboot, NTP, sudo) and local sites. Nothing is changed.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • Check shape: id (stable identifier, e.g. git, tool.nginx, svc.nginx, site.12.siteNoVhost), group (panel | tools | services | system | sites), status (ok | info | warn | fail), optional label (an untranslated proper name such as a tool, unit or domain), code (message key; the UI translates system.doctor.msg.<code>), optional params (values for the message), optional fix (a shell command that fixes it β€” shown, never executed).
  • summary counts the checks per status.
  • A check that throws is reported as status warn with code checkError and params.detail instead of failing the whole report.
  • Can take several seconds (file ownership scan, git ls-remote, nginx -t).
cURL
curl "https://panel.example.com/api/system/doctor" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "generatedAt": "2026-11-27T10:00:00.000Z",
    "durationMs": 2140,
    "summary": {
        "ok": 31,
        "info": 3,
        "warn": 2,
        "fail": 0
    },
    "checks": [
        {
            "id": "database",
            "group": "panel",
            "status": "ok",
            "code": "dbOk",
            "params": {
                "sizeMb": 42
            }
        },
        {
            "id": "svc.php8.3-fpm",
            "group": "services",
            "status": "fail",
            "label": "php8.3-fpm",
            "code": "svcInactive",
            "fix": "sudo systemctl restart php8.3-fpm"
        }
    ]
}
GET /api/system/update/version

Get panel version and update state

Returns the running panel's version (git commit, branch, Node version, boot time), the current self-update state and how the panel can restart itself on this host.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • state.status is one of: idle, running, restarting, success, failed, rolled_back, needs_restart, up_to_date. A running state whose process is gone (or stuck in phase init for more than 90 s) is reported as failed with an explanatory message.
  • capabilities.restartMode: detached (systemd-run outside the service, with verify and auto-rollback), sudo (the script restarts the unit through passwordless sudo), self (the API exits and systemd restarts it), manual (someone must run systemctl restart).
  • version fields are null when the checkout is not a git repository. service comes from PANEL_SERVICE (default orchestrator-api).
cURL
curl "https://panel.example.com/api/system/update/version" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "version": {
        "commit": "a3f9c21",
        "commitFull": "a3f9c21e5b7d4c0f9a8e6b3d2c1f0e9d8c7b6a50",
        "commitDate": "2026-11-20T09:12:00+04:00",
        "subject": "Fix SSL renew cron",
        "branch": "main",
        "node": "v20.18.0",
        "startedAt": "2026-11-26T08:00:00.000Z"
    },
    "state": {
        "status": "idle",
        "phase": "",
        "message": "",
        "startedAt": null,
        "finishedAt": null,
        "fromCommit": "",
        "toCommit": "",
        "branch": "",
        "dbBackup": "",
        "pid": 0
    },
    "capabilities": {
        "restartMode": "detached",
        "underSystemd": true,
        "runsAsRoot": true,
        "scriptPresent": true
    },
    "service": "orchestrator-api"
}
POST /api/system/update/check

Check for panel updates

Fetches the current branch from origin (git, as the checkout's owner) and reports how far behind/ahead the checkout is, the incoming commits (up to 50), which sensitive areas they touch and whether an update can run.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
500
Panel update request failed. A git command failed (e.g. origin unreachable); the body also has details (stderr, max 2000 chars).
  • Send no body (or a valid JSON body): Fastify rejects Content-Type: application/json with an empty body (FST_ERR_CTP_EMPTY_JSON_BODY).
  • blocker: dirty (tracked local changes, listed in dirty, max 30), diverged (local commits not on origin), detached (HEAD detached; nothing is fetched). canUpdate is true only when behind > 0 and there is no blocker.
  • touches flags: schema (apps/api/prisma/schema.prisma), scripts (scripts/*.sh), serviceUnit (scripts/orchestrator-*.service|timer), nginx (scripts/nginx-panel.conf), dependencies (pnpm-lock.yaml).
  • POST because it runs git fetch, which updates the remote-tracking refs; it does not change the working tree.
cURL
curl -X POST "https://panel.example.com/api/system/update/check" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "branch": "main",
    "current": "a3f9c21",
    "latest": "b71e0d4",
    "behind": 2,
    "ahead": 0,
    "dirty": [],
    "commits": [
        {
            "hash": "b71e0d4",
            "subject": "Add disk forecast alerts",
            "author": "Ada Lovelace",
            "date": "2026-11-26T18:30:00+04:00"
        }
    ],
    "touches": {
        "schema": true,
        "scripts": false,
        "serviceUnit": false,
        "nginx": false,
        "dependencies": true
    },
    "canUpdate": true,
    "blocker": null
}
POST /api/system/update/start

Start a panel self-update

Launches scripts/panel-update.sh, which builds the new version next to the running one, smoke-tests it and only then switches and restarts. The call returns immediately; follow progress with GET /api/system/update/status.

  • Token or session
  • Admin
  • Audit: system.panel_update_started

Body

force boolean
Rebuild even when already up to date (sets ORCH_FORCE=1 for the script).default false; body optional

Errors

400
Could not start the update: <reason> systemd-run failed in detached mode (code launch_failed).
400
The panel runs as a different user than the owner of <repo root> (<owner>) and cannot update it. The API is not root and not the checkout owner (code not_owner).
400
scripts/panel-update.sh is missing from the checkout. The update script does not exist (code no_script).
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
409
A panel update is already running. The update state is running or restarting (code in_progress).
409
A site deployment is running. Wait for it to finish, then update the panel. At least one deployment has status running (code deploy_running).
500
Panel update request failed. Any other failure; the body also has details.
  • Refusals have the body {"error": "<message>", "code": "<code>"}.
  • The state is set to running/phase init immediately so a second call gets 409.
  • The panel restarts at the end of a successful update; in-flight requests and streams are cut. When the new process boots it records state success and writes the audit entry system.panel_updated.
  • In self mode the API waits up to 10 minutes for running deployments before exiting. In manual mode the update ends in needs_restart.
cURL
curl -X POST "https://panel.example.com/api/system/update/start" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "force": false
}'
200Response Β· application/json
{
    "started": true,
    "mode": "detached"
}
GET /api/system/update/status

Get panel update progress

Returns the self-update state, whether an update is in progress and the log of the most recent run (last ~120 KB of .update/update.log). Poll it while an update runs.

  • Token or session
  • Admin

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
  • inProgress is true when state.status is running or restarting.
  • Expect the request to fail briefly while the panel restarts at the end of an update.
  • The state shape is the same as in GET /api/system/update/version; phase and message are free text written by the script. The dbBackup and log values in the example are illustrative.
cURL
curl "https://panel.example.com/api/system/update/status" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "state": {
        "status": "running",
        "phase": "build",
        "message": "Building the web app…",
        "startedAt": "2026-11-27T10:00:00.000Z",
        "finishedAt": null,
        "fromCommit": "a3f9c21",
        "toCommit": "b71e0d4",
        "branch": "main",
        "dbBackup": "/opt/orchestrator/backups/panel/pre-update-20261127-1000.db",
        "pid": 48211
    },
    "inProgress": true,
    "log": "[10:00:01] ════════ Panel update started ════════\n[10:00:03] Fetching origin/main…\n"
}
POST /api/system/update/restart

Restart the panel after an update

Finishes an update that stopped at needs_restart by restarting the panel. Only possible when the restart mode is self: the API exits about 300 ms after answering (after waiting for running deployments, max 10 minutes) and systemd starts the new build.

  • Token or session
  • Admin
  • Audit: system.panel_restart

Errors

400
No finished update is waiting for a restart. state.status is not needs_restart (code not_needed).
400
The panel cannot restart itself on this host. Run: sudo systemctl restart orchestrator-api restartMode is not self (code manual); the service name comes from PANEL_SERVICE.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
403
Forbidden: insufficient role Caller is not an admin.
500
Panel update request failed. Any other failure; the body also has details.
  • Send no body (or a valid JSON body).
  • Any restart mode other than self (including detached and sudo) is refused with code manual.
cURL
curl -X POST "https://panel.example.com/api/system/update/restart" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response Β· application/json
{
    "ok": true,
    "mode": "self"
}