Overview
Instead of polling for completion, register a webhook URL to receive a POST request when your document finishes processing.Setup
Passwebhook_url when uploading a document:
Webhook payload
When the document completes, OkraPDF sends a POST request to your URL:Webhook handler example
Retry behavior
- OkraPDF retries failed webhook deliveries up to 3 times
- Retries use exponential backoff (5s, 30s, 5min)
- Your endpoint must return a 2xx status to acknowledge receipt
- Non-2xx or timeout (30s) triggers a retry
Best practices
- Return 200 quickly - process the webhook payload asynchronously
- Use HTTPS - webhook URLs must use HTTPS in production
- Verify the payload - check that the
document_idexists in your system - Handle duplicates - webhooks may be delivered more than once