Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

REST API

StatusDock provides a REST API for programmatic access to status data.

Note: The API structure is consistent regardless of whether you’re using Payload CMS or Strapi as your backend, thanks to the CMS adapter layer.

Base URL

https://your-status-page.com/api

Authentication

Most read endpoints are public. Admin endpoints require authentication via:

  • Session cookie (from admin login)
  • API key header: Authorization: Bearer <api-key>

Endpoints

Incidents

List Incidents

GET /api/incidents

Query parameters:

ParameterDescription
limitNumber of results (default: 10)
pagePage number (default: 1)
where[status][equals]Filter by status

Get Incident

GET /api/incidents/:id

Maintenances

List Maintenances

GET /api/maintenances

Query parameters same as incidents.

Get Maintenance

GET /api/maintenances/:id

Services

List Services

GET /api/services

Get Service

GET /api/services/:id

Service Groups

List Service Groups

GET /api/service-groups

Get Service Group

GET /api/service-groups/:id

Subscribers

Subscribe

POST /api/subscribe
Content-Type: application/json

{
  "type": "email",
  "email": "user@example.com"
}

Response:

{
  "success": true,
  "message": "Subscription successful"
}

Unsubscribe

POST /api/unsubscribe
Content-Type: application/json

{
  "token": "unsubscribe-token"
}

CMS Backend API

Depending on your CMS_PROVIDER setting, additional CMS-specific API endpoints are available:

Payload CMS

When using Payload CMS, the full Payload REST API is available at /api. See the Payload documentation for complete details.

Strapi v5

When using Strapi, access the Strapi API directly at your STRAPI_URL. See the Strapi documentation for details.

StatusDock’s frontend uses the unified CMS adapter layer, so the status page works the same regardless of backend.

Common Query Patterns

These patterns work with the StatusDock API endpoints:

Filtering

GET /api/incidents?where[status][equals]=investigating

Sorting

GET /api/incidents?sort=-createdAt

Pagination

GET /api/incidents?limit=10&page=2

Field Selection

GET /api/incidents?select[title]=true&select[status]=true

GraphQL

GraphQL endpoints are available depending on your CMS backend:

Payload CMS:

POST /api/graphql

GraphQL Playground (development only):

GET /api/graphql-playground

Strapi v5:

  • GraphQL plugin must be installed separately
  • Available at {STRAPI_URL}/graphql

Rate Limiting

Public endpoints are rate limited to prevent abuse:

  • 100 requests per minute per IP for read endpoints
  • 10 requests per minute per IP for subscribe endpoint

Error Responses

All errors follow this format:

{
  "errors": [
    {
      "message": "Error description"
    }
  ]
}

Common HTTP status codes:

CodeDescription
200Success
400Bad request
401Unauthorized
404Not found
429Rate limited
500Server error