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:
| Parameter | Description |
|---|---|
limit | Number of results (default: 10) |
page | Page 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:
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request |
| 401 | Unauthorized |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server error |