Skip to content

API Reference

All API endpoints are served by the Orchestrator agent at the Worker’s root URL.

  • Production: https://sentinel.{your-domain}.workers.dev
  • Local dev: http://localhost:8787
GET /api/incidents?status={status}&service={service}&limit={limit}&offset={offset}
ParameterTypeRequiredDefaultDescription
statusstringNoFilter by status
servicestringNoFilter by service name
limitnumberNo50Page size
offsetnumberNo0Pagination offset

Response: 200 OK

{
"incidents": [
{
"id": "01HXYZ...",
"fingerprint": "a1b2c3...",
"service_name": "my-worker",
"trigger_route": "/api/users",
"error_class": "server_5xx",
"error_message": "TypeError: Cannot read properties of undefined",
"status": "fixing",
"occurrence_count": 42,
"first_seen": "2026-02-20T10:00:00Z",
"last_seen": "2026-02-20T11:30:00Z",
"repo_url": "https://github.com/org/my-worker"
}
]
}
GET /api/incidents/:id

Response: 200 OK

Returns the incident record plus all associated artifacts from D1.

POST /api/incidents/:id/retry

Resets the incident status to detected, causing it to re-enter the pipeline from the beginning.

Response: 200 OK { "ok": true, "status": "detected" }

POST /api/incidents/:id/skip

Marks the incident as wontfix.

Response: 200 OK { "ok": true, "status": "wontfix" }

GET /api/config/services

Response: 200 OK

{
"services": [
{
"service_name": "my-worker",
"repo_url": "https://github.com/org/my-worker",
"repo_branch": "main",
"poll_interval_ms": 30000,
"enabled": true,
"error_class_filter": "[\"server_5xx\",\"unhandled_exception\"]",
"min_occurrences": 1
}
]
}
GET /api/config/services/:name
PUT /api/config/services/:name
Content-Type: application/json
{
"serviceName": "my-worker",
"repoUrl": "https://github.com/org/my-worker",
"repoBranch": "main",
"pollIntervalMs": 30000,
"enabled": true,
"errorClassFilter": ["server_5xx", "unhandled_exception"],
"minOccurrences": 1
}

Response: 200 OK { "ok": true }

GET /api/health

Response: 200 OK

{
"status": "ok",
"startedAt": "2026-02-20T10:00:00Z"
}
GET /api/stats

Response: 200 OK

{
"stats": [
{ "status": "detected", "count": 5 },
{ "status": "fixing", "count": 2 },
{ "status": "resolved", "count": 15 },
{ "status": "needs_human", "count": 3 }
]
}