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.
/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
emailstringrequired- Account email, matched exactly as stored.1โ254 chars
passwordstringrequired- Account password.1โ128 chars
totpCodestring- Current authenticator code. Needed only when the account has 2FA enabled.max 8 chars
Errors
- 401
Invalid TOTP code2FA is enabled and the totpCode does not verify.- 401
Invalid credentialsNo account with this email, or the password is wrong.- 429
Rate limit exceeded, retry in 15 minutesMore 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 -X POST "https://panel.example.com/api/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "correct-horse-battery",
"totpCode": "492817"
}'{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyfQ.c2lnbmF0dXJl"
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/auth/me" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"id": 12,
"email": "[email protected]",
"totpEnabled": true,
"role": "admin",
"locale": "en"
}
/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
localestring- 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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -X PATCH "https://panel.example.com/api/auth/me" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"locale": "ka"
}'{
"id": 12,
"email": "[email protected]",
"totpEnabled": true,
"role": "admin",
"locale": "ka"
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/auth/2fa/setup" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"secret": "JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP",
"qrDataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
/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
totpCodestringrequired- Current code from the authenticator app.6โ8 chars
Errors
- 400
Invalid code โ try againThe code does not verify against the stored secret.- 400
Run /2fa/setup firstNo TOTP secret is stored for the user.- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.
- Accepts one 30-second step of clock drift either way.
- No audit entry is written.
curl -X POST "https://panel.example.com/api/auth/2fa/enable" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"totpCode": "492817"
}'{
"ok": true
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -X DELETE "https://panel.example.com/api/auth/2fa" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
Users
Team members, roles and site access.
/api/users
List users
Lists every panel user, oldest first. Admin only.
- Token or session
- Admin
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe caller is not an admin.
- Password hashes and TOTP fields are never returned.
curl "https://panel.example.com/api/users" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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"
}
]
}
/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
emailstringrequired- Login email. Must be unique.3โ254 chars (format not checked)
passwordstringrequired- Initial password (stored as a bcrypt hash).8โ128 chars
rolestringrequired- Role of the new user.one of: admin, developer, viewer
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -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"
}'{
"id": 12,
"email": "[email protected]",
"role": "developer",
"allSitesAccess": false,
"createdAt": "2026-11-27T10:00:00.000Z"
}
/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
idintegerrequired- User id.
Body
emailstring- New login email.3โ254 chars
rolestring- New role.one of: admin, developer, viewer
allSitesAccessboolean- 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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -X PATCH "https://panel.example.com/api/users/4" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role": "viewer",
"allSitesAccess": true
}'{
"id": 12,
"email": "[email protected]",
"role": "viewer",
"allSitesAccess": true,
"createdAt": "2026-11-27T10:00:00.000Z"
}
/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
idintegerrequired- 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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -X DELETE "https://panel.example.com/api/users/4" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/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
idintegerrequired- User id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 "https://panel.example.com/api/users/4/sites" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"siteIds": [
3,
7
],
"allSitesAccess": false
}
/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
idintegerrequired- User id.
Body
siteIdsarrayrequired- Ids of the sites the user may access (array of integers).items: integer
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -X PUT "https://panel.example.com/api/users/4/sites" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"siteIds": [
3,
7
]
}'{
"ok": true,
"siteIds": [
3,
7
]
}
Access tokens
Personal access tokens.
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/tokens" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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"
}
]
}
/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
namestringrequired- Label shown in the token list and in the AI activity log.1โ80 chars
expiresInDaysinteger- Days until the token expires. Omit for a token that never expires.1โ3650
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -X POST "https://panel.example.com/api/tokens" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "CI deploys",
"expiresInDays": 90
}'{
"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"
}
/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
idintegerrequired- Token id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 404
Token not foundNo token with this id, or it belongs to another user.
- Admins cannot revoke other users' tokens with this endpoint (they get 404).
curl -X DELETE "https://panel.example.com/api/tokens/9" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
Settings
Panel settings and the weekly digest.
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 "https://panel.example.com/api/settings" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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"
}
/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_titlestring- Panel name shown in the UI.not validated
panel_urlstring- Public base URL of the panel (used e.g. for the Telegram webhook URL).not validated
notify_emailstring- Recipient address for email notifications (sent only when SMTP is configured on the server).not validated
deploy_slack_webhookstring- Slack incoming-webhook URL for notifications. Write-only.not validated
deploy_discord_webhookstring- Discord webhook URL for notifications. Write-only.not validated
deploy_telegram_bot_tokenstring- Telegram bot token for notifications and the Telegram bot. Write-only, encrypted at rest.not validated
deploy_telegram_chat_idstring- Telegram chat id that receives notifications.not validated
deploy_generic_webhookstring- Generic webhook URL that receives notification payloads. Write-only.not validated
s3_access_keystring- S3/R2 access key for backups. Write-only.not validated
s3_secret_keystring- S3/R2 secret key for backups. Write-only, encrypted at rest.not validated
s3_regionstring- S3 region.not validated
s3_bucketstring- S3 bucket name.not validated
s3_endpointstring- S3-compatible endpoint URL (e.g. for R2).not validated
mysql_root_userstring- MySQL user used to create and drop site databases.not validated
mysql_root_passwordstring- Password of that MySQL user. Write-only, encrypted at rest.not validated
do_api_tokenstring- DigitalOcean API token (Server page, droplet control). Write-only, encrypted at rest.not validated
do_droplet_idstring- DigitalOcean droplet id of this server.not validated
cloudflare_api_tokenstring- Cloudflare API token for automatic DNS A records on provisioning. Write-only, encrypted at rest.not validated
cloudflare_zone_idstring- Cloudflare zone id.not validated
server_public_ipstring- 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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -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": "โขโขโขโขโขโขโขโข"
}'{
"ok": true,
"updated": [
"panel_url",
"deploy_telegram_chat_id"
]
}
/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
oldPasswordstringrequired- Current password.1โ128 chars
newPasswordstringrequired- 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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -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"
}'{
"ok": true,
"message": "Password changed successfully."
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 "https://panel.example.com/api/digest" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
}
/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
enabledboolean- Send the digest automatically every week.
dayinteger- Weekday to send on: 0 = Sunday โฆ 6 = Saturday.0โ6
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -X PATCH "https://panel.example.com/api/digest" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"day": 1
}'{
"ok": true
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 -X POST "https://panel.example.com/api/digest/send-now" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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.
/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
siteIdinteger- Only entries for this site.not validated
limitinteger- Page size.default 50, max 200; not validated
offsetinteger- Number of entries to skip.default 0; not validated
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/audit" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
/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
tokenIdinteger- Only requests made with this access token.not validated
siteIdinteger- Only requests that targeted this site.not validated
toolstring- Only requests with this exact MCP tool name (from the X-MCP-Tool header).exact match
typestring- write = POST/PUT/PATCH/DELETE only; read = GET only. Any other value means no method filter.one of: read, write
qstring- Substring to look for in the request path.
limitinteger- Maximum number of items.default 100, min 1, max 500
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 "https://panel.example.com/api/mcp-activity" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
}
/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 tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleThe 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 "https://panel.example.com/api/mcp-activity/filters" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"tokens": [
{
"tokenId": 4,
"tokenName": "CI deploys"
}
],
"tools": [
"deploy_site",
"list_sites"
]
}
Tasks, notes and calendar
Tasks, notes and calendar events.
/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
siteIdinteger- Only tasks linked to this site.not validated
assigneeIdinteger- Only tasks assigned to this user.not validated
statusstring- Only tasks in this column.todo, in_progress, review or done (not validated)
minestring- Set to 1 to return only tasks assigned to the caller.only "1" has an effect
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/tasks" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
}
]
}
/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
idintegerrequired- Task id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe caller is not an admin and neither created nor is assigned to the task.- 404
Task not foundNo task with this id.
- tags is a JSON-encoded string array.
curl "https://panel.example.com/api/tasks/7" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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]"
}
}
]
}
/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
titlestringrequired- Task title.1โ200 chars
descriptionstring- Longer description.max 10000 chars
statusstring- Column.one of: todo, in_progress, review, done; default todo
prioritystring- Priority.one of: low, medium, high, urgent; default medium
dueDatestring- Due date, any string JavaScript's Date can parse (ISO 8601 recommended).format not validated
tagsarray- Tags (array of strings).items: string; default []
siteIdinteger- Site to link the task to.
assigneeIdinteger- User to assign the task to.non-admins: only their own id
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -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
}'{
"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
}
}
/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
idintegerrequired- Task id.
Body
titlestring- Task title.1โ200 chars
descriptionstring- Description; null clears it.max 10000 chars, nullable
statusstring- Column.one of: todo, in_progress, review, done
prioritystring- Priority.one of: low, medium, high, urgent
positionnumber- Sort position within the column (fractional values allowed).
dueDatestring- Due date; null or empty string clears it.nullable; format not validated
tagsarray- Replaces all tags (array of strings).items: string
siteIdinteger- Linked site; null unlinks.nullable
assigneeIdinteger- Assignee; null unassigns.nullable; non-admins: only their own id or null
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe 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 foundNo 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 -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
}'{
"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
}
}
/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
idintegerrequired- Task id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 foundNo task with this id.
- Calendar events linked to the task are kept, with their taskId set to null.
curl -X DELETE "https://panel.example.com/api/tasks/7" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/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
idintegerrequired- Task id.
Body
textstringrequired- Item text.1โ300 chars
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe caller is not an admin and neither created nor is assigned to the task.- 404
Task not foundNo task with this id.
- position is the task's highest checklist position plus 1 (0 for the first item).
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"
}'{
"id": 7,
"taskId": 42,
"text": "Check expiry date",
"done": false,
"position": 0
}
/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
idintegerrequired- Task id.
itemIdintegerrequired- Checklist item id.
Body
textstring- Item text.1โ300 chars
doneboolean- Ticked or not.
positioninteger- Sort position.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe caller is not an admin and neither created nor is assigned to the task.- 404
Task not foundNo 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 -X PATCH "https://panel.example.com/api/tasks/7/checklist/1" \
-H "Authorization: Bearer $ORCH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"done": true
}'{
"id": 7,
"taskId": 42,
"text": "Check expiry date",
"done": true,
"position": 0
}
/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
idintegerrequired- Task id.
itemIdintegerrequired- Checklist item id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe caller is not an admin and neither created nor is assigned to the task.- 404
Task not foundNo 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 -X DELETE "https://panel.example.com/api/tasks/7/checklist/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/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
idintegerrequired- Task id.
Body
bodystringrequired- Comment text.1โ5000 chars
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
ForbiddenThe caller is not an admin and neither created nor is assigned to the task.- 404
Task not foundNo task with this id.
- Comments cannot be edited, only deleted.
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."
}'{
"id": 88,
"taskId": 42,
"userId": 12,
"body": "Expires on 2 December.",
"createdAt": "2026-11-27T10:00:00.000Z",
"user": {
"id": 12,
"email": "[email protected]"
}
}
/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
idintegerrequired- Task id (not used by the handler).
commentIdintegerrequired- Comment id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 foundNo 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 -X DELETE "https://panel.example.com/api/tasks/7/comments/1" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/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
searchstring- Substring to look for in title or body.
tagstring- Only notes that have exactly this tag.exact match
pinnedstring- Set to 1 to return only pinned notes.only "1" has an effect
siteIdinteger- Only notes linked to this site.not validated
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/notes" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
]
}
/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
idintegerrequired- Note id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 404
Note not foundNo note with this id, or the caller may not see it.
curl "https://panel.example.com/api/notes/6" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
/api/notes
Create a note
Creates a note owned by the caller.
- Token or session
- Any role
- Audit:
note.created
Body
titlestringrequired- Note title.1โ200 chars
bodystring- Markdown content.max 100000 chars; default ""
tagsarray- Tags (array of strings).items: string; default []
pinnedboolean- Pin the note to the top of the list.default false
isPublicboolean- Make the note visible (read-only) to every panel user.default false
siteIdinteger- Site to link the note to.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 -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
}'{
"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
}
/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
idintegerrequired- Note id.
Body
titlestring- Note title.1โ200 chars
bodystring- Markdown content.max 100000 chars
tagsarray- Replaces all tags (array of strings).items: string
pinnedboolean- Pin or unpin.
isPublicboolean- Public visibility. Ignored unless the caller is the owner.
siteIdinteger- Linked site; null unlinks.nullable
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 foundNo 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 -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
}'{
"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
}
/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
idintegerrequired- Note id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Only the owner can delete this note.The caller is not the owner (admins included).- 404
Note not foundNo note with this id.
- Unlike the other note endpoints, a note the caller cannot see returns 403 here, not 404.
curl -X DELETE "https://panel.example.com/api/notes/6" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}
/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
idintegerrequired- Note id.
Body
sharesarrayrequired- The new share list.
shares[].userIdintegerrequired- User to share with.
shares[].canEditboolean- Whether this user may edit the note.default false
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Only the owner can manage sharing.The caller is not the owner.- 404
Note not foundNo 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 -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
}
]
}'{
"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
}
/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
startstring- Range start (ISO 8601 date-time).default now โ 30 days; not validated
endstring- Range end (ISO 8601 date-time).default now + 60 days; not validated
siteIdinteger- Only events and task due dates linked to this site.not validated
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo 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 "https://panel.example.com/api/calendar/events" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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
}
]
}
/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
idintegerrequired- Numeric event id (without the "event-" prefix used in the list).
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 404
Event not foundNo event with this id.
curl "https://panel.example.com/api/calendar/events/8" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"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]"
}
}
]
}
/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
titlestringrequired- Event title.1โ200 chars
descriptionstring- Description.max 5000 chars
typestring- Event type; the UI uses custom, reminder, maintenance.max 50 chars; default custom; values not restricted
startAtstringrequired- Start (ISO 8601 date-time).format not validated
endAtstring- End (ISO 8601 date-time).format not validated
allDayboolean- All-day event.default false
colorstring- Display colour, e.g. a hex code.max 20 chars
recurrencestring- Repeat rule; omit for a one-off event.one of: daily, weekly, monthly
reminderMinsinteger- Reminder offset in minutes (stored only).
siteIdinteger- Linked site.
taskIdinteger- Linked task.
attendeeIdsarray- User ids of attendees (array of integers).items: integer
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour 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 -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
]
}'{
"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]"
}
}
]
}
/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
idintegerrequired- Numeric event id.
Body
titlestring- Event title.1โ200 chars
descriptionstring- Description; null clears it.max 5000 chars, nullable
typestring- Event type.max 50 chars
startAtstring- Start (ISO 8601 date-time).format not validated
endAtstring- End; null or empty string clears it.nullable; format not validated
allDayboolean- All-day event.
colorstring- Display colour; null clears it.max 20 chars, nullable
recurrencestring- Repeat rule; null makes it a one-off event.one of: daily, weekly, monthly; nullable
reminderMinsinteger- Reminder offset in minutes; null clears it.nullable
siteIdinteger- Linked site; null unlinks.nullable
taskIdinteger- Linked task; null unlinks.nullable
attendeeIdsarray- Replaces all attendees (array of user ids); [] removes all.items: integer
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Only admins can manage calendar events.The caller is not an admin.- 404
Event not foundNo 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 -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
]
}'{
"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]"
}
}
]
}
/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
idintegerrequired- Numeric event id.
Errors
- 401
Invalid or expired access tokenThe personal access token is unknown, revoked or expired.- 401
UnauthorizedNo token, or an invalid session.- 403
Forbidden: insufficient roleYour role may not call this endpoint.- 403
Only admins can manage calendar events.The caller is not an admin.- 404
Event not foundNo event with this id.
- Single occurrences of a recurring event cannot be deleted; this always removes the whole series.
curl -X DELETE "https://panel.example.com/api/calendar/events/8" \
-H "Authorization: Bearer $ORCH_TOKEN"{
"ok": true
}