Error Response Format
All API errors follow a consistent JSON format:Error Response Fields
HTTP Status Codes
The API uses the following HTTP status codes for error responses:Common Error Types
Authentication Errors (401)
Permission Errors (403)
Resource Not Found (404)
Validation Errors (400)
Conflict Errors (409)
Business Logic Errors (422)
Rate Limit Errors (429)
Server Errors (500)
Error Handling Best Practices
1. Check HTTP Status Codes
Always check the HTTP status code first to understand the general category of error:- 4xx errors indicate client-side issues (your request)
- 5xx errors indicate server-side issues (our systems)
2. Parse Error Messages
Error messages provide specific information about what went wrong. Parse them to:- Display to users when appropriate
- Log for debugging
- Handle programmatically
3. Include Request ID in Support Inquiries
Always include theapi_request_id when contacting support about an API error. This helps us quickly locate the specific request in our logs.
By following these error handling best practices, you can build robust applications that gracefully manage API errors and provide a better experience for your users.
