Skip to content
ComPDF

Error Codes

Error Response Format

AI service error responses use the following JSON structure:

json
{
  "success": false,
  "error_code": "DOWNLOAD_TIMEOUT",
  "code": 200002,
  "message": "Human-readable description",
  "detail": {}
}
FieldTypeDescription
codeInteger6-digit numeric error code, programmatic identifier
error_codeStringSemantic error identifier, for readability only
messageStringError description
detailObjectAdditional context (optional)

Common Service Error Codes

These errors are handled by the service framework and apply to all ComPDF API endpoints.

01xxx — System Errors

CodeHTTPDescription
01001500Internal system error
01002500Failed to upload processed file to storage
01003500File upload error
01004500Failed to download your uploaded file
01005400File cannot be empty
01006400Invalid parameters, please set valid file parameters
01007400Task ID cannot be empty

02xxx — File Format Errors

CodeHTTPDescription
02001400File format error
02002400Unsupported file format for processing
02003400Unsupported image format
02201400The file is encrypted
02207400Failed to open file: unsupported format or encrypted
02209413File too large, please upload a smaller file
02210500File processing failed
02212500File processing failed: abnormal output file size

03000 — Parameter Validation Error

CodeHTTPDescription
03000400Parameter validation failed, typically due to missing required fields or incorrect field formats

04xxx — File & Business Errors

CodeHTTPDescription
04001400File key does not exist
04002400File size is zero
04003400File does not exist or cannot be opened
04007400Only one file is allowed for this endpoint
04008400Merge PDF supports at most 5 files

05xxx — Task Errors

CodeHTTPDescription
05001404Task does not exist or is invalid
05002409Abnormal task status
05003400File count per task has reached the threshold
05004410Task expired and was not executed
05005400At least one file is required per task

06001 — Insufficient Assets

CodeHTTPDescription
06001402You have run out of processing quota, please purchase a plan

Authentication & Authorization

HTTPCodeDescription
401401Invalid or missing API Key; authentication service unavailable
403403Insufficient permissions

AI Functional Error Codes

These errors originate from the AI document parsing and extraction service.

100xxx — Request Parameter Validation

CodeError CodeHTTPDescription
100001INVALID_REQUEST400Invalid request format
100003INVALID_JSON400JSON parsing failed
100004INVALID_CONTENT_FILTER400Unsupported content_filter value
100005INVALID_EXTRACT_MODE400Unsupported extraction mode
100006MISSING_FILE400Required file is missing
100008MISSING_EXTRACT_FIELDS400Required extract_fields is missing

200xxx — File Download

CodeError CodeHTTPDescription
200001DOWNLOAD_FAILED502File download failed
200002DOWNLOAD_TIMEOUT504Download request timed out
200003DOWNLOAD_TOO_LARGE413File exceeds configured maximum size
200009DOWNLOAD_SERVER_DISCONNECTED502Remote server disconnected unexpectedly

300xxx — Document Parsing

CodeError CodeHTTPDescription
300001PARSE_FAILED500Parser execution failed
300002PARSE_TIMEOUT504Parser request timed out
300003PARSE_PIPELINE_ERROR502Parser pipeline service returned an error
300009PARSE_FILE_TOO_LARGE413File exceeds parser size limit

400xxx — Field Extraction

CodeError CodeHTTPDescription
400001EXTRACT_FAILED500Extraction failed
400002EXTRACT_TIMEOUT504Extraction request timed out
400003EXTRACT_VLM_ERROR502VLM service returned an error
400004EXTRACT_LLM_ERROR502LLM service returned an error
400005EXTRACT_INVALID_SCHEMA400extract_fields schema is invalid
400006EXTRACT_IMAGE_LOAD_FAILED500Failed to load or render image/PDF

500xxx — Object Storage

CodeError CodeHTTPDescription
500003STORAGE_UPLOAD_FAILED500Upload to storage service failed
500004STORAGE_DOWNLOAD_FAILED500Download from storage service failed
500006STORAGE_OBJECT_NOT_FOUND404Object not found in storage

600xxx — Async Tasks

CodeError CodeHTTPDescription
600001TASK_NOT_FOUND404Task does not exist
600002TASK_ALREADY_COMPLETED400Task already completed
600003TASK_ALREADY_CANCELLED400Task already cancelled
600005TASK_RESULT_NOT_FOUND404Task result not found
600006TASK_EXPIRED410Task has expired
600007TASK_CREATE_FAILED500Failed to create task

700xxx — Database

CodeError CodeHTTPDescription
700001DB_CONNECT_FAILED500Failed to connect to database
700002DB_TIMEOUT504Database operation timed out
700003DB_QUERY_FAILED500Database query execution failed

900xxx — System-Level Errors

CodeError CodeHTTPDescription
900001INTERNAL_ERROR500Internal server error
900003SERVICE_UNAVAILABLE503Service unavailable
900005DEPENDENCY_UNAVAILABLE503Required dependency unavailable

Retry Recommendations

Error Code RangeRetryableRecommendation
100xxx, 400005NoFix the request parameters and resubmit
200xxxRecommendedFile download issues, backoff and retry
300xxx, 400xxx (except 400005)RecommendedService processing issues, backoff and retry
500xxx, 700xxx, 900xxxYesTemporary service issues, retry with interval
600xxxDependsTASK_NOT_FOUND not retryable, timeout can recreate task
06001NoPurchase a plan to continue
01xxx, 02xxx, 04xxxNoFix the file or parameters and retry