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

Yet Another Status Page provides a REST API for programmatic access to status data.

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"
}

Payload REST API

The full Payload REST API is available at /api. See the Payload documentation for complete details.

Common Patterns

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

A GraphQL endpoint is available at:

POST /api/graphql

GraphQL Playground (development only):

GET /api/graphql-playground

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