Error Codes
All CRAFT APIs return consistent error responses. This page documents the error format, all error codes, and troubleshooting guidance for each.Error Response Format
Error responses follow a standard JSON structure:HTTP Status Codes
Error Codes Reference
The OpenAPI specifications define a base
ErrorCode enum with 9 values: INVALID_REQUEST, INVALID_TOKEN, INSUFFICIENT_PERMISSIONS, RESOURCE_NOT_FOUND, RESOURCE_ALREADY_EXISTS, VALIDATION_ERROR, RATE_LIMIT_EXCEEDED, SERVICE_UNAVAILABLE, INTERNAL_ERROR. The implementation may return more specific codes within each category as documented below.Authentication Errors (401)
Authorization Errors (403)
Resource Errors (404, 409)
Validation Errors (400, 422)
Rate Limiting Errors (429)
Server Errors (500, 502, 503)
Handling Errors in Code
- Python
- TypeScript
- cURL
UnexpectedStatus.content is raw bytes; decode and json.loads() to read the
envelope ({"error": {"code", "message", "request_id"}}).Retry Strategy
For transient errors (429, 500, 502, 503), implement exponential backoff with jitter:Getting Help
When reporting an issue, include:- The
request_idfrom the error response - The
trace_idfor end-to-end correlation - The timestamp of the request
- The full error response body
Next Steps
API Overview
Review the full API structure and endpoints.
API Authentication
Learn how to obtain and manage JWT tokens.
Python SDK
Use the Python SDK with built-in error handling.
TypeScript SDK
Use the TypeScript SDK with built-in error handling.

