Error Handling
Complete reference for API error codes, responses, and handling strategies.
Error Response Format
All API errors return a consistent JSON structure:
HTTP Status Codes
2xx Success
4xx Client Errors
5xx Server Errors
Error Codes
Authentication Errors (AUTH_*)
AUTH_MISSING_TOKEN
Missing authentication token.
Solution: Include Authorization: Bearer <token> header.
AUTH_INVALID_TOKEN
Invalid or malformed token.
Solution: Get a new token from Auth0.
AUTH_EXPIRED_TOKEN
Token has expired.
Solution: Refresh your Auth0 token.
AUTH_INSUFFICIENT_PERMISSIONS
Token lacks required permissions.
Solution: Request token with appropriate scopes.
Validation Errors (VALIDATION_*)
VALIDATION_REQUIRED_FIELD
Required field is missing.
VALIDATION_INVALID_FORMAT
Field format is invalid.
VALIDATION_OUT_OF_RANGE
Value outside acceptable range.
Resource Errors (RESOURCE_*)
RESOURCE_NOT_FOUND
Requested resource doesn’t exist.
RESOURCE_ALREADY_EXISTS
Resource with identifier already exists.
Rate Limit Errors (RATE_LIMIT_*)
RATE_LIMIT_EXCEEDED
Too many requests.
Response Headers:
Service Errors (SERVICE_*)
SERVICE_UNAVAILABLE
Temporary service outage.
SERVICE_TIMEOUT
Request timed out.
SDK Error Handling
TypeScript
Python
Retry Strategies
Exponential Backoff
Rate Limit Handling
Common Error Scenarios
Invalid Authentication
Invalid Parameters
Resource Not Found
Debugging
Request ID
Every error includes a unique request_id for debugging:
Verbose Logging
Enable detailed logging:
Best Practices
1. Always Handle Errors
2. Validate Before Sending
3. Use Appropriate Error Messages
Support
If you encounter errors not documented here:
- 📧 Email: api@theholefoundation.org (include
request_id) - 💬 Discord: Join our community
- 🐛 Issues: GitHub Issues
Related Pages
- Authentication - Authentication setup
- Rate Limits - Rate limiting details
- TypeScript SDK - SDK error handling
- Python SDK - SDK error handling