Errors, limits and conventions
Status codes, error codes, rate limits, idempotency, pagination and versioning.
#Errors
Every error is the same JSON shape:
{ "error": { "code": "validation_failed", "message": "message: must not be empty" } }code is stable and meant for programs; message is meant for people and may change.
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | the request is malformed (for example an invalid Idempotency-Key) |
| 401 | unauthorized | missing or invalid API key |
| 403 | forbidden | the key's scope cannot do this |
| 404 | not_found | no such thing, or it belongs to another organization |
| 409 | conflict | blocked by the current state (a team that is still in use, an already closed alert) |
| 422 | validation_failed | the body failed validation; message names the field |
| 429 | rate_limited | slow down; honour retry-after |
| 5xx | internal, ... | ours; safe to retry reads and idempotent writes |
404 is also what you get for another organization's resource. We do not confirm that it exists.
#Authentication and scopes
Send Authorization: Bearer <key>. Organization keys look like trk_<prefix>_<secret>; only a hash is stored, and a key is shown once when created. Scopes are not a ladder: alert creates and manages alerts and pings heartbeats and nothing else; read reads everything and changes nothing; admin does everything. Each operation in the API reference says which it needs.
#Rate limits
Per key, 3,000 requests per minute by default. Over it you get 429 with a retry-after header (seconds). A throttled alert was never accepted, so retrying it is safe and cannot double-page. The SDK honours retry-after for you.
#Idempotency
POST /v1/alerts accepts an Idempotency-Key header. A retried request with the same key (per organization) returns the original result. Keys are 1 to 255 characters. Pick something derived from your event, like deploy-v42 or a job run id, not a random value per attempt.
#Pagination
List endpoints that can be large (GET /v1/alerts) are newest first, take limit (up to 200), and return next: the value to pass as before for the following page. next is null on the last page. GET /v1/alerts with alias or status filters the same way. Small collections (teams, users, schedules, heartbeats) return everything.
#Timestamps and ids
Timestamps are ISO 8601 in UTC. Ids are UUIDs. Alerts also have a tinyId, a small per-organization number meant for people ("#4821"), not for programs.
#Versioning
Everything is under /v1. Within v1 we add fields and endpoints but do not remove or repurpose them; ignore fields you do not recognise. A breaking change would be /v2 alongside it, with notice.
#The OpenAPI document
GET /openapi.json (no authentication) describes every operation, schema, example and required scope. It is checked by the test suite against the routes that actually exist, so a missing or invented operation fails the build.