REST API

Programmatic access to Triage Warden functionality.

Base URL

http://localhost:8080/api

Authentication

See Authentication for details.

API Key

curl -H "Authorization: Bearer tw_abc123_secretkey" \
  http://localhost:8080/api/incidents

For browser-based access, use session authentication via /login.

Response Format

All responses are JSON:

{
  "data": { ... },
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 150
  }
}

Error Responses

{
  "error": {
    "code": "not_found",
    "message": "Incident not found",
    "details": { ... }
  }
}

HTTP Status Codes

CodeMeaning
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
429Rate Limited
500Server Error

Endpoints Overview

Incidents

MethodPathDescription
GET/incidentsList incidents
POST/incidentsCreate incident
GET/incidents/:idGet incident
PUT/incidents/:idUpdate incident
DELETE/incidents/:idDelete incident
POST/incidents/:id/triageRun triage
POST/incidents/:id/actionsExecute action

Actions

MethodPathDescription
GET/actionsList actions
GET/actions/:idGet action
POST/actions/:id/approveApprove action
POST/actions/:id/rejectReject action

Playbooks

MethodPathDescription
GET/playbooksList playbooks
POST/playbooksCreate playbook
GET/playbooks/:idGet playbook
PUT/playbooks/:idUpdate playbook
DELETE/playbooks/:idDelete playbook
POST/playbooks/:id/runRun playbook

Webhooks

MethodPathDescription
POST/webhooks/:sourceReceive webhook

System

MethodPathDescription
GET/healthHealth check
GET/metricsPrometheus metrics
GET/connectors/healthConnector status

Pagination

List endpoints support pagination:

curl "http://localhost:8080/api/incidents?page=2&per_page=50"

Parameters:

  • page - Page number (default: 1)
  • per_page - Items per page (default: 20, max: 100)

Filtering

Filter list results:

curl "http://localhost:8080/api/incidents?status=open&severity=high"

Common filters:

  • status - Filter by status
  • severity - Filter by severity
  • type - Filter by incident type
  • created_after - Created after date
  • created_before - Created before date

Sorting

curl "http://localhost:8080/api/incidents?sort=-created_at"
  • Prefix with - for descending order
  • Default: -created_at (newest first)

Rate Limiting

API requests are rate limited:

EndpointLimit
Read operations100/min
Write operations20/min
Triage requests10/min

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705320000

Next Steps