Error Handling
Learn about API error responses, error codes, and best practices for handling errors in your integration.
Error Response Format
The Trakkr API uses standard HTTP status codes and returns error details in a consistent JSON format. All errors include a type,code, and human-readable message.
typeThe class of error (e.g., authentication_error)
codeA machine-readable error code for programmatic handling
messageA human-readable description of what went wrong
paramThe specific parameter that caused the error (when applicable)
doc_urlLink to documentation for this specific error
HTTP Status Codes
The API uses conventional HTTP response codes to indicate success or failure:
Success - Request was successful
Client error - Problem with your request
Server error - Something went wrong on our end
| Code | Description |
|---|---|
200 | OK - Request succeeded |
201 | Created - Resource successfully created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - No permission to access resource |
404 | Not Found - Resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Something went wrong |
503 | Service Unavailable - Temporary outage |
Error Types Reference
Detailed reference for all error types and their associated codes:
authentication_error
HTTP 401Problems authenticating your request
invalid_api_key | The API key is invalid or malformed |
api_key_revoked | The API key has been revoked |
api_key_expired | The API key has expired |
missing_authorization | No Authorization header provided |
invalid_request_error
HTTP 400Your request has invalid parameters
invalid_param | A request parameter is invalid |
missing_param | A required parameter is missing |
invalid_json | Request body is not valid JSON |
not_found | The requested resource does not exist (404) |
rate_limit_error
HTTP 429Too many requests in a given time period
rate_limit_exceeded | Request rate limit exceeded |
daily_limit_exceeded | Daily request quota exceeded |
api_error
HTTP 500An error occurred on our servers
internal_error | Internal server error |
service_unavailable | Service temporarily unavailable |
timeout | Request timed out |
Best Practices
Handle all error types
Implement handlers for authentication errors, validation errors, rate limits, and server errors. Each requires different handling logic.
Log errors with context
Log the full error response including the request ID (from X-Request-Id header) for debugging and support requests.
Show user-friendly messages
Translate API error codes into helpful messages for your users. Don't expose technical error details directly.
Retry transient errors
Implement retry logic with exponential backoff for 5xx errors and 429 rate limits. Don't retry 4xx client errors.
