Skip to main content

Error Structure

When an error occurs, the API returns a response with the following structure:

Error Codes

Authentication Errors

Status: 401The API key is missing, invalid, or expired.
Solution: Verify that the key is correct and not expired.
Status: 403The key doesn’t have permission for this resource.
Solution: Check your key permissions in the dashboard.

Validation Errors

Status: 400The submitted data is invalid.
Solution: Fix the fields indicated in details.
Status: 400A required field was not sent.
Solution: Include the required field in the request.

Resource Errors

Status: 404The requested resource doesn’t exist.
Solution: Verify that the ID is correct.
Status: 409A resource with the same data already exists.
Solution: Use the update endpoint or use different data.

Rate Limit Errors

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.