Error Structure
When an error occurs, the API returns a response with the following structure:Error Codes
Authentication Errors
UNAUTHORIZED
UNAUTHORIZED
FORBIDDEN
FORBIDDEN
Status: 403The key doesn’t have permission for this resource.Solution: Check your key permissions in the dashboard.
Validation Errors
VALIDATION_ERROR
VALIDATION_ERROR
Status: 400The submitted data is invalid.Solution: Fix the fields indicated in
details.MISSING_FIELD
MISSING_FIELD
Status: 400A required field was not sent.Solution: Include the required field in the request.
Resource Errors
NOT_FOUND
NOT_FOUND
Status: 404The requested resource doesn’t exist.Solution: Verify that the ID is correct.
ALREADY_EXISTS
ALREADY_EXISTS
Status: 409A resource with the same data already exists.Solution: Use the update endpoint or use different data.
Rate Limit Errors
RATE_LIMIT_EXCEEDED
RATE_LIMIT_EXCEEDED
Status: 429Too many requests in a short time.Solution: Wait for the time indicated in
retry_after (seconds).Implementing Retry Logic
Best Practices
Always Check Status
Never assume the request was successful. Always check the HTTP code.
Implement Retry
For 5xx and 429 errors, implement retry with exponential backoff.
Log Errors
Record errors for debugging and monitoring.
Handle Specific Cases
Implement specific handling for each error type.