Skip to content

API reference

Account, team and settings

Login and 2FA, users, tokens, settings, the audit log, tasks, notes and calendar.

Authentication

Log in, your profile and two-factor authentication.

POST /api/auth/login

Log in

Checks an email and password and returns a signed session token (JWT). When the account has two-factor authentication enabled and no totpCode is sent, the response is {"requiresTOTP": true} instead of a token; repeat the request with the current 6-digit code in totpCode.

  • Public
  • โฑ 10 per 15 minutes per IP

Body

email stringrequired
Account email, matched exactly as stored.1โ€“254 chars
password stringrequired
Account password.1โ€“128 chars
totpCode string
Current authenticator code. Needed only when the account has 2FA enabled.max 8 chars

Errors

401
Invalid TOTP code 2FA is enabled and the totpCode does not verify.
401
Invalid credentials No account with this email, or the password is wrong.
429
Rate limit exceeded, retry in 15 minutes More than 10 login attempts from this IP within 15 minutes (@fastify/rate-limit default body).
429
Rate limit exceeded, retry in โ€ฆ Too many requests โ€” see the Retry-After header.
  • The JWT payload is {userId, email, role}; it expires after JWT_EXPIRES_IN (default "24h"). Send it as Authorization: Bearer <token>.
  • The role is baked into the JWT at login: a later role change only affects this session after a new login.
  • A 2FA challenge returns HTTP 200 with {"requiresTOTP": true}, not an error status.
  • TOTP verification accepts one 30-second step of clock drift either way. A code used to log in is remembered so it cannot be replayed for the fleet 2FA step-up.
  • A bcrypt comparison runs even for unknown emails so response time does not reveal whether an account exists.
  • Unknown body fields are removed silently (additionalProperties: false).
cURL
curl -X POST "https://panel.example.com/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "correct-horse-battery",
    "totpCode": "492817"
}'
200Response ยท application/json
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyfQ.c2lnbmF0dXJl"
}
GET /api/auth/me

Get the current user

Returns the account behind the session token or access token used for the request.

  • 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.
  • locale is null when the user never chose a language.
  • If the user was deleted while their JWT is still valid, the response is 200 with a null body.
  • The field is named id (the web client's TypeScript type calls it userId, but the API returns id).
cURL
curl "https://panel.example.com/api/auth/me" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "id": 12,
    "email": "[email protected]",
    "totpEnabled": true,
    "role": "admin",
    "locale": "en"
}
PATCH /api/auth/me

Update own preferences

Changes the signed-in user's own preferences. Currently only the UI language (locale) can be changed. Any role may call it.

  • Token or session
  • Any role

Body

locale string
UI language code such as en, ka or pt-BR.pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,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.
  • Only the shape of locale is checked; the set of available languages is defined by the web client.
  • An empty body is a no-op that returns the user unchanged. locale cannot be reset to null through this endpoint (null fails validation).
  • Unknown body fields are removed silently.
cURL
curl -X PATCH "https://panel.example.com/api/auth/me" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locale": "ka"
}'
200Response ยท application/json
{
    "id": 12,
    "email": "[email protected]",
    "totpEnabled": true,
    "role": "admin",
    "locale": "ka"
}
GET /api/auth/2fa/setup

Start two-factor setup

Generates a new TOTP secret for the current user and returns it with a QR code to scan in an authenticator app. 2FA is not enabled yet: confirm with POST /api/auth/2fa/enable.

  • Token or session
  • Any role

Errors

400
2FA is already enabled โ€” disable it first to set up a new device. The user already has 2FA enabled.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Although it is a GET, it has a side effect: the new secret is stored (encrypted at rest) as the pending secret, replacing any earlier pending one. Calling it twice invalidates the first QR code.
  • The QR code encodes an otpauth:// URL with the account label "Orchestrator (<email>)".
cURL
curl "https://panel.example.com/api/auth/2fa/setup" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "secret": "JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP",
    "qrDataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
POST /api/auth/2fa/enable

Enable two-factor authentication

Verifies a code from the authenticator app against the pending secret created by GET /api/auth/2fa/setup and turns 2FA on. From then on, login requires a TOTP code.

  • Token or session
  • Any role

Body

totpCode stringrequired
Current code from the authenticator app.6โ€“8 chars

Errors

400
Invalid code โ€” try again The code does not verify against the stored secret.
400
Run /2fa/setup first No TOTP secret is stored for the user.
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Accepts one 30-second step of clock drift either way.
  • No audit entry is written.
cURL
curl -X POST "https://panel.example.com/api/auth/2fa/enable" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "totpCode": "492817"
}'
200Response ยท application/json
{
    "ok": true
}
DELETE /api/auth/2fa

Disable two-factor authentication

Turns 2FA off for the current user and deletes the stored TOTP secret. Any active fleet 2FA step-up (elevation) of this user ends immediately.

  • 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.
  • No current TOTP code or password is required to disable 2FA; the session or access token alone is enough.
  • Always succeeds, also when 2FA was not enabled. No audit entry is written.
cURL
curl -X DELETE "https://panel.example.com/api/auth/2fa" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}

Users

Team members, roles and site access.

GET /api/users

List users

Lists every panel user, oldest first. 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.
  • Password hashes and TOTP fields are never returned.
cURL
curl "https://panel.example.com/api/users" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "users": [
        {
            "id": 1,
            "email": "[email protected]",
            "role": "admin",
            "allSitesAccess": false,
            "createdAt": "2026-01-15T09:00:00.000Z"
        },
        {
            "id": 12,
            "email": "[email protected]",
            "role": "developer",
            "allSitesAccess": true,
            "createdAt": "2026-11-27T10:00:00.000Z"
        }
    ]
}
POST /api/users

Create a user

Creates a panel user with a password and role. Admin only. New non-admin users have no site access until sites are granted with PUT /api/users/{id}/sites or allSitesAccess is turned on.

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

Body

email stringrequired
Login email. Must be unique.3โ€“254 chars (format not checked)
password stringrequired
Initial password (stored as a bcrypt hash).8โ€“128 chars
role stringrequired
Role of the new user.one of: admin, developer, viewer

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.
409
A user with this email already exists. The email is already taken.
  • The audit entry stores {email, role}.
  • Unknown body fields are removed silently.
cURL
curl -X POST "https://panel.example.com/api/users" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "a-long-initial-password",
    "role": "developer"
}'
201Response ยท application/json
{
    "id": 12,
    "email": "[email protected]",
    "role": "developer",
    "allSitesAccess": false,
    "createdAt": "2026-11-27T10:00:00.000Z"
}
PATCH /api/users/{id}

Update a user

Changes a user's email, role or blanket access to all sites. Admin only. Only the fields sent are changed. Admins cannot change their own role.

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

Path parameters

id integerrequired
User id.

Body

email string
New login email.3โ€“254 chars
role string
New role.one of: admin, developer, viewer
allSitesAccess boolean
Grant (true) or remove (false) access to every site, including sites created later. Only matters for non-admins.

Errors

400
You cannot change your own role. role is sent and {id} is the caller.
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.
404
User not found. No user with this id.
  • Changing email to one that another user already has is not checked by the handler; the database unique constraint rejects it, which surfaces as a 500 error.
  • A role change applies immediately to the user's personal access tokens (role is read from the database per request), but existing JWT sessions keep the old role until they expire or the user logs in again.
  • The self-role check applies even when the role sent equals the current role.
  • There is no check that at least one admin remains when demoting an admin.
cURL
curl -X PATCH "https://panel.example.com/api/users/4" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "viewer",
    "allSitesAccess": true
}'
200Response ยท application/json
{
    "id": 12,
    "email": "[email protected]",
    "role": "viewer",
    "allSitesAccess": true,
    "createdAt": "2026-11-27T10:00:00.000Z"
}
DELETE /api/users/{id}

Delete a user

Permanently deletes a user. Admin only. You cannot delete your own account or the last remaining admin.

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

Path parameters

id integerrequired
User id.

Errors

400
Cannot delete the last admin user. The target is the only admin.
400
You cannot delete your own account. {id} is the caller.
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.
404
User not found. No user with this id.
  • Deletion cascades in the database: the user's personal access tokens, site grants, dashboard presets, Telegram link, task comments, note shares, calendar attendance, and also the tasks they created, the notes they own and the calendar events they created are deleted. Tasks assigned to them become unassigned; their audit log entries keep the action with userId set to null.
  • JWT sessions of the deleted user are not revoked; they remain cryptographically valid until they expire.
  • The audit entry stores the deleted user's email.
cURL
curl -X DELETE "https://panel.example.com/api/users/4" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}
GET /api/users/{id}/sites

List a user's site grants

Returns the ids of the sites explicitly granted to a user, plus whether the user has blanket access to all sites. Admin only.

  • Token or session
  • Admin

Path parameters

id integerrequired
User 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.
404
User not found. No user with this id.
  • Admins always have access to every site regardless of this list.
cURL
curl "https://panel.example.com/api/users/4/sites" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "siteIds": [
        3,
        7
    ],
    "allSitesAccess": false
}
PUT /api/users/{id}/sites

Replace a user's site grants

Replaces all explicit site grants of a user with the given list, in one transaction. Admin only. Send an empty array to remove every grant.

  • Token or session
  • Admin
  • Audit: user.sites_updated

Path parameters

id integerrequired
User id.

Body

siteIds arrayrequired
Ids of the sites the user may access (array of integers).items: integer

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.
404
User not found. No user with this id.
  • Site ids are not checked by the handler. A duplicate id or an id of a site that does not exist makes the database reject the transaction (surfaces as a 500 error) and the previous grants are kept.
  • Grants are ignored for admins and for users with allSitesAccess: true, who can access every site anyway.
  • Viewers stay read-only on the granted sites.
cURL
curl -X PUT "https://panel.example.com/api/users/4/sites" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "siteIds": [
        3,
        7
    ]
}'
200Response ยท application/json
{
    "ok": true,
    "siteIds": [
        3,
        7
    ]
}

Access tokens

Personal access tokens.

GET /api/tokens

List your access tokens

Lists the caller's own personal access tokens, newest first. The secret token value is never returned; tokenPrefix identifies each token.

  • 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.
  • Only the caller's tokens are listed; admins cannot see other users' tokens here.
  • lastUsedAt is updated best-effort on every request made with the token. Expired tokens are still listed.
cURL
curl "https://panel.example.com/api/tokens" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "tokens": [
        {
            "id": 4,
            "name": "CI deploys",
            "tokenPrefix": "orch_1a2b3c",
            "lastUsedAt": "2026-11-27T09:42:00.000Z",
            "expiresAt": null,
            "createdAt": "2026-10-01T08:00:00.000Z"
        }
    ]
}
POST /api/tokens

Create an access token

Creates a personal access token for the caller and returns the plaintext token once. The token acts as the caller, with the caller's current role and site access; send it as Authorization: Bearer orch_โ€ฆ

  • Token or session
  • Any role
  • Audit: token.created

Body

name stringrequired
Label shown in the token list and in the AI activity log.1โ€“80 chars
expiresInDays integer
Days until the token expires. Omit for a token that never expires.1โ€“3650

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 token is "orch_" followed by 64 hex characters. Only its SHA-256 hash is stored, so it cannot be shown again; tokenPrefix is its first 11 characters.
  • Role and site access are not frozen at creation: they are read from the owner's account on every request.
  • Every request made with a personal access token is recorded in the AI activity log (GET /api/mcp-activity). An optional X-MCP-Tool header (max 64 chars kept) labels the request with a tool name.
  • An access token can itself create further tokens.
cURL
curl -X POST "https://panel.example.com/api/tokens" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI deploys",
    "expiresInDays": 90
}'
201Response ยท application/json
{
    "id": 4,
    "name": "CI deploys",
    "tokenPrefix": "orch_1a2b3c",
    "expiresAt": "2027-02-25T10:00:00.000Z",
    "createdAt": "2026-11-27T10:00:00.000Z",
    "token": "orch_1a2b3c0000000000000000000000000000000000000000000000000000000000"
}
DELETE /api/tokens/{id}

Revoke an access token

Deletes one of the caller's own access tokens. It stops working immediately.

  • Token or session
  • Any role
  • Audit: token.revoked

Path parameters

id integerrequired
Token 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.
404
Token not found No token with this id, or it belongs to another user.
  • Admins cannot revoke other users' tokens with this endpoint (they get 404).
cURL
curl -X DELETE "https://panel.example.com/api/tokens/9" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}

Settings

Panel settings and the weekly digest.

GET /api/settings

Get panel settings

Returns the panel-wide settings as a flat key/value object. Admin only. Secret settings are write-only: they come back as "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข" when set and as an empty string when empty.

  • 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.
  • Only keys that have been saved at least once appear; unset keys are absent from the object (not null).
  • Accepted keys (ALLOWED_KEYS): panel_title, panel_url, notify_email, deploy_slack_webhook, deploy_discord_webhook, deploy_telegram_bot_token, deploy_telegram_chat_id, deploy_generic_webhook, s3_access_key, s3_secret_key, s3_region, s3_bucket, s3_endpoint, mysql_root_user, mysql_root_password, do_api_token, do_droplet_id, cloudflare_api_token, cloudflare_zone_id, server_public_ip.
  • Write-only / redacted in this response (REDACTED_KEYS): s3_secret_key, mysql_root_password, do_api_token, deploy_telegram_bot_token, cloudflare_api_token, deploy_slack_webhook, deploy_discord_webhook, deploy_generic_webhook, s3_access_key.
  • Encrypted at rest with AES-256-GCM (ENCRYPTED_SETTING_KEYS): mysql_root_password, s3_secret_key, do_api_token, deploy_telegram_bot_token, cloudflare_api_token. The other redacted keys (webhook URLs, s3_access_key) are stored in plaintext but never returned.
  • Internal settings kept in the same table (telegram_webhook_secret, weekly_digest_enabled, weekly_digest_day, weekly_digest_last) are never returned here; the digest ones are exposed through /api/digest.
cURL
curl "https://panel.example.com/api/settings" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "panel_title": "Orchestrator",
    "panel_url": "https://panel.example.com",
    "notify_email": "[email protected]",
    "deploy_slack_webhook": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",
    "deploy_telegram_bot_token": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",
    "deploy_telegram_chat_id": "-1001234567890",
    "s3_access_key": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",
    "s3_secret_key": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",
    "s3_region": "auto",
    "s3_bucket": "backups",
    "s3_endpoint": "https://s3.example.com",
    "mysql_root_user": "root",
    "mysql_root_password": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข",
    "server_public_ip": "203.0.113.10"
}
PUT /api/settings

Update panel settings

Saves one or more panel-wide settings. Admin only. Send only the keys you want to change; each is created or overwritten. Unknown keys are ignored, and the redaction placeholder "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข" sent for a secret key is ignored so an unchanged secret is never overwritten.

  • Token or session
  • Admin

Body

panel_title string
Panel name shown in the UI.not validated
panel_url string
Public base URL of the panel (used e.g. for the Telegram webhook URL).not validated
notify_email string
Recipient address for email notifications (sent only when SMTP is configured on the server).not validated
deploy_slack_webhook string
Slack incoming-webhook URL for notifications. Write-only.not validated
deploy_discord_webhook string
Discord webhook URL for notifications. Write-only.not validated
deploy_telegram_bot_token string
Telegram bot token for notifications and the Telegram bot. Write-only, encrypted at rest.not validated
deploy_telegram_chat_id string
Telegram chat id that receives notifications.not validated
deploy_generic_webhook string
Generic webhook URL that receives notification payloads. Write-only.not validated
s3_access_key string
S3/R2 access key for backups. Write-only.not validated
s3_secret_key string
S3/R2 secret key for backups. Write-only, encrypted at rest.not validated
s3_region string
S3 region.not validated
s3_bucket string
S3 bucket name.not validated
s3_endpoint string
S3-compatible endpoint URL (e.g. for R2).not validated
mysql_root_user string
MySQL user used to create and drop site databases.not validated
mysql_root_password string
Password of that MySQL user. Write-only, encrypted at rest.not validated
do_api_token string
DigitalOcean API token (Server page, droplet control). Write-only, encrypted at rest.not validated
do_droplet_id string
DigitalOcean droplet id of this server.not validated
cloudflare_api_token string
Cloudflare API token for automatic DNS A records on provisioning. Write-only, encrypted at rest.not validated
cloudflare_zone_id string
Cloudflare zone id.not validated
server_public_ip string
Public IP address used for DNS records.not validated

Errors

400
No valid settings keys provided. After dropping unknown keys and redaction placeholders, nothing is left to save.
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.
  • There is no request schema: the body is a free-form JSON object and values must be strings. A non-string value or a missing/null body is not validated and fails with a 500 error.
  • An empty string is stored as-is, which clears the setting.
  • Write-only keys: s3_secret_key, mysql_root_password, do_api_token, deploy_telegram_bot_token, cloudflare_api_token, deploy_slack_webhook, deploy_discord_webhook, deploy_generic_webhook, s3_access_key. Of these, mysql_root_password, s3_secret_key, do_api_token, deploy_telegram_bot_token and cloudflare_api_token are encrypted at rest (AES-256-GCM).
  • Internal keys such as telegram_webhook_secret or weekly_digest_* cannot be written here (they are not in the allow-list and are ignored).
  • No audit entry is written for settings changes.
cURL
curl -X PUT "https://panel.example.com/api/settings" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "panel_url": "https://panel.example.com",
    "deploy_telegram_chat_id": "-1001234567890",
    "s3_secret_key": "โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"
}'
200Response ยท application/json
{
    "ok": true,
    "updated": [
        "panel_url",
        "deploy_telegram_chat_id"
    ]
}
POST /api/settings/change-password

Change your password

Changes the caller's own password after checking the current one. Any role may call it.

  • Token or session
  • Any role

Body

oldPassword stringrequired
Current password.1โ€“128 chars
newPassword stringrequired
New password.8โ€“128 chars

Errors

400
Current password is incorrect. oldPassword does not match.
400
New password must be at least 8 characters. newPassword is shorter than 8 characters (in practice schema validation rejects this first with FST_ERR_VALIDATION).
401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
404
User not found. The caller's account no longer exists.
  • Existing JWT sessions and personal access tokens stay valid after a password change.
  • No audit entry is written.
cURL
curl -X POST "https://panel.example.com/api/settings/change-password" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "oldPassword": "correct-horse-battery",
    "newPassword": "a-new-long-password"
}'
200Response ยท application/json
{
    "ok": true,
    "message": "Password changed successfully."
}
GET /api/digest

Get weekly digest settings

Returns the weekly digest configuration and a live preview of the digest for the last 7 days, computed from data already in the database. 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.
  • day is the weekday the digest is sent on: 0 = Sunday โ€ฆ 6 = Saturday (server local time); defaults to 1 (Monday) when never set.
  • lastSent is the date (YYYY-MM-DD, UTC) of the last scheduled send, or null. Manual sends via POST /api/digest/send-now do not update it.
  • preview.uptimePct (one decimal) and preview.avgMs are null when there were no uptime checks in the period. errOpen counts unresolved, non-ignored log errors; errNew counts non-ignored log errors first seen in the period.
cURL
curl "https://panel.example.com/api/digest" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "enabled": true,
    "day": 1,
    "lastSent": "2026-11-23",
    "preview": {
        "since": "2026-11-20T10:00:00.000Z",
        "deploySuccess": 14,
        "deployFailed": 1,
        "uptimePct": 99.8,
        "avgMs": 312,
        "errOpen": 3,
        "errNew": 2,
        "sites": 6
    }
}
PATCH /api/digest

Update weekly digest settings

Turns the weekly digest on or off and sets the weekday it is sent on. Admin only. Only the fields sent are changed.

  • Token or session
  • Admin
  • Audit: digest.config

Body

enabled boolean
Send the digest automatically every week.
day integer
Weekday to send on: 0 = Sunday โ€ฆ 6 = Saturday.0โ€“6

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.
  • When enabled, an hourly background check sends the digest once on the configured weekday (server local time) to all configured notification channels and the in-app feed.
  • The audit entry stores the request body.
cURL
curl -X PATCH "https://panel.example.com/api/digest" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "day": 1
}'
200Response ยท application/json
{
    "ok": true
}
POST /api/digest/send-now

Send the weekly digest now

Builds the 7-day digest and sends it immediately to every configured notification channel (email, Slack, Discord, Telegram, generic webhook โ€” whichever are set up), and adds it to the in-app notification feed. Admin only. Works whether or not the weekly digest is enabled.

  • Token or session
  • Admin
  • Audit: digest.sent_manually

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.
  • Does not update lastSent, so the scheduled send still happens on the configured weekday.
  • Channel delivery failures are not reported in the response.
cURL
curl -X POST "https://panel.example.com/api/digest/send-now" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true,
    "digest": {
        "since": "2026-11-20T10:00:00.000Z",
        "deploySuccess": 14,
        "deployFailed": 1,
        "uptimePct": 99.8,
        "avgMs": 312,
        "errOpen": 3,
        "errNew": 2,
        "sites": 6
    }
}

Audit and AI activity

The audit log and the log of token (AI) requests.

GET /api/audit

List audit log entries

Returns audit log entries, newest first, with paging and an optional site filter. Each entry includes the email and role of the user who performed the action.

  • Token or session
  • Any role

Query parameters

siteId integer
Only entries for this site.not validated
limit integer
Page size.default 50, max 200; not validated
offset integer
Number of entries to skip.default 0; not validated

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Not admin-only: every authenticated user, viewers included, can read the full audit log of all sites. The siteId filter is not checked against the caller's site grants.
  • meta is parsed from its stored JSON string into an object (null when absent). userEmail/userRole are null when the user was deleted or the action had no user.
  • There is no query schema: non-numeric siteId/limit/offset values are not rejected cleanly and lead to a 500 error. limit has no lower bound.
  • total counts all entries matching the filter.
cURL
curl "https://panel.example.com/api/audit" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "logs": [
        {
            "id": 812,
            "action": "user.created",
            "siteId": null,
            "userId": 1,
            "meta": {
                "email": "[email protected]",
                "role": "developer"
            },
            "createdAt": "2026-11-27T10:00:00.000Z",
            "userEmail": "[email protected]",
            "userRole": "admin"
        }
    ],
    "total": 1,
    "limit": 50,
    "offset": 0
}
GET /api/mcp-activity

List AI client activity

Lists requests made with personal access tokens (typically MCP/AI clients), newest first, with optional filters, plus a summary of the last 24 hours. Admin only.

  • Token or session
  • Admin

Query parameters

tokenId integer
Only requests made with this access token.not validated
siteId integer
Only requests that targeted this site.not validated
tool string
Only requests with this exact MCP tool name (from the X-MCP-Tool header).exact match
type string
write = POST/PUT/PATCH/DELETE only; read = GET only. Any other value means no method filter.one of: read, write
q string
Substring to look for in the request path.
limit integer
Maximum number of items.default 100, min 1, max 500

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.
  • Recorded by a global onResponse hook for every request authenticated with a personal access token (reads and writes); panel (JWT) sessions are not recorded. Recording is best-effort.
  • siteId is filled only for paths containing /sites/<number>. path never includes the query string. ok is status < 400.
  • The recorder never fills detail, so it is always null in practice.
  • The summary always covers the last 24 hours of all activity and ignores the filters. actions24h counts non-GET requests; errors24h counts requests with ok = false.
  • The table is pruned to roughly the 10,000 most recent rows (the prune runs at random on about 2% of recorded requests).
  • tokenId is kept even after the token is revoked.
cURL
curl "https://panel.example.com/api/mcp-activity" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "items": [
        {
            "id": 5310,
            "createdAt": "2026-11-27T10:00:00.000Z",
            "tokenId": 4,
            "tokenName": "CI deploys",
            "userEmail": "[email protected]",
            "tool": "deploy_site",
            "method": "POST",
            "path": "/api/sites/12/deploy",
            "siteId": 12,
            "status": 200,
            "ok": true,
            "durationMs": 184,
            "ip": "203.0.113.25",
            "detail": null
        }
    ],
    "summary": {
        "last24h": 42,
        "actions24h": 5,
        "errors24h": 1
    }
}
GET /api/mcp-activity/filters

List AI activity filter values

Returns the distinct access tokens and MCP tool names found in the activity log, to populate filter dropdowns. 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.
  • At most 100 tokens and 200 tools (tools sorted alphabetically).
  • tokenName comes from one of the recorded rows for that token; if a token was renamed, which name appears is not guaranteed.
cURL
curl "https://panel.example.com/api/mcp-activity/filters" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "tokens": [
        {
            "tokenId": 4,
            "tokenName": "CI deploys"
        }
    ],
    "tools": [
        "deploy_site",
        "list_sites"
    ]
}

Tasks, notes and calendar

Tasks, notes and calendar events.

GET /api/tasks

List tasks

Lists Kanban tasks with optional filters, ordered by status and then position. Admins see all tasks; other roles see only tasks they created or are assigned to.

  • Token or session
  • Any role

Query parameters

siteId integer
Only tasks linked to this site.not validated
assigneeId integer
Only tasks assigned to this user.not validated
status string
Only tasks in this column.todo, in_progress, review or done (not validated)
mine string
Set to 1 to return only tasks assigned to the caller.only "1" has an effect

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • tags is returned as a JSON-encoded string array (e.g. "[\"ssl\"]"), not as an array.
  • Ordering is by status alphabetically (done, in_progress, review, todo) and then by position.
  • Tasks are not filtered by the caller's site grants; a non-admin's visibility depends only on being creator or assignee.
  • When mine=1 and assigneeId are both sent, assigneeId wins. Non-numeric siteId/assigneeId lead to a 500 error.
cURL
curl "https://panel.example.com/api/tasks" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "tasks": [
        {
            "id": 42,
            "title": "Renew SSL for shop",
            "description": "Check the certificate before Friday.",
            "status": "in_progress",
            "priority": "high",
            "position": 3,
            "dueDate": "2026-11-30T00:00:00.000Z",
            "tags": "[\"ssl\",\"shop\"]",
            "siteId": 12,
            "assigneeId": 12,
            "createdById": 1,
            "createdAt": "2026-11-20T09:00:00.000Z",
            "updatedAt": "2026-11-27T10:00:00.000Z",
            "assignee": {
                "id": 12,
                "email": "[email protected]"
            },
            "createdBy": {
                "id": 1,
                "email": "[email protected]"
            },
            "site": {
                "id": 12,
                "domain": "shop.example.com",
                "name": "Shop"
            },
            "checklist": [
                {
                    "id": 7,
                    "taskId": 42,
                    "text": "Check expiry date",
                    "done": true,
                    "position": 0
                }
            ],
            "_count": {
                "comments": 2
            }
        }
    ]
}
GET /api/tasks/{id}

Get a task

Returns one task with its checklist and comments. Non-admins can only open tasks they created or are assigned to.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task 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 The caller is not an admin and neither created nor is assigned to the task.
404
Task not found No task with this id.
  • tags is a JSON-encoded string array.
cURL
curl "https://panel.example.com/api/tasks/7" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "id": 42,
    "title": "Renew SSL for shop",
    "description": "Check the certificate before Friday.",
    "status": "in_progress",
    "priority": "high",
    "position": 3,
    "dueDate": "2026-11-30T00:00:00.000Z",
    "tags": "[\"ssl\",\"shop\"]",
    "siteId": 12,
    "assigneeId": 12,
    "createdById": 1,
    "createdAt": "2026-11-20T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "assignee": {
        "id": 12,
        "email": "[email protected]"
    },
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "checklist": [
        {
            "id": 7,
            "taskId": 42,
            "text": "Check expiry date",
            "done": true,
            "position": 0
        }
    ],
    "_count": {
        "comments": 1
    },
    "comments": [
        {
            "id": 88,
            "taskId": 42,
            "userId": 12,
            "body": "Expires on 2 December.",
            "createdAt": "2026-11-27T10:00:00.000Z",
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        }
    ]
}
POST /api/tasks

Create a task

Creates a task; it is placed at the bottom of its status column. Non-admins may only leave a task unassigned or assign it to themselves.

  • Token or session
  • Any role
  • Audit: task.created

Body

title stringrequired
Task title.1โ€“200 chars
description string
Longer description.max 10000 chars
status string
Column.one of: todo, in_progress, review, done; default todo
priority string
Priority.one of: low, medium, high, urgent; default medium
dueDate string
Due date, any string JavaScript's Date can parse (ISO 8601 recommended).format not validated
tags array
Tags (array of strings).items: string; default []
siteId integer
Site to link the task to.
assigneeId integer
User to assign the task to.non-admins: only their own 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
Only admins can assign tasks to other users. A non-admin sends an assigneeId other than their own.
  • Any role, viewers included, can create tasks.
  • siteId is not checked against the caller's site grants; a non-existent siteId or assigneeId, or an unparseable dueDate, is rejected by the database and surfaces as a 500 error.
  • position is the highest position in the target status column across all tasks, plus 1.
cURL
curl -X POST "https://panel.example.com/api/tasks" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Renew SSL for shop",
    "description": "Check the certificate before Friday.",
    "status": "todo",
    "priority": "high",
    "dueDate": "2026-11-30T00:00:00.000Z",
    "tags": [
        "ssl",
        "shop"
    ],
    "siteId": 12,
    "assigneeId": 12
}'
201Response ยท application/json
{
    "id": 42,
    "title": "Renew SSL for shop",
    "description": "Check the certificate before Friday.",
    "status": "todo",
    "priority": "high",
    "position": 4,
    "dueDate": "2026-11-30T00:00:00.000Z",
    "tags": "[\"ssl\",\"shop\"]",
    "siteId": 12,
    "assigneeId": 12,
    "createdById": 1,
    "createdAt": "2026-11-27T10:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "assignee": {
        "id": 12,
        "email": "[email protected]"
    },
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "checklist": [],
    "_count": {
        "comments": 0
    }
}
PATCH /api/tasks/{id}

Update a task

Changes any task fields, including moving it to another column or position. Only the fields sent are changed. Admins can edit any task; others only tasks they created or are assigned to, and they may only unassign it or assign it to themselves.

  • Token or session
  • Any role
  • Audit: task.updated

Path parameters

id integerrequired
Task id.

Body

title string
Task title.1โ€“200 chars
description string
Description; null clears it.max 10000 chars, nullable
status string
Column.one of: todo, in_progress, review, done
priority string
Priority.one of: low, medium, high, urgent
position number
Sort position within the column (fractional values allowed).
dueDate string
Due date; null or empty string clears it.nullable; format not validated
tags array
Replaces all tags (array of strings).items: string
siteId integer
Linked site; null unlinks.nullable
assigneeId integer
Assignee; null unassigns.nullable; non-admins: only their own id or 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 The caller is not an admin and neither created nor is assigned to the task.
403
Only admins can reassign tasks to other users. A non-admin sends an assigneeId other than their own id or null.
404
Task not found No task with this id.
  • Other tasks' positions are not renumbered; the client is expected to send a position between its neighbours.
  • The audit entry stores the task id and every changed field (tags as the JSON string).
  • A non-admin assignee who unassigns themselves loses access to the task unless they created it.
cURL
curl -X PATCH "https://panel.example.com/api/tasks/7" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "done",
    "position": 2.5
}'
200Response ยท application/json
{
    "id": 42,
    "title": "Renew SSL for shop",
    "description": "Check the certificate before Friday.",
    "status": "done",
    "priority": "high",
    "position": 2.5,
    "dueDate": "2026-11-30T00:00:00.000Z",
    "tags": "[\"ssl\",\"shop\"]",
    "siteId": 12,
    "assigneeId": 12,
    "createdById": 1,
    "createdAt": "2026-11-20T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "assignee": {
        "id": 12,
        "email": "[email protected]"
    },
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "checklist": [
        {
            "id": 7,
            "taskId": 42,
            "text": "Check expiry date",
            "done": true,
            "position": 0
        }
    ],
    "_count": {
        "comments": 2
    }
}
DELETE /api/tasks/{id}

Delete a task

Deletes a task together with its checklist and comments. Only the task's creator or an admin may delete it.

  • Token or session
  • Any role
  • Audit: task.deleted

Path parameters

id integerrequired
Task 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
Only the creator or an admin can delete this task. The caller is neither an admin nor the creator (assignees cannot delete).
404
Task not found No task with this id.
  • Calendar events linked to the task are kept, with their taskId set to null.
cURL
curl -X DELETE "https://panel.example.com/api/tasks/7" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}
POST /api/tasks/{id}/checklist

Add a checklist item

Appends a checklist item to the end of a task's checklist. Allowed for admins and for the task's creator or assignee.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task id.

Body

text stringrequired
Item text.1โ€“300 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.
403
Forbidden The caller is not an admin and neither created nor is assigned to the task.
404
Task not found No task with this id.
  • position is the task's highest checklist position plus 1 (0 for the first item).
cURL
curl -X POST "https://panel.example.com/api/tasks/7/checklist" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Check expiry date"
}'
201Response ยท application/json
{
    "id": 7,
    "taskId": 42,
    "text": "Check expiry date",
    "done": false,
    "position": 0
}
PATCH /api/tasks/{id}/checklist/{itemId}

Update a checklist item

Changes a checklist item's text, done state or position. Allowed for admins and for the task's creator or assignee.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task id.
itemId integerrequired
Checklist item id.

Body

text string
Item text.1โ€“300 chars
done boolean
Ticked or not.
position integer
Sort position.

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 The caller is not an admin and neither created nor is assigned to the task.
404
Task not found No task with this id.
  • Permissions are checked on task {id} only; the handler does not check that {itemId} belongs to that task.
  • A non-existent itemId is not handled and surfaces as a 500 error.
cURL
curl -X PATCH "https://panel.example.com/api/tasks/7/checklist/1" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "done": true
}'
200Response ยท application/json
{
    "id": 7,
    "taskId": 42,
    "text": "Check expiry date",
    "done": true,
    "position": 0
}
DELETE /api/tasks/{id}/checklist/{itemId}

Delete a checklist item

Removes a checklist item. Allowed for admins and for the task's creator or assignee.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task id.
itemId integerrequired
Checklist item 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 The caller is not an admin and neither created nor is assigned to the task.
404
Task not found No task with this id.
  • Permissions are checked on task {id} only; the handler does not check that {itemId} belongs to that task.
  • A non-existent itemId is not handled and surfaces as a 500 error.
cURL
curl -X DELETE "https://panel.example.com/api/tasks/7/checklist/1" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}
POST /api/tasks/{id}/comments

Comment on a task

Adds a comment by the caller to a task. Allowed for admins and for the task's creator or assignee.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task id.

Body

body stringrequired
Comment text.1โ€“5000 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.
403
Forbidden The caller is not an admin and neither created nor is assigned to the task.
404
Task not found No task with this id.
  • Comments cannot be edited, only deleted.
cURL
curl -X POST "https://panel.example.com/api/tasks/7/comments" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Expires on 2 December."
}'
201Response ยท application/json
{
    "id": 88,
    "taskId": 42,
    "userId": 12,
    "body": "Expires on 2 December.",
    "createdAt": "2026-11-27T10:00:00.000Z",
    "user": {
        "id": 12,
        "email": "[email protected]"
    }
}
DELETE /api/tasks/{id}/comments/{commentId}

Delete a task comment

Deletes a comment. Users can delete their own comments; admins can delete any comment.

  • Token or session
  • Any role

Path parameters

id integerrequired
Task id (not used by the handler).
commentId integerrequired
Comment 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
You can only delete your own comments. A non-admin tries to delete someone else's comment.
404
Comment not found No comment with this id.
  • The task id in the path is ignored: neither its existence nor the comment's membership in it is checked.
cURL
curl -X DELETE "https://panel.example.com/api/tasks/7/comments/1" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}
GET /api/notes

List notes

Lists every note the caller can see โ€” their own, notes shared with them and public notes โ€” pinned first, then most recently updated. Each note carries a canEdit flag for the caller.

  • Token or session
  • Any role

Query parameters

search string
Substring to look for in title or body.
tag string
Only notes that have exactly this tag.exact match
pinned string
Set to 1 to return only pinned notes.only "1" has an effect
siteId integer
Only notes linked to this site.not validated

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • Admins have no special visibility: they also see only their own, shared and public notes.
  • tags is a JSON-encoded string array. body is Markdown.
  • Public notes are read-only for everyone except the owner and users with an edit share.
cURL
curl "https://panel.example.com/api/notes" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "notes": [
        {
            "id": 5,
            "title": "Shop deploy checklist",
            "body": "1. Run migrations\n2. Clear cache",
            "pinned": true,
            "isPublic": false,
            "tags": "[\"runbook\"]",
            "siteId": 12,
            "ownerId": 1,
            "createdAt": "2026-11-01T09:00:00.000Z",
            "updatedAt": "2026-11-27T10:00:00.000Z",
            "owner": {
                "id": 1,
                "email": "[email protected]"
            },
            "site": {
                "id": 12,
                "domain": "shop.example.com",
                "name": "Shop"
            },
            "shares": [
                {
                    "userId": 12,
                    "canEdit": true,
                    "user": {
                        "id": 12,
                        "email": "[email protected]"
                    }
                }
            ],
            "canEdit": true
        }
    ]
}
GET /api/notes/{id}

Get a note

Returns one note if the caller owns it, it is shared with them, or it is public.

  • Token or session
  • Any role

Path parameters

id integerrequired
Note 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.
404
Note not found No note with this id, or the caller may not see it.
cURL
curl "https://panel.example.com/api/notes/6" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "id": 5,
    "title": "Shop deploy checklist",
    "body": "1. Run migrations\n2. Clear cache",
    "pinned": true,
    "isPublic": false,
    "tags": "[\"runbook\"]",
    "siteId": 12,
    "ownerId": 1,
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "owner": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "shares": [
        {
            "userId": 12,
            "canEdit": true,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        }
    ],
    "canEdit": true
}
POST /api/notes

Create a note

Creates a note owned by the caller.

  • Token or session
  • Any role
  • Audit: note.created

Body

title stringrequired
Note title.1โ€“200 chars
body string
Markdown content.max 100000 chars; default ""
tags array
Tags (array of strings).items: string; default []
pinned boolean
Pin the note to the top of the list.default false
isPublic boolean
Make the note visible (read-only) to every panel user.default false
siteId integer
Site to link the note to.

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • siteId is not checked against the caller's site grants; a non-existent siteId surfaces as a 500 error.
cURL
curl -X POST "https://panel.example.com/api/notes" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Shop deploy checklist",
    "body": "1. Run migrations\n2. Clear cache",
    "tags": [
        "runbook"
    ],
    "pinned": true,
    "isPublic": false,
    "siteId": 12
}'
201Response ยท application/json
{
    "id": 5,
    "title": "Shop deploy checklist",
    "body": "1. Run migrations\n2. Clear cache",
    "pinned": true,
    "isPublic": false,
    "tags": "[\"runbook\"]",
    "siteId": 12,
    "ownerId": 1,
    "createdAt": "2026-11-27T10:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "owner": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "shares": [],
    "canEdit": true
}
PATCH /api/notes/{id}

Update a note

Changes a note. Allowed for the owner and for users the note is shared with edit rights. Only the fields sent are changed; only the owner can change isPublic.

  • Token or session
  • Any role
  • Audit: note.updated

Path parameters

id integerrequired
Note id.

Body

title string
Note title.1โ€“200 chars
body string
Markdown content.max 100000 chars
tags array
Replaces all tags (array of strings).items: string
pinned boolean
Pin or unpin.
isPublic boolean
Public visibility. Ignored unless the caller is the owner.
siteId integer
Linked site; null unlinks.nullable

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
You do not have edit access to this note. The caller can see the note (public or read-only share) but may not edit it.
404
Note not found No note with this id, or the caller may not see it.
  • isPublic sent by a non-owner editor is silently ignored (no error).
  • pinned is a property of the note, so pinning affects everyone who sees it.
cURL
curl -X PATCH "https://panel.example.com/api/notes/6" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "1. Run migrations\n2. Clear cache\n3. Warm up",
    "pinned": false
}'
200Response ยท application/json
{
    "id": 5,
    "title": "Shop deploy checklist",
    "body": "1. Run migrations\n2. Clear cache\n3. Warm up",
    "pinned": false,
    "isPublic": false,
    "tags": "[\"runbook\"]",
    "siteId": 12,
    "ownerId": 1,
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "owner": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "shares": [
        {
            "userId": 12,
            "canEdit": true,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        }
    ],
    "canEdit": true
}
DELETE /api/notes/{id}

Delete a note

Deletes a note and its shares. Only the owner may delete it.

  • Token or session
  • Any role
  • Audit: note.deleted

Path parameters

id integerrequired
Note 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
Only the owner can delete this note. The caller is not the owner (admins included).
404
Note not found No note with this id.
  • Unlike the other note endpoints, a note the caller cannot see returns 403 here, not 404.
cURL
curl -X DELETE "https://panel.example.com/api/notes/6" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}
PUT /api/notes/{id}/shares

Replace a note's shares

Replaces the full list of users a note is shared with, and whether each may edit it. Only the owner may manage sharing. Send an empty array to stop sharing.

  • Token or session
  • Any role
  • Audit: note.shared

Path parameters

id integerrequired
Note id.

Body

shares arrayrequired
The new share list.
shares[].userId integerrequired
User to share with.
shares[].canEdit boolean
Whether this user may edit the note.default false

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
Only the owner can manage sharing. The caller is not the owner.
404
Note not found No note with this id.
  • Entries for the owner are dropped silently.
  • Duplicate userIds or ids of non-existent users make the database reject the transaction (surfaces as a 500 error); the previous shares are kept.
  • The audit entry stores {noteId, shareCount}, where shareCount is the number of entries sent (before dropping the owner).
cURL
curl -X PUT "https://panel.example.com/api/notes/6/shares" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "shares": [
        {
            "userId": 12,
            "canEdit": true
        },
        {
            "userId": 15
        }
    ]
}'
200Response ยท application/json
{
    "id": 5,
    "title": "Shop deploy checklist",
    "body": "1. Run migrations\n2. Clear cache",
    "pinned": true,
    "isPublic": false,
    "tags": "[\"runbook\"]",
    "siteId": 12,
    "ownerId": 1,
    "createdAt": "2026-11-01T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "owner": {
        "id": 1,
        "email": "[email protected]"
    },
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "shares": [
        {
            "userId": 12,
            "canEdit": true,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        },
        {
            "userId": 15,
            "canEdit": false,
            "user": {
                "id": 15,
                "email": "[email protected]"
            }
        }
    ],
    "canEdit": true
}
GET /api/calendar/events

List calendar entries

Returns the calendar entries in a date range: stored events (recurring ones expanded into individual occurrences) followed by virtual entries for task due dates. Every user sees all stored events; non-admins see only due dates of their own tasks (created or assigned).

  • Token or session
  • Any role

Query parameters

start string
Range start (ISO 8601 date-time).default now โˆ’ 30 days; not validated
end string
Range end (ISO 8601 date-time).default now + 60 days; not validated
siteId integer
Only events and task due dates linked to this site.not validated

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
  • ids are strings: "event-<id>" for the first occurrence of a stored event in the range, "event-<id>-<n>" for later occurrences in the range (n counts occurrences within the range), and "task-<taskId>" for task due dates. Virtual task entries are never stored and cannot be edited through the event endpoints.
  • Recurrence: daily and weekly advance by a fixed 24 h / 7 d; monthly advances by calendar month. Expansion starts at the event's first startAt and stops after 500 steps, counting steps before the range too, so very old recurring events eventually stop producing occurrences.
  • Task due-date colours: #d72c0d for urgent, #e4a11b for high, #5c6ac4 otherwise.
  • editable is true for every stored event when the caller is an admin, false otherwise. Results are not sorted.
  • reminderMins is not included in list entries (use GET /api/calendar/events/{id}).
  • Unparseable start/end values are not rejected cleanly and can lead to a 500 error.
cURL
curl "https://panel.example.com/api/calendar/events" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "events": [
        {
            "id": "event-3",
            "kind": "event",
            "title": "Monthly maintenance",
            "description": "Patch the server.",
            "type": "maintenance",
            "startAt": "2026-12-01T02:00:00.000Z",
            "endAt": "2026-12-01T03:00:00.000Z",
            "allDay": false,
            "color": "#5c6ac4",
            "recurrence": "monthly",
            "siteId": 12,
            "site": {
                "id": 12,
                "domain": "shop.example.com",
                "name": "Shop"
            },
            "taskId": null,
            "task": null,
            "createdBy": {
                "id": 1,
                "email": "[email protected]"
            },
            "attendees": [
                {
                    "userId": 12,
                    "user": {
                        "id": 12,
                        "email": "[email protected]"
                    }
                }
            ],
            "editable": true
        },
        {
            "id": "task-42",
            "kind": "task_due",
            "title": "Renew SSL for shop",
            "description": null,
            "type": "task_deadline",
            "startAt": "2026-11-30T00:00:00.000Z",
            "endAt": null,
            "allDay": true,
            "color": "#e4a11b",
            "recurrence": null,
            "siteId": 12,
            "site": {
                "id": 12,
                "domain": "shop.example.com",
                "name": "Shop"
            },
            "taskId": 42,
            "task": {
                "id": 42,
                "title": "Renew SSL for shop",
                "status": "in_progress"
            },
            "createdBy": null,
            "attendees": [],
            "editable": false
        }
    ]
}
GET /api/calendar/events/{id}

Get a calendar event

Returns one stored calendar event as saved (not expanded for recurrence). Available to every role.

  • Token or session
  • Any role

Path parameters

id integerrequired
Numeric event id (without the "event-" prefix used in the list).

Errors

401
Invalid or expired access token The personal access token is unknown, revoked or expired.
401
Unauthorized No token, or an invalid session.
404
Event not found No event with this id.
cURL
curl "https://panel.example.com/api/calendar/events/8" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "id": 3,
    "title": "Monthly maintenance",
    "description": "Patch the server.",
    "type": "maintenance",
    "startAt": "2026-12-01T02:00:00.000Z",
    "endAt": "2026-12-01T03:00:00.000Z",
    "allDay": false,
    "color": "#5c6ac4",
    "recurrence": "monthly",
    "reminderMins": 30,
    "siteId": 12,
    "taskId": null,
    "createdById": 1,
    "createdAt": "2026-11-20T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "task": null,
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "attendees": [
        {
            "userId": 12,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        }
    ]
}
POST /api/calendar/events

Create a calendar event

Creates a calendar event, optionally recurring, linked to a site or task, and with attendees. Admin only.

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

Body

title stringrequired
Event title.1โ€“200 chars
description string
Description.max 5000 chars
type string
Event type; the UI uses custom, reminder, maintenance.max 50 chars; default custom; values not restricted
startAt stringrequired
Start (ISO 8601 date-time).format not validated
endAt string
End (ISO 8601 date-time).format not validated
allDay boolean
All-day event.default false
color string
Display colour, e.g. a hex code.max 20 chars
recurrence string
Repeat rule; omit for a one-off event.one of: daily, weekly, monthly
reminderMins integer
Reminder offset in minutes (stored only).
siteId integer
Linked site.
taskId integer
Linked task.
attendeeIds array
User ids of attendees (array of integers).items: integer

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 Your role may not call this endpoint.
403
Only admins can manage calendar events. The caller is not an admin.
  • The admin check is a file-level preHandler hook, so body validation (400) runs before it.
  • reminderMins is stored and returned but nothing in the API sends reminders.
  • Unparseable dates, duplicate attendee ids or non-existent site/task/user ids are rejected by the database and surface as a 500 error.
cURL
curl -X POST "https://panel.example.com/api/calendar/events" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Monthly maintenance",
    "description": "Patch the server.",
    "type": "maintenance",
    "startAt": "2026-12-01T02:00:00.000Z",
    "endAt": "2026-12-01T03:00:00.000Z",
    "allDay": false,
    "color": "#5c6ac4",
    "recurrence": "monthly",
    "reminderMins": 30,
    "siteId": 12,
    "attendeeIds": [
        12
    ]
}'
201Response ยท application/json
{
    "id": 3,
    "title": "Monthly maintenance",
    "description": "Patch the server.",
    "type": "maintenance",
    "startAt": "2026-12-01T02:00:00.000Z",
    "endAt": "2026-12-01T03:00:00.000Z",
    "allDay": false,
    "color": "#5c6ac4",
    "recurrence": "monthly",
    "reminderMins": 30,
    "siteId": 12,
    "taskId": null,
    "createdById": 1,
    "createdAt": "2026-11-27T10:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "task": null,
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "attendees": [
        {
            "userId": 12,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        }
    ]
}
PATCH /api/calendar/events/{id}

Update a calendar event

Changes a calendar event. Only the fields sent are changed; attendeeIds, when sent, replaces the whole attendee list. Admin only.

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

Path parameters

id integerrequired
Numeric event id.

Body

title string
Event title.1โ€“200 chars
description string
Description; null clears it.max 5000 chars, nullable
type string
Event type.max 50 chars
startAt string
Start (ISO 8601 date-time).format not validated
endAt string
End; null or empty string clears it.nullable; format not validated
allDay boolean
All-day event.
color string
Display colour; null clears it.max 20 chars, nullable
recurrence string
Repeat rule; null makes it a one-off event.one of: daily, weekly, monthly; nullable
reminderMins integer
Reminder offset in minutes; null clears it.nullable
siteId integer
Linked site; null unlinks.nullable
taskId integer
Linked task; null unlinks.nullable
attendeeIds array
Replaces all attendees (array of user ids); [] removes all.items: integer

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 Your role may not call this endpoint.
403
Only admins can manage calendar events. The caller is not an admin.
404
Event not found No event with this id.
  • The attendee replacement is written before the event update and not in a transaction; if the event update then fails, the new attendee list is kept.
  • Unparseable dates, duplicate attendee ids or non-existent site/task/user ids surface as a 500 error.
cURL
curl -X PATCH "https://panel.example.com/api/calendar/events/8" \
  -H "Authorization: Bearer $ORCH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "startAt": "2026-12-02T02:00:00.000Z",
    "endAt": "2026-12-02T03:00:00.000Z",
    "attendeeIds": [
        12,
        15
    ]
}'
200Response ยท application/json
{
    "id": 3,
    "title": "Monthly maintenance",
    "description": "Patch the server.",
    "type": "maintenance",
    "startAt": "2026-12-02T02:00:00.000Z",
    "endAt": "2026-12-02T03:00:00.000Z",
    "allDay": false,
    "color": "#5c6ac4",
    "recurrence": "monthly",
    "reminderMins": 30,
    "siteId": 12,
    "taskId": null,
    "createdById": 1,
    "createdAt": "2026-11-20T09:00:00.000Z",
    "updatedAt": "2026-11-27T10:00:00.000Z",
    "site": {
        "id": 12,
        "domain": "shop.example.com",
        "name": "Shop"
    },
    "task": null,
    "createdBy": {
        "id": 1,
        "email": "[email protected]"
    },
    "attendees": [
        {
            "userId": 12,
            "user": {
                "id": 12,
                "email": "[email protected]"
            }
        },
        {
            "userId": 15,
            "user": {
                "id": 15,
                "email": "[email protected]"
            }
        }
    ]
}
DELETE /api/calendar/events/{id}

Delete a calendar event

Deletes a calendar event with all its occurrences and attendees. Admin only.

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

Path parameters

id integerrequired
Numeric event 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 Your role may not call this endpoint.
403
Only admins can manage calendar events. The caller is not an admin.
404
Event not found No event with this id.
  • Single occurrences of a recurring event cannot be deleted; this always removes the whole series.
cURL
curl -X DELETE "https://panel.example.com/api/calendar/events/8" \
  -H "Authorization: Bearer $ORCH_TOKEN"
200Response ยท application/json
{
    "ok": true
}