API Reference

Incidents

Incidents track downtime events and issues detected by your monitors.

GET /incidents

List all incidents for your team.

Query Parameters

Parameter Type Description
monitor_id integer Filter by monitor ID
status string open or resolved
start_date date Filter incidents started on or after
end_date date Filter incidents started on or before
sort string started_at, ended_at, duration, status
curl "https://sentinel.rootstuff.io/api/incidents?status=open" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

GET /incidents/{id}

Get a specific incident with activity log.

{
  "id": 1,
  "monitor_id": 1,
  "status": "resolved",
  "root_cause": "Server timeout",
  "started_at": "2025-01-09T08:00:00Z",
  "ended_at": "2025-01-09T08:15:00Z",
  "duration": 15,
  "monitor": {
    "id": 1,
    "url": "https://example.com"
  },
  "activities": [...]
}

GET /monitors/{id}/incidents

Get all incidents for a specific monitor.

curl "https://sentinel.rootstuff.io/api/monitors/1/incidents?status=resolved" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

POST /incidents

Manually create an incident.

Request Body

Field Type Required Description
monitor_id integer Yes Associated monitor ID
started_at datetime Yes When the incident started (ISO 8601)
status string Yes open or resolved
root_cause string No Description of the cause
curl -X POST "https://sentinel.rootstuff.io/api/incidents" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "monitor_id": 1,
    "started_at": "2025-01-09T10:00:00Z",
    "status": "open",
    "root_cause": "Database connection timeout"
  }'

PUT /incidents/{id}

Update an incident's status or root cause.

curl -X PUT "https://sentinel.rootstuff.io/api/incidents/1" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "resolved",
    "root_cause": "Fixed database pool configuration"
  }'

POST /incidents/{id}/resolve

Quick endpoint to resolve an incident. Automatically sets ended_at and calculates duration.

curl -X POST "https://sentinel.rootstuff.io/api/incidents/1/resolve" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

DELETE /incidents/{id}

Delete an incident record.

curl -X DELETE "https://sentinel.rootstuff.io/api/incidents/1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Response: 204 No Content