Async processing
For large files, batch pipelines, or serverless integrations, use async mode.
Enable async
curl -X POST https://cyber.lerepop.lv/api/v1/extract \
-H "Authorization: Bearer ext_live_..." \
-F "file=@large-scan.pdf" \
-F "document_type=invoice" \
-F "options[async]=true" \
-F "webhook_url=https://your-app.com/webhooks/extract"
Immediate response (202 Accepted)
{
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "queued",
"poll_url": "https://cyber.lerepop.lv/api/v1/requests/550e8400-e29b-41d4-a716-446655440000"
}
Poll for status
curl https://cyber.lerepop.lv/api/v1/requests/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer ext_live_..."
Possible statuses:
| status | Meaning |
|---|---|
queued | Waiting in queue |
processing | Pipeline running |
completed | Done — full extraction result included |
failed | Error — see error field |
Webhooks
When webhook_url is provided, we POST the completed result (or failure) to your endpoint.
See Webhooks for signature verification.
When to use sync vs async
| Mode | Best for | Timeout |
|---|---|---|
| Sync (default) | Interactive apps, single documents, digital PDFs | ~30 s server timeout |
| Async | Batch uploads, OCR-heavy scans, webhook-driven workflows | No client wait |
Queue requirements
Async mode requires a running queue worker:
php artisan queue:work (or Horizon/supervisor in production).