HTTP status codes
Error response format
All errors follow a consistent JSON structure:Error response fields
Common error codes
Authentication errors
Validation errors
Resource errors
Rate limiting
Error handling examples
Validation error details
When a validation error occurs, thedetails array provides specific information about each field that failed validation:
Best practices
- Always check the response status before attempting to parse the response body
- Handle rate limiting gracefully by implementing exponential backoff
- Log error details including the
X-Request-Idheader for debugging - Parse validation errors to provide user-friendly feedback
- Implement retry logic for transient errors (5xx status codes)
- Use the error code for programmatic error handling rather than parsing messages
Debugging
When reporting issues, include:- The
X-Request-Idheader from the response - The full error response body
- The request method, URL, and headers (excluding sensitive data)
- The request body (if applicable)