Skip to main content

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

Causes:
  • API key typo or formatting error
  • API key deleted or revoked
  • Wrong environment (staging vs production key)
Resolution:
Verify API key format and value
Regenerate API key if compromised
Ensure using correct environment key

Expired API Key

Causes:
  • API key reached expiration date
  • Organisation subscription expired
Resolution:
Generate new API key from dashboard
Update application configuration
Verify organisation subscription status

Invalid Membership

Causes:
  • User removed from organisation
  • Organisation membership revoked
  • API key associated with deleted user
Resolution:
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

Handling Strategy:
Parse validation_errors array for field-specific issues
Display errors next to relevant form fields
Validate input client-side before submission
Log validation patterns to improve UX
Example Handler:

Rate Limiting Errors (429)

Rate limits protect API infrastructure and ensure fair usage.
Rate Limits by Operation: Handling Strategy:
Implement exponential backoff retry logic
Respect retry_after header when provided
Use Server-Sent Events instead of polling where possible
Cache responses to reduce redundant requests
Exponential Backoff Implementation:

Resource Errors (404, 409)

Resource Not Found (404)

Common Causes:
  • Case ID, file ID, or request ID doesn’t exist
  • Resource deleted before request
  • Typo in resource identifier
Handling Strategy:
Validate UUIDs before making requests
Implement graceful fallback for missing resources
Cache resource existence checks

Resource Conflict (409)

Common Scenarios:
  • Attempting to upload files to locked case
  • Duplicate operation detected
  • State transition not allowed
Handling Strategy:
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)

Causes:
  • Unexpected server-side exception
  • Database connectivity issues
  • Processing pipeline failures
Handling Strategy:
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)

Causes:
  • Scheduled maintenance
  • Temporary overload
  • Infrastructure scaling
Handling Strategy:
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 codes
Retry 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
Solutions:
  • 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

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