API Reference
All API endpoints are served by the Orchestrator agent at the Worker’s root URL.
Base URL
Section titled “Base URL”- Production:
https://sentinel.{your-domain}.workers.dev - Local dev:
http://localhost:8787
Incidents
Section titled “Incidents”List Incidents
Section titled “List Incidents”GET /api/incidents?status={status}&service={service}&limit={limit}&offset={offset}| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | — | Filter by status |
service | string | No | — | Filter by service name |
limit | number | No | 50 | Page size |
offset | number | No | 0 | Pagination 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 Incident
Section titled “Get Incident”GET /api/incidents/:idResponse: 200 OK
Returns the incident record plus all associated artifacts from D1.
Retry Incident
Section titled “Retry Incident”POST /api/incidents/:id/retryResets the incident status to detected, causing it to re-enter the pipeline from the beginning.
Response: 200 OK { "ok": true, "status": "detected" }
Skip Incident
Section titled “Skip Incident”POST /api/incidents/:id/skipMarks the incident as wontfix.
Response: 200 OK { "ok": true, "status": "wontfix" }
Service Configuration
Section titled “Service Configuration”List Services
Section titled “List Services”GET /api/config/servicesResponse: 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 Service
Section titled “Get Service”GET /api/config/services/:nameUpsert Service
Section titled “Upsert Service”PUT /api/config/services/:nameContent-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 }
System
Section titled “System”Health Check
Section titled “Health Check”GET /api/healthResponse: 200 OK
{ "status": "ok", "startedAt": "2026-02-20T10:00:00Z"}Statistics
Section titled “Statistics”GET /api/statsResponse: 200 OK
{ "stats": [ { "status": "detected", "count": 5 }, { "status": "fixing", "count": 2 }, { "status": "resolved", "count": 15 }, { "status": "needs_human", "count": 3 } ]}