Webhooks provide real-time notifications when your document processing jobs complete, eliminating the need for continuous polling. This event-driven approach improves efficiency and reduces unnecessary API calls.
Setting Up Webhooks
- Navigate to the Settings Panel
- Locate the “Webhooks” section
- Enter your webhook endpoint URL with an optional secret
We currently only support a single webhook per account.
Webhook reliability notes:
- Webhooks are retried on 5xx errors and timeouts, but not on 4xx errors
- Always implement idempotent webhook handlers using
request_id to deduplicate
- Set a reasonable server timeout — Datalab waits up to 30 seconds for your endpoint to respond
Per-Request Webhook Override
You can override the default webhook URL for specific API requests by including the webhook_url parameter:
This is useful when:
- Different projects need different webhook endpoints
- You want to route notifications to specific services
- Testing webhook integrations without changing account settings
The per-request webhook URL will be used instead of your account’s default webhook URL for that specific request only.
Webhook Payload
When a webhook is triggered, Datalab sends a POST request to your configured endpoint with a JSON payload containing the following fields:
Webhook Secret Verification
The webhook secret is included in the JSON request body, allowing you to verify that incoming webhooks are authentic requests from Datalab.
Verifying Webhooks on Your Server
Here’s an example of how to verify the webhook secret in your receiving endpoint:
The webhook secret is transmitted in plaintext within the request body. Ensure your webhook endpoint uses HTTPS to encrypt the data in transit. Avoid logging the full request body in production to prevent secret exposure.
Delivery Attempt History
Every webhook delivery attempt is recorded and visible in the Usage tab of the dashboard. Click any processed request to open the delivery drawer and see:
- Timestamp of each delivery attempt
- HTTP status code returned by your endpoint
- Response body (truncated for large payloads)
- Whether the delivery succeeded or is being retried
Use delivery history to diagnose missed events without adding logging to your own server.
Troubleshooting
Not Receiving Events
If your webhook is not receiving events, try the following:
- Verify URL is publicly accessible
- Validate webhook secret matches
- Check the delivery attempt history in the Usage tab for status codes and error details
- Ensure your endpoint responds within 30 seconds
Duplicate Events
We may send duplicate responses to a webhook endpoint. To handle this we
recommend that you implement idempotency checks to ensure single processing.