Error Handling Guide
The Anyformat API uses conventional HTTP response codes and provides structured error responses to help you build robust integrations.HTTP Status Codes
The API uses standard HTTP status codes to indicate the success or failure of requests:| Status Code | Meaning | Description |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource was successfully created |
204 | No Content | Request succeeded with no response body |
400 | Bad Request | Invalid request data or parameters |
403 | Forbidden | Missing/invalid authentication or insufficient permissions |
404 | Not Found | Resource doesn’t exist |
500 | Internal Server Error | Unexpected server error |
Error Response Format
All error responses follow a consistent JSON structure:Common Error Scenarios
Authentication Errors
Missing API Key:Validation Errors
Missing Required Fields:Resource Errors
Workflow Not Found:Error Handling Best Practices
1. Always Check HTTP Status Codes
2. Use Error Codes for Programmatic Handling
3. Implement Retry Logic for Server Errors
4. Validate Requests Before Sending
5. Log Errors for Debugging
Error Response Structure Notes
- All error messages use
"detail"for consistent error descriptions - Internal errors (500) automatically include a
"reference_id"field (format:err_XXXX) for tracking and support purposes - All errors include an
"error_code"field for programmatic handling
Technical Note: Authentication Status Codes
The API returns 403 Forbidden for authentication failures (missing or invalid API keys). This follows standard HTTP conventions where authentication middleware handles API key validation and converts authentication failures to 403 responses by default.Testing Error Scenarios
When building your integration, test these common error scenarios:- Missing API key - Make requests without the
x-api-keyheader - Invalid API key - Use a fake or expired API key
- Missing required fields - Create workflows without name or fields
- Invalid JSON - Send malformed JSON in request body
- Nonexistent resources - Try to access workflows or jobs that don’t exist
- Large payloads - Test with very large files or data
