Asynchronous Processing Overview
Asynchronous processing allows you to upload lab report documents and receive immediate responses while the AI analysis happens in the background. This approach provides better user experience for interactive applications and enables you to handle multiple requests efficiently.How Asynchronous Processing Works
- Upload Document: send a POST request with
wait_on_process: false
(default) - Immediate Response: receive a response with
status: "processing"
, and arecord_id
- Background Processing: AI models analyze the document (typically 10–60 seconds)
- Get Results: receive webhook notification with analysis report when finished
Getting Results
Webhooks
Configure a webhook URL to receive real-time notifications when analysis completes: Request:Alternative: Manual Checking
If webhooks are not available in your environment, you can check the status using theGET /lab_reports/{lab_report_id}
endpoint:
Webhook Configuration
Setup
Configure your webhook URL through the admin console. Your endpoint must:- Respond with HTTP 200 to acknowledge receipt
- Handle POST requests with JSON payloads
- Verify HMAC signatures for security
Security
All webhook requests include HMAC SHA256 signature verification:- Header:
x-body-signature
contains the hex-encoded HMAC signature - Key: uses your application’s webhook signature key (configured in admin console)
- Algorithm:
HMAC-SHA256(webhook_signature_key, request_body)
Status Handling
Your webhook handler should handle different status values:completed
: Analysis successful - lab report data availablefailed
: Analysis failed - checkparsing_error
field for details
status
is failed
, check the parsing_error
field for specific details about what prevented successful analysis.