Skip to main content

Error Schema

We use standard HTTP response codes for success and failure notifications.
{
  "success": false,
  "error": {
    "code": 400,
    "timestamp": "2024-01-01T00:00:00.000Z",
    "message": "User-friendly error message",
    "details": "error/error_code"
  }
}
FieldTypeDescription
successbooleanAlways false for errors
error.codenumberHTTP status code
error.timestampstringISO 8601 timestamp
error.messagestringHuman-readable error description
error.detailsstring or arrayError code or validation details
For validation errors (400), details contains an array of field-specific errors. For all other errors, details is a string error code.

validation_error

  • Status: 400
  • Message: Invalid request parameters.
  • Suggested action: Check the details array for specific field errors. Ensure all required fields are included and properly formatted.
{
  "success": false,
  "error": {
    "code": 400,
    "timestamp": "2024-01-01T00:00:00.000Z",
    "message": "Invalid request parameters.",
    "details": [
      {
        "code": "validation/missing-user_id",
        "message": "user_id is required."
      }
    ]
  }
}

missing_api_key

  • Status: 401
  • Message: Authentication required.
  • Suggested action: Include the Authorization header: Authorization: Bearer leo_xxxxxxxxx

invalid_api_key

  • Status: 403
  • Message: Insufficient permissions.
  • Suggested action: Verify your API key has the required permissions for this endpoint.

not_found

  • Status: 404
  • Message: Resource not found.
  • Suggested action: Verify the resource UUID is correct and the resource exists.

duplicate_resource

  • Status: 409
  • Message: Resource already exists.
  • Suggested action: Check for existing resources before creating duplicates.

rate_limit_exceeded

  • Status: 429
  • Message: Rate limit exceeded.
  • Suggested action: Reduce request frequency. Implement exponential backoff. Contact support if you need higher limits.

internal_server_error

  • Status: 500
  • Message: Internal server error.
  • Suggested action: Retry the request after a brief delay. If the error persists, contact support.