Overview
All API endpoints return consistent error responses with standard HTTP status codes. When an error occurs, the response will include a JSON body with details about the error.Error Response Format
All error responses follow this format:Common Error Codes
| Status Code | Error Type | Description |
|---|---|---|
400 | Bad Request | Invalid request parameters or malformed request body. Check that all required fields are provided and properly formatted. |
401 | Unauthorized | Invalid or missing API key. Ensure your x-api-key header is present and contains a valid API key. |
403 | Forbidden | You don’t have permission to access this resource. This may occur if your API key doesn’t have the necessary permissions. |
404 | Not Found | The requested resource doesn’t exist. Verify that the resource ID (e.g., session_id) is correct. |
409 | Conflict | The request conflicts with the current state of the resource. For example, trying to create a resource that already exists. |
422 | Unprocessable Entity | The request is well-formed but contains semantic errors. Check that your request data meets all validation requirements. |
429 | Too Many Requests | Rate limit exceeded. You’ve made too many requests in a short period. Please wait before retrying. |
500 | Internal Server Error | An unexpected error occurred on the server. If this persists, please contact support. |
502 | Bad Gateway | The server received an invalid response from an upstream server. This is usually temporary. |
503 | Service Unavailable | The service is temporarily unavailable due to maintenance or overload. Please try again later. |
Rate Limiting
When rate limited (429 status code), the response will include these headers:X-RateLimit-Limit: The maximum number of requests allowedX-RateLimit-Remaining: The number of requests remaining in the current windowX-RateLimit-Reset: The time when the rate limit window resets (Unix timestamp)Retry-After: The number of seconds to wait before making another request
Example Error Responses
Bad Request (400)
Unauthorized (401)
Not Found (404)
Rate Limited (429)
Internal Server Error (500)
Best Practices
- Always check the status code before processing the response body
- Implement exponential backoff for rate limit errors (429)
- Log error details including the request_id when available for debugging
- Handle errors gracefully in your application with appropriate user messaging
- Don’t retry 4xx errors immediately as they typically indicate client-side issues that need to be fixed