Skip to content

API Reference

Routes

All routes are relative to the mount point (e.g., /monitoring).

MethodPathDescription
GET/api/statusOverall status with all check states
GET/api/checksList all checks
GET/api/checks/:idGet single check
POST/api/checksCreate check
PUT/api/checks/:idUpdate check (partial)
DELETE/api/checks/:idDelete check
POST/api/checks/:id/toggleEnable/disable check
POST/api/checks/:id/runRun check immediately
GET/api/incidentsList incidents (?check_id, ?status, ?limit)
GET/api/alert-rulesList alert rules
POST/api/alert-rulesCreate alert rule
DELETE/api/alert-rules/:idDelete alert rule
GET/api/maintenanceList maintenance windows
POST/api/maintenanceCreate maintenance window
DELETE/api/maintenance/:idDelete maintenance window
GET/api/configExport full config (checks + alert rules)
PUT/api/configImport checks (declarative sync)

State Machine

unknown  → healthy    (first success, no alert)
unknown  → degraded   (first failure, threshold not met)
healthy  → degraded   (failure, threshold not met)
degraded → unhealthy  (threshold met → onAlert 'failure')
unhealthy → healthy   (success → onAlert 'recovery')
unhealthy → unhealthy (still failing, no alert)

Alert Payload

When a state transition triggers an alert, onAlert receives:

typescript
interface AlertPayload {
  type: "failure" | "recovery";
  check: CheckConfig;
  checkState: CheckState;
  result: CheckResult;
  timestamp: string;
}

Dashboard

The embedded dashboard is served at the mount point root (e.g., /monitoring/). It includes:

  • Overall system status
  • Per-check status timeline
  • Response time sparkline
  • Auto-refresh every 60 seconds