Error Handling
All ATHENA API errors follow a consistent format.
Error Response Format
{
"error": {
"code": "invalid_request",
"message": "Missing required field: user_id",
"param": "user_id",
"doc_url": "https://docs.athenatrust.ai/errors"
}
}code
Machine-readable error code
message
Human-readable description
param
Parameter that caused error (if applicable)
doc_url
Link to documentation
HTTP Status Codes
200
Success
Request completed
201
Created
Resource created
400
Bad Request
Invalid parameters
401
Unauthorized
Invalid/missing API key
403
Forbidden
Insufficient permissions
404
Not Found
Resource doesn't exist
429
Too Many Requests
Rate limit exceeded
500
Internal Error
Server error
Error Codes
Authentication Errors
authentication_failed
401
Invalid or missing API key
api_key_revoked
401
API key has been revoked
api_key_expired
401
API key has expired
Validation Errors
invalid_request
400
Request body is invalid
missing_parameter
400
Required parameter missing
invalid_parameter
400
Parameter value is invalid
Rate Limit Errors
rate_limit_exceeded
429
Too many requests
Resource Errors
not_found
404
Resource doesn't exist
conflict
409
Resource already exists
Server Errors
internal_error
500
Unexpected server error
service_unavailable
503
Temporarily unavailable
Handling Errors
JavaScript
Python
Retry Logic
Rate Limits
When you receive a 429 error:
Wait for the Retry-After duration, then retry.
Server Errors
For 5xx errors, use exponential backoff:
Debugging
Request ID
Every response includes a request ID:
Include this when contacting support.
Verbose Errors (Development)
During development, errors include additional context:
Next: Changelog
Last updated