On this pageAsync jobs
Async jobs
DocImprint ·
When should I use async jobs?
Stored POST /v1/extract returns 202 + job_id by default. Poll GET /v1/jobs/{id} every 2–5s until complete, or pass a webhook. Use ?sync=true only for small docs; POST /v1/jobs for batches.
Stored extracts queue by default (202 + job_id). Poll every 2–5s or pass a webhook. Use POST /v1/jobs for batches.
- POST
/v1/jobs$0.075Batch jobs
Queue multi-item extract work with optional webhook progress. Prefer this over many sync calls for large batches.
- GET
/v1/jobs/{id}FreeJob status
Poll status, progress_pct, error, and result / bundle_id for any async extract or focused ?async=true call.
bashQueue + poll
# Stored extract → 202 + job_id (default). Poll until complete.
curl -X POST https://api.docimprint.com/v1/extract \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"source": "https://example.com/report.pdf", "webhook": "https://myapp.com/hooks/docimprint"}'
curl https://api.docimprint.com/v1/jobs/job_abc123 \
-H "Authorization: Bearer $API_KEY"
# Inline bundle when small: ?sync=true · Focused routes: ?async=true to queueWebhooks
Events: job.queued, job.progress, job.complete, job.failed. Verify X-DocImprint-Signature (HMAC-SHA256 of raw body with WEBHOOK_SECRET). 5s delivery timeout; no retries.