Understanding API errors and how to handle them properly
Field | Description |
---|---|
error | Always true for error responses |
code | Machine-readable error code |
message | Human-readable error description |
version | API version |
timestamp | ISO 8601 timestamp of the error |
details | Additional context (optional) |
200
OK - Request succeeded - 201
Created - Resource created - 204
No
Content - Request succeeded, no content400
Bad Request - Invalid request - 401
Unauthorized - Invalid API key403
Forbidden - Insufficient permissions - 404
Not Found - Resource
not found - 429
Too Many Requests - Rate limited500
Internal Server Error - Server issue - 502
Bad Gateway - Upstream
error - 503
Service Unavailable - Temporary unavailabilityx-api-key
headerCheck Status Codes First
Handle Specific Error Codes
Implement Retry Logic
Log Errors Appropriately