The shape of an API error, what each status code means, and the errors specific to each resource.
Error shape
Errors carry a JSON body with a detail. Which shape depends on the route: the
key and rate limit errors, and most newer routes, put a machine-readable code
and a message in detail; older routes and the per-route limits use a plain
string. The conventions page lists every shape.
{ "detail": { "code": "api_key_required", "message": "This endpoint needs an API key: it is served at /v1/alerts/active. ..." } }
Status codes
status
means
400
a bad request the route explains, such as key_in_query
401
api_key_required (a key-only route without a key) or api_key_invalid
403
insufficient_scope: the key lacks the route’s scope
404
nothing by that id, or a point outside the product’s coverage
422
a parameter is missing or out of range; detail is a list with one entry per problem (type, loc, msg, input), see the 422 format
429
rate_limited: wait Retry-After seconds
500
an unexpected failure: {"detail": "Something went wrong on our end. Please try again."}
503
the data behind the route is not available yet, or rate_limit_unavailable; try again later
The key errors, with what to do about each, are on
Authentication. The limits behind
429 are on Rate limits.
By resource
Each table lists only what is particular to that resource. A route that is not
listed here uses the codes above and nothing more.
Alerts
status
when
401
a key-only route on the bare path (api_key_required), or a /v1 route without a valid key
404
no alert for that identifier or short id
410
/alerts/page/{short_id} for an alert past the 30 day retention window
422
a parameter out of range or missing, or a box with west >= east or south >= north