Error Handling
All API errors return a consistent JSON structure for predictable client-side handling.
Error Response Structure
ParseSphere APIs return errors in a standardized format:
{
"error_code": "workspace_not_found",
"message": "Workspace not found or access denied",
"details": {
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Response Fields:
error_code: Machine-readable error code for programmatic handlingmessage: Human-readable description safe to display to usersdetails: Additional context when available (e.g., which field failed validation)request_id: Unique identifier for request tracing and supporttimestamp: When the error occurred (UTC)
HTTP Status Codes
ParseSphere uses standard HTTP status codes to indicate the result of API requests.
Success Codes (2xx)
200 OK: Standard successful request
201 Created: Resource successfully created
202 Accepted: Asynchronous processing has begun
204 No Content: Successful deletion or operation with no response body
Client Error Codes (4xx)
Warning
Client errors indicate problems with the request that need to be fixed before retrying.
400 Bad Request: Request parameters are malformed or invalid
401 Unauthorized: Missing or invalid authentication credentials
402 Payment Required: Insufficient credits or subscription issue
403 Forbidden: Authenticated user lacks permission for the requested operation
404 Not Found: The requested resource doesn't exist
409 Conflict: Resource conflict (e.g., uploading a duplicate document)
413 Payload Too Large: Uploaded file exceeds size limits
422 Unprocessable Entity: Request is well-formed but fails validation rules
429 Too Many Requests: Rate limit exceeded. Wait briefly and retry with exponential backoff
Server Error Codes (5xx)
500 Internal Server Error: An internal server error occurred
Information
Server errors are logged automatically. If you encounter them repeatedly, contact support with your request_id.
Document Parsing Errors
Parse File Size Limit (413)
Files exceeding 200 MB are rejected before processing:
{
"error_code": "file_too_large",
"message": "File too large (250.0MB). Maximum allowed: 200MB",
"details": {
"file_size_mb": 55.0,
"max_size_mb": 50
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Compress or split the document before uploading.
Unsupported File Type (422)
Files with unsupported extensions are rejected:
{
"error_code": "invalid_file_type",
"message": "Unsupported file type: .xyz. Supported formats: pdf, docx, pptx, xlsx, csv, txt, md, json, xml, html, htm, yaml, yml, log",
"details": {
"file_extension": "xyz",
"supported_formats": ["pdf", "docx", "pptx", "xlsx", "csv", "txt", "md", "json", "xml", "html", "htm", "yaml", "yml", "log"]
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Supported Formats:
- PDF (
.pdf) - Word (
.docx) - PowerPoint (
.pptx) - Excel (
.xlsx) - CSV (
.csv) - Plain Text (
.txt) - Markdown (
.md) - JSON (
.json) - XML (
.xml) - HTML (
.html,.htm) - YAML (
.yaml,.yml) - Log (
.log)
Solution: Convert the document to a supported format.
Parse Not Found (404)
Requesting a parse that doesn't exist or has expired:
{
"error_code": "resource_not_found",
"message": "Parse not found. Parses expire after 24 hours.",
"details": {
"parse_id": "550e8400-e29b-41d4-a716-446655440000"
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Information
Parse results expire based on the session_ttl parameter (default: 30 minutes, min: 60 seconds). Adjust the TTL when creating the parse if you need longer retention.
Solution: Adjust the session_ttl when creating the parse or save results immediately if you need them longer.
Parse Failed
When a parse job fails, the status endpoint returns details about the failure:
{
"parse_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"error": "Failed to extract PDF: Document is corrupted or encrypted",
"created_at": "2025-01-03T12:00:00Z",
"completed_at": "2025-01-03T12:00:05Z"
}Common Failure Reasons:
- Corrupted files: Document structure is damaged
- Password-protected documents: Encrypted PDFs require decryption
- Invalid file formats: Files disguised with supported extensions
- Processing timeout: Document too complex (exceeds 10 minute limit)
Tip
For password-protected PDFs, decrypt them before upload. For corrupted files, try re-exporting from the source application.
Workspace & File Errors
Workspace File Size Limit (413)
Files exceeding 200 MB are rejected:
{
"error_code": "file_too_large",
"message": "File too large (250.0MB). Maximum allowed: 200MB",
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Split large files into smaller parts or aggregate data before upload.
Unsupported File Format (422)
Only specific formats are supported for workspace files:
{
"error_code": "unsupported_file_format",
"message": "Unsupported file type: exe",
"details": {
"supported_types": ["csv", "xlsx", "xls", "parquet", "pdf", "docx", "pptx", "txt", "md", "json", "xml", "html", "htm", "yaml", "yml", "log"]
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Supported Formats:
Tabular Data (for SQL querying):
- CSV (
.csv) - Excel (
.xlsx,.xls) - Parquet (
.parquet)
Documents (for RAG search):
- PDF (
.pdf) - Word (
.docx) - PowerPoint (
.pptx) - Plain Text (
.txt) - Markdown (
.md) - JSON (
.json) - XML (
.xml) - HTML (
.html,.htm) - YAML (
.yaml,.yml) - Log (
.log)
Workspace Not Found (404)
Accessing a workspace that doesn't exist or you don't have access to:
{
"error_code": "workspace_not_found",
"message": "Workspace not found or access denied",
"details": {
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Warning
Workspaces can be accessed by their owner, organization members with shared access (Editor or Viewer roles), or via API keys belonging to the owner. Check that you're using the correct credentials.
File Not Found (404)
Accessing a file that doesn't exist in the workspace:
{
"error_code": "resource_not_found",
"message": "File not found in workspace",
"details": {
"file_id": "880e8400-e29b-41d4-a716-446655440000",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}No Files in Workspace (400)
Attempting to query a workspace with no completed files:
{
"error_code": "validation_error",
"message": "No completed files found in workspace. Please upload and process files first.",
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Upload files and wait for processing to complete before querying.
Query Execution Failed (500)
When a natural language query generates invalid SQL or encounters a database error:
{
"error_code": "internal_error",
"message": "An unexpected error occurred. Please try again.",
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Information
The AI agent will automatically retry with corrected SQL if possible. For persistent issues, contact support with the request_id.
Query Timeout (500)
Queries that exceed 60 seconds are terminated:
{
"error_code": "internal_error",
"message": "Query execution timeout after 60 seconds",
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Simplify your question, add filters to reduce data scope, or query specific files instead of all workspace data.
Insufficient Credits (402)
Operations that consume credits are blocked when your balance is depleted:
{
"error_code": "insufficient_credits",
"message": "You've used all your monthly credits.",
"details": {
"credits_remaining": 0,
"action_required": "upgrade_or_wait"
},
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Upgrade your plan for more credits or wait for your monthly credit reset.
Duplicate Document (409)
Uploading a document that already exists in the workspace:
{
"error_code": "duplicate_document",
"message": "A document with this name already exists in the workspace",
"request_id": "req_abc123def456",
"timestamp": "2025-01-03T12:00:00Z"
}Solution: Delete the existing file first or upload with a different filename.
File Processing Errors
Processing Failed
When file processing fails, the status endpoint returns error details:
{
"id": "880e8400-e29b-41d4-a716-446655440000",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"error_message": "Failed to parse CSV: Invalid delimiter or malformed data",
"created_at": "2025-01-03T12:00:00Z",
"completed_at": "2025-01-03T12:00:15Z"
}Common Causes:
- Malformed CSV: Inconsistent delimiters, unescaped quotes
- Empty file: File contains no data rows
- Encoding issues: Non-UTF-8 encoding
- Excel corruption: Workbook structure is damaged
Exception Types
ParseSphere uses specific exception types for different error categories:
Document Parsing:
ExtractionError: General extraction failureUnsupportedFileError: File type not supportedFileCorruptedError: Document structure is invalid
Workspace Files:
DataTransformError: CSV/Excel transformation failedSchemaAnalysisError: Unable to analyze file schemaBlobStorageError: Storage operation failedDuckDBConnectionError: Query execution errorSQLValidationError: Generated SQL failed validation
Error Recovery Strategies
Automatic Retries
Information
ParseSphere automatically retries certain operations with exponential backoff.
Background Task Retries:
- Document parsing: Max 3 retries
- File processing: Max 3 retries
- Retry delay: Exponential backoff
Webhook Delivery Retries:
- Max 3 delivery attempts
- Initial delay: 1 second
- Exponential backoff: delay × 2^attempt
Handling Failed Operations
For Parse Jobs:
- Check the parse status endpoint for detailed error message
- Review common failure reasons
- Fix the issue (e.g., decrypt PDF, repair file)
- Create a new parse job
For File Processing:
- Check the file status endpoint for error details
- Validate CSV format and encoding
- Verify Excel file isn't corrupted
- Delete failed file and re-upload
For Queries:
- Review the query log for execution details
- Simplify your natural language question
- Ensure column names match your query intent
- Try querying fewer files at once
Best Practices
Preventing Errors
File Validation
Validate file size and format before upload to avoid rejected requests.
Before Uploading Documents for Parsing:
- Check file size is under 200 MB
- Verify file extension matches actual format
- Test that file opens in native application
- Remove password protection from PDFs
Before Uploading Files to Workspaces:
- Check file size is under 200 MB
- Validate CSV has consistent delimiter
- Ensure Excel has data in first sheet
- Use UTF-8 encoding for CSV files
Error Monitoring
Information
All operations are logged with timestamps and error details. Include the request_id when contacting support.
Key Metrics to Track:
- Parse success rate by file type
- File processing time and failures
- Query execution time and errors
Getting Help
If you encounter persistent errors:
- Check Status Endpoints: Always review detailed error messages from status endpoints
- Note the Request ID: Every error response includes a
request_idfor tracing - Verify Authentication: Ensure API keys are valid and have correct permissions
- Contact Support: For repeated 500 errors, contact support with the
request_id
What's Next?
Learn more about ParseSphere:
- Quick Start - Get started with document parsing
- Authentication - Manage API keys
- Rate Limits - Understand usage limits
- Document Parsing - Deep dive into extraction
- VIVI Document Intelligence - Natural language queries