Process File Async
Queue document processing jobs asynchronously for better scalability and reliable handling of large files. Jobs are processed in the background, and you can poll for results or receive webhook notifications when complete.
Request Parameters
extractionSchemaId
stringThe unique identifier of the extraction schema to use for processing.
fileId
stringThe file ID returned from the get-url endpoint after uploading your file.
Authorization
stringBearer token for authentication.
Content-Type
stringMust be set to application/json
Send an empty JSON object {}
as the request body.
Responses
Job successfully queued for processing. Use the returned jobId to track progress.
A processing job is already in progress for this file. Duplicate submissions are prevented.
Common error responses you might encounter.
Polling for Results
After queuing a job, use the get-file-data endpoint to poll for completion status and retrieve results.
- • Use reasonable polling intervals (5-10 seconds) to avoid overwhelming the API
- • Implement timeout logic to prevent infinite polling loops
- • Handle network errors gracefully with retry logic
- • Consider using webhooks for real-time notifications instead of polling
- • Log polling attempts for debugging and monitoring purposes
Status Response Types
Job is currently being processed. Continue polling until status changes.
Processing completed successfully. Returns the extracted data along with status information.
Processing failed due to an error. Check the error message for details.
Complete Workflow Example
Here's a complete example showing the full async processing workflow from job submission to result retrieval.
Best Practices
- • Always check for 409 Conflict responses (duplicate jobs)
- • Implement exponential backoff for failed polling attempts
- • Set reasonable timeouts to prevent infinite polling
- • Log job IDs for debugging and support purposes
- • Use 5-10 second polling intervals to balance responsiveness and load
- • Consider webhooks for real-time notifications
- • Process multiple files concurrently for batch operations
- • Cache successful results to avoid reprocessing
- • Track job success rates and processing times
- • Monitor queue depths during high-volume periods
- • Set up alerts for failed jobs or unusual processing delays
- • Log all API interactions for audit trails
- • Use async processing for all files larger than 10MB
- • Combine with webhooks for event-driven architectures
- • Store job IDs in your database for tracking
- • Implement retry logic for transient failures