Overview
The Veridox API uses conventional HTTP status codes and structured error responses to indicate the success or failure of requests. This guide covers common error patterns, recommended retry strategies, and best practices for robust error handling.Consistent Error Format: All error responses follow a standardised schema with
error_code, error_message, and optional error_details fields.Error Response Format
All errors follow this consistent structure:Error Response Fields
HTTP Status Codes
The API uses standard HTTP status codes to indicate request outcomes:Common Error Types
Authentication Errors (401)
Authentication failures occur when API key validation fails.Invalid API Key
- API key typo or formatting error
- API key deleted or revoked
- Wrong environment (staging vs production key)
Verify API key format and value
Regenerate API key if compromised
Ensure using correct environment key
Expired API Key
- API key reached expiration date
- Organisation subscription expired
Generate new API key from dashboard
Update application configuration
Verify organisation subscription status
Invalid Membership
- User removed from organisation
- Organisation membership revoked
- API key associated with deleted user
Verify organisation membership status
Contact organisation owner
Generate new API key if membership restored
Validation Errors (400)
Validation errors provide field-level feedback when request data is malformed or invalid.Request Body Validation
Parse
validation_errors array for field-specific issuesDisplay errors next to relevant form fields
Validate input client-side before submission
Log validation patterns to improve UX
Rate Limiting Errors (429)
Rate limits protect API infrastructure and ensure fair usage.
Handling Strategy:
Implement exponential backoff retry logic
Respect
retry_after header when providedUse Server-Sent Events instead of polling where possible
Cache responses to reduce redundant requests
Resource Errors (404, 409)
Resource Not Found (404)
- Case ID, file ID, or request ID doesn’t exist
- Resource deleted before request
- Typo in resource identifier
Validate UUIDs before making requests
Implement graceful fallback for missing resources
Cache resource existence checks
Resource Conflict (409)
- Attempting to upload files to locked case
- Duplicate operation detected
- State transition not allowed
Check resource state before operations
Create new case if existing case is locked
Implement idempotency where possible
Server Errors (500, 503)
Internal Server Error (500)
- Unexpected server-side exception
- Database connectivity issues
- Processing pipeline failures
Retry after short delay (2-5 seconds)
Log full error context for debugging
Contact support if error persists
Implement fallback or degraded mode
Service Unavailable (503)
- Scheduled maintenance
- Temporary overload
- Infrastructure scaling
Display maintenance message to users
Retry after specified delay
Queue operations for later processing
Error Handling Best Practices
Comprehensive Error Handler
React Error Boundary
Error Handling Guidelines
Design Principles
Fail gracefully - Provide clear error messages and recovery paths
Be specific - Use
error_code for programmatic handling, not just status codesRetry intelligently - Implement exponential backoff for transient errors
Log comprehensively - Capture full error context for debugging
User Experience
User-friendly messages - Translate technical errors into actionable guidance
Show progress - Display retry countdown or progress indicators
Provide alternatives - Offer fallback options when primary action fails
Don’t expose internals - Hide technical details from end users
Monitoring and Debugging
Track error rates - Monitor error types and frequencies
Set up alerts - Get notified of unusual error patterns
Log context - Include request IDs, timestamps, and user actions
Correlate errors - Group related errors for root cause analysis
Security Considerations
Don’t leak data - Avoid exposing sensitive information in error messages
Rate limit retries - Prevent abuse through excessive retry attempts
Validate client-side - Reduce unnecessary API calls with validation
Sanitise error logs - Remove PII before logging error details
Common Troubleshooting
API Key Issues
Symptom: Consistent 401 errors Checklist:- Verify API key format (
vdx_prefix) - Check environment (staging vs production)
- Confirm organisation membership
- Test with newly generated key
Rate Limiting
Symptom: Frequent 429 errors Solutions:- Implement request queueing
- Use Server-Sent Events instead of polling
- Cache API responses
- Batch operations where possible
Timeout Errors
Symptom: Requests timing out Causes:- Large file uploads
- Complex analysis operations
- Network connectivity issues
- Increase timeout thresholds
- Use progress monitoring endpoints
- Split large batches into smaller chunks
Validation Failures
Symptom: Consistent 400 errors Solutions:- Review API documentation for field requirements
- Validate input formats (email, UUID, ISO dates)
- Check field length limits
- Ensure required fields are provided
Related Resources
API Reference
Complete endpoint documentation with example requests
Quickstart Guide
Step-by-step tutorial with error handling examples
Rate Limiting
Detailed rate limit information by endpoint
Authentication
API key validation and authentication testing