Automations API
All automation endpoints are under /api/automations. Requires authentication. Write operations require operator role or higher.
List Automations
GET /api/automationsResponse 200:
[
{
"id": "auto_backup_nas",
"name": "NAS Backup",
"type": "script",
"icon": "fa-database",
"schedule": "0 3 * * *",
"last_run": 1718000000,
"last_status": "done"
}
]Create Automation
POST /api/automationsRequest:
{
"name": "Restart nginx",
"type": "service_control",
"params": {
"service": "nginx",
"action": "restart"
}
}Response 201: { "id": "auto_xyz", "status": "created" }
Update Automation
PUT /api/automations/{id}Request: same shape as create. Returns { "status": "updated" }.
Delete Automation
DELETE /api/automations/{id}Response 200: { "status": "deleted" }
Run Automation
POST /api/automations/{id}/runExecutes the automation immediately, regardless of any schedule.
Response 200:
{
"run_id": "run_abc123",
"status": "running"
}Run Status
GET /api/automations/runs/{run_id}Response 200:
{
"run_id": "run_abc123",
"automation_id": "auto_backup_nas",
"status": "done",
"started": 1718000000,
"finished": 1718000042,
"output": "Backup completed successfully.\n..."
}Run Log Stream
GET /api/automations/runs/{run_id}/stream?token=<token>SSE stream of log output for a running automation.
Templates
GET /api/automations/templatesReturns the built-in template library.
POST /api/automations/templates/{template_id}/applyCreates a new automation from a template.
Export
GET /api/automations/exportReturns all automations as a JSON array for backup or migration.
Import
POST /api/automations/import
Content-Type: application/jsonBody: JSON array from a previous export. IDs are regenerated on import.
Response 200: { "imported": 12 }
Webhook Trigger
POST /api/automations/webhook/{id}Triggers an automation via an inbound webhook. The id is the automation's webhook token (distinct from its internal ID).
No authentication required for webhook endpoints — the token in the URL acts as the secret.
Approval Queue
GET /api/approvalsReturns all pending approval requests.
POST /api/approvals/{request_id}/approveApproves a pending request. Optionally include a comment:
{ "comment": "Approved for deployment window" }POST /api/approvals/{request_id}/rejectRejects a pending request.
Both require operator role or higher and the user must be in the approvers list for the request (or be an admin).
Maintenance Windows
GET /api/maintenanceReturns all maintenance windows.
POST /api/maintenanceCreates a maintenance window.
{
"name": "Weekly reboot",
"start": "2026-03-22T03:00:00",
"end": "2026-03-22T04:00:00",
"recurring": "0 3 * * 0",
"scope": ["monitor_abc", "agent_xyz"],
"autonomy_override": "disabled"
}POST /api/maintenance/{id}/activateActivates a window immediately.
POST /api/maintenance/{id}/deactivateDeactivates an active window early.
DELETE /api/maintenance/{id}Deletes a maintenance window.