Error Codes

The Reevit API uses conventional HTTP response codes to indicate the success or failure of an API request.

HTTP Status Codes

Error Response Format

All errors return a consistent JSON structure:

Common Error Codes

Authentication Errors

Payment Errors

Connection Errors

Subscription Errors

Validation Errors

Rate Limiting

Rate limit headers are included in responses:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests in window
  • X-RateLimit-Reset: Unix timestamp when limit resets

Handling Errors

Best Practices

  1. Always check the HTTP status code before parsing the response body
  2. Log error responses for debugging and monitoring
  3. Implement retry logic for 5xx errors and rate limits
  4. Use idempotency keys to safely retry failed requests
  5. Handle specific error codes to provide better user feedback

Example Error Handling

Retry Strategy

For transient errors (5xx, rate limits), use exponential backoff: