Error Handling

The API uses standard HTTP status codes and consistent error response formats to help you handle errors effectively.

Standard Error Codes

  • Name
    200 OK
    Description

    Request succeeded

  • Name
    201 Created
    Description

    Resource created successfully

  • Name
    400 Bad Request
    Description

    Invalid request format or parameters

  • Name
    401 Unauthorized
    Description

    Authentication failed

  • Name
    403 Forbidden
    Description

    Insufficient permissions

  • Name
    404 Not Found
    Description

    Resource not found

  • Name
    409 Conflict
    Description

    Request conflicts with the current state

  • Name
    422 Unprocessable Entity
    Description

    Validation errors

  • Name
    429 Too Many Requests
    Description

    Rate limit exceeded

  • Name
    500 Internal Server Error
    Description

    Server-side error

  • Name
    502 Bad Gateway
    Description

    Server-side error

Error Response Format

All error responses follow a consistent format that includes an error code, message, and optional details about specific validation failures.

Error response structure

{
  "error": {
    "code": "string",
    "message": "string",
    "details": [
      {
        "field": "string",
        "message": "string"
      }
    ]
  }
}

Troubleshooting Common Issues

Authentication Errors

Verify your API credentials and check if your access token has expired. Tokens expire after 1 hour and need to be refreshed.

Validation Errors

When receiving a 422 status code:

  • Check your request payload against the API specifications
  • Review the error details array for specific field validation failures
  • Ensure all required fields are provided
  • Verify data types and formats match the API requirements

Rate Limiting

If you receive a 429 status code:

  • Implement exponential backoff in your retry logic
  • Consider reducing your request frequency
  • Check your rate limits in the API response headers

Resource Not Found

When receiving a 404 status code:

  • Verify the resource ID exists and is correct
  • Check if you're using the correct API endpoint
  • Ensure the resource hasn't been deleted

Server Errors

For 500 or 502 status codes:

  • Note the timestamp of the error
  • Save the request details and error response
  • Contact support with this information for assistance