Skip to main content
API v1 returns two error shapes depending on where the failure occurs:
  • Resource errors (validation and not-found errors raised inside an endpoint) return a nested object: { "error": { "code", "message" } }. Use the code for programmatic handling.
  • Gateway errors raised before an endpoint runs return a flat object: { "error", "message" }. This includes 401, 429, and an authentication-layer 500. Here error is a status label, not a machine-readable code.
Always branch on the HTTP status first, then read the body in the shape matching that status.

HTTP status codes

Error response formats

Resource errors (nested)

Validation and not-found errors raised inside an endpoint return a structured error object:
object

Gateway errors (flat)

Gateway responses use a flat shape. error is a status label, not a code:
string
Short status label (e.g. Unauthorized, Too Many Requests).
string
Human-readable description of the failure.
429 responses additionally include limit ("burst" or "daily") and retryAfter (seconds).

Error code reference

Authorization

Authentication 401 responses are flat and do not contain these resource codes.

Not found

Bad request

Rate limiting

Gateway 429 responses are flat. Use the HTTP status, limit, retryAfter, and Retry-After header instead of expecting a nested error code.

Server errors

Common errors

Authentication errors (401)

Authentication failures use the flat shape:
Check the Bearer prefix, token status, team status, and active plan.

Permission errors (403)

Verify the resource-specific permission or plan requirement.

Not-found errors (404)

Check that the resource ID belongs to the team associated with the token.

Rate-limit errors (429)

Rate-limit responses use the flat shape and add limit and retryAfter:
limit is "burst" (per-minute) or "daily". Honor the Retry-After header before retrying. See Rate limits.

Server errors (500)

Retry transient failures with bounded backoff. If the error persists, contact support with the endpoint and request timestamp.

Handle errors

JavaScript/TypeScript example

Python example

Get help

If you encounter persistent errors or unexpected behavior, contact us at team@qwairy.co with:
  • The endpoint you’re calling
  • The full error response
  • Your request headers (without the token)
  • The timestamp of the request