Guides
Error Handling
How to handle API errors gracefully.
Error response format
All API errors return a JSON body with an error field:
HTTP status codes
| Code | Meaning | What to do |
|---|---|---|
400 | Bad Request | Check your request body and parameters. |
401 | Unauthorized | Verify your API key is valid and included in the Authorization header. |
403 | Forbidden | Your API key doesn't have the required scope or role. |
404 | Not Found | The requested resource doesn't exist. |
409 | Conflict | A resource with the same identifier already exists. |
429 | Too Many Requests | You've hit the rate limit. Wait and retry after the Retry-After header. |
500 | Internal Server Error | Something went wrong on our end. Retry with exponential backoff. |
Rate limit headers
Every response includes rate limit information:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window. |
X-RateLimit-Remaining | Requests remaining in the current window. |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets. |
Retry-After | Seconds to wait before retrying (only on 429 responses). |
Retry strategy
For 429 and 5xx errors, implement exponential backoff: