Error Codes Reference

Understanding HTTP status codes and how to handle them

2xx Success

200 OK

The request was successful and the response contains the requested data.

Common with: GET, POST, PUT requests

201 Created

A new resource was successfully created.

Common with: POST requests for creating resources

4xx Client Errors

400 Bad Request

The request was malformed or contains invalid parameters.

Common causes: Missing required fields, invalid JSON, incorrect data types

401 Unauthorized

Authentication is required or has failed. Your API key may be missing or invalid.

Common causes: Missing API key, invalid API key, expired key

403 Forbidden

You don't have permission to access this resource. Your API key may lack the required permissions.

Common causes: Insufficient permissions, suspended account, accessing test endpoint with live key

404 Not Found

The requested resource doesn't exist. Check your endpoint URL.

Common causes: Incorrect URL, typo in endpoint path, resource was deleted

422 Unprocessable Entity

The request was well-formed but contains semantic errors or validation failures.

Common causes: Invalid email format, out-of-range values, business logic validation failures

429 Too Many Requests

You've exceeded your rate limit. Wait before making more requests or upgrade your plan.

Common causes: Too many requests per minute, exceeded daily quota

5xx Server Errors

500 Internal Server Error

An unexpected error occurred on our servers. This is a temporary issue.

Action: Retry the request. If the issue persists, contact support.

502 Bad Gateway

The gateway received an invalid response from the backend server.

Action: Retry the request after a brief delay.

503 Service Unavailable

The service is temporarily unavailable, usually due to maintenance or overload.

Action: Check our status page and retry after a delay.

504 Gateway Timeout

The gateway didn't receive a response from the backend server in time.

Action: Retry the request. Consider implementing exponential backoff.

Best Practices for Error Handling

  • βœ“ Always check the status code before processing the response
  • βœ“ Implement exponential backoff for retry logic on 5xx errors
  • βœ“ Log error details for debugging but never expose sensitive data
  • βœ“ Handle rate limits gracefully by respecting retry-after headers
  • βœ“ Show user-friendly error messages instead of raw API responses