Errors & status codes
Errors & status codes
The Panic API uses standard HTTP status codes to indicate the result of a
request: 2xx for success, 4xx for client errors, and 5xx for server
errors.
Error body shape
Error bodies are not uniform across routes. Depending on the endpoint you may receive any of:
{"message": "..."}— a string description (most routes).{"errors": ...}— a string, an array of strings, or an object (some routes serialise the underlying error).{"error": "..."}— used by a few routes, including rate limiting.
Parse defensively: check message, then errors, then error, and log the
raw body for anything unexpected.
Status codes
Handling errors
- Read the body (see shapes above) for a human-readable explanation.
- Treat
5xx(and502) as transient — retry with backoff. - Treat
4xxas actionable — fix the request or the resource state before retrying. - Honour
429by backing off until theRateLimit-Resetwindow passes.
