Skip to main content

Overview

The Cuey API uses standard HTTP status codes and returns error responses in a consistent format.

Error Response Format

All error responses follow this structure:

HTTP Status Codes

Error Codes

UNAUTHORIZED

Returned when the API key is invalid or missing. Status Code: 401 Example Response:
Common Causes:
  • Missing Authorization header
  • Invalid API key
  • Expired or revoked API key

NOT_FOUND

Returned when a requested resource doesn’t exist. Status Code: 404 Example Response:
Common Causes:
  • Invalid resource ID
  • Resource belongs to another team
  • Resource was deleted

VALIDATION_ERROR

Returned when request validation fails. Status Code: 400 Example Response:
Common Causes:
  • Invalid field values
  • Missing required fields
  • Invalid data types
  • Validation rule violations

BAD_REQUEST

Returned when the request is invalid (e.g., business logic violations). Status Code: 400 Example Response:
Common Causes:
  • Trying to update a non-pending event
  • Trying to delete an event created by a cron
  • Requesting an out-of-range page number

INTERNAL_SERVER_ERROR

Returned when a server error occurs. Status Code: 500 Example Response:
Common Causes:
  • Database errors
  • Requesting an out-of-range page number
  • Unexpected server failures

Handling Errors

Example: Handling Validation Errors

Example: Handling Unauthorized Errors

Example: Handling Not Found Errors

Best Practices

Always Check Status Codes

Provide User-Friendly Messages

Retry on Server Errors

Next Steps

Authentication

Learn about API authentication.

Events Endpoints

Explore event endpoints.

Crons Endpoints

Explore cron endpoints.