Error Response Format
All errors are returned in a standardized JSON format:- code: the HTTP status code (e.g., 400, 401, 404, etc.)
- status: the human-readable status (e.g., Bad Request, Unauthorized)
- message: a short summary of the error
- errors: (optional) additional details, often related to field validation
| HTTP Code | Status | Description | Suggested Fix |
|---|---|---|---|
| 400 | Bad Request | The request is invalid (missing or malformed parameters). | Check your request schema and required fields. |
| 401 | Unauthorized | Missing or invalid API key. | Include an Authorization header with a valid API key. |
| 403 | Forbidden | The API key does not have sufficient permissions. | Check your access rights or use a key with proper permissions. |
| 404 | Not Found | The requested resource does not exist. | Verify the ID or resource reference. |
| 422 | Unprocessable Entity | The data is syntactically correct but violates business rules. | Inspect the errors object for field-specific issues. |
| 429 | Too Many Requests | You have exceeded the request limit. | Wait before retrying, implement exponential backoff. |
| 500 | Internal Server Error | An unexpected server error occurred. | Retry later, contact support if the issue persists. |
Troubleshooting
- Check your request format: Ensure your JSON is valid and matches the required schema.
- Authentication: Confirm your API key is correct and that you are using the right environment (test or production).
- Inspect error details: The errors object provides specific field-level feedback.
- Handle rate limits (429): Implement retry logic with exponential backoff.
- Log errors: Store error responses for debugging, but avoid logging sensitive data.
- Contact support if issues persist, providing:
- the endpoint you called
- the payload you sent
- the full error response you received
Best Practices for Error Handling
- Implement automatic retries for transient errors (429, 500).
- Show clear messages to end users, while keeping detailed logs for developers.
- Never expose API keys or sensitive data in error messages.
- Test common error cases (missing fields, invalid values, etc.) during development.
