Error Handling
How to handle API errors.Error Response Format
All errors follow this format:HTTP Status Codes
| Code | Meaning |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Valid key but insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 422 | Unprocessable - Valid request but can’t be processed |
| 429 | Rate Limited - Too many requests |
| 500 | Server Error - Something went wrong on our end |
Common Error Codes
Authentication Errors
| Code | Description |
|---|---|
invalid_api_key | API key is invalid |
missing_api_key | No API key provided |
expired_api_key | API key has been revoked |
insufficient_permissions | Key doesn’t have required permissions |
Validation Errors
| Code | Description |
|---|---|
invalid_parameter | A parameter is invalid |
missing_parameter | A required parameter is missing |
invalid_json | Request body is not valid JSON |
Resource Errors
| Code | Description |
|---|---|
not_found | Resource doesn’t exist |
already_exists | Resource already exists |
conflict | Resource state conflict |
Rate Limit Errors
| Code | Description |
|---|---|
rate_limit_exceeded | Too many requests |
Error Details
Some errors include additional details:Handling Errors
Ruby Example
JavaScript Example
Retry Strategy
| Error | Retry? | Strategy |
|---|---|---|
| 400 | No | Fix the request |
| 401 | No | Check API key |
| 403 | No | Check permissions |
| 404 | No | Check resource exists |
| 429 | Yes | Wait for Retry-After |
| 500 | Yes | Exponential backoff |
| 502 | Yes | Exponential backoff |
| 503 | Yes | Exponential backoff |