Overview
Webhooks let your application receive real-time notifications when events happen in DocuTrust. Instead of polling the API, DocuTrust sends an HTTP POST request to your configured endpoint whenever a relevant event fires. Each webhook delivery includes a JSON payload describing the event, a cryptographic signature for verification, and a unique delivery ID for deduplication.Supported Events
DocuTrust emits 14 event types across four resource categories:Form Events
Triggered when a submitter interacts with a signing form.Field Events
Submission Events
Triggered when the overall submission (containing one or more submitters) changes state.Template Events
Event Payloads
Every webhook delivery is an HTTP POST withContent-Type: application/json. The top-level structure is always:
Form Event Payload
All form events (form.created, form.started, form.viewed, form.completed, form.declined, form.expired) share this structure:
For
form.declined events, the declined_at field will contain a timestamp and completed_at will be null. For form.expired events, both completed_at and declined_at will be null.Submission Event Payload
Submission events include the full list of submitters and their statuses:metadata echoes the caller-provided submission metadata. Keys reserved for
DocuTrust internals, currently flattening_failed, are omitted. Submitter metadata remains
excluded; use each submitter’s external_id for caller-owned correlation.
Document download URLs in payloads
Thesubmission.completed and form.completed webhook payloads include a documents array with download URLs, so you can retrieve signed PDFs directly from the event without a follow-up API call:
download_url requires authentication (Bearer token or X-Auth-Token with submissions:read scope).
Template Event Payload
Template events include metadata about the template’s structure:Field Updated Payload
Fired each time a submitter changes a field value. Includes the old and new values for change tracking:Webhook Headers
Every webhook delivery includes the following HTTP headers:HMAC Signature Verification
Every webhook includes anX-Webhook-Signature header containing an HMAC-SHA256 digest of the raw request body, signed with your webhook secret key:
Managing Webhooks via API
Create a Webhook Endpoint
Update a Webhook Endpoint
List All Webhook Endpoints
Delete a Webhook Endpoint
204 No Content on success.
Webhook Delivery Log
Retrieve the delivery history for a specific webhook endpoint. Each entry includes the HTTP status code, response time, payload, and any error details.
Response:
Redelivering a failed webhook
If a delivery failed or was exhausted, you can trigger a redeliver:delivery_uuid.
Test a Webhook Endpoint
Send a test delivery to verify your endpoint is working correctly.Retry Policy
If your endpoint does not return an HTTP2xx response, DocuTrust retries the delivery up to 5 times with increasing delays:
After 5 failed attempts, the delivery is marked as permanently failed. You can view failed deliveries in the webhook logs section of your account settings.
Timeout thresholds:
- Connect timeout: 5 seconds. If DocuTrust cannot establish a TCP connection within 5 seconds, the attempt fails.
- Read timeout: 10 seconds. If your server does not send a complete response within 10 seconds of connection, the attempt fails.
X-Webhook-Delivery-Id, so you can use it to deduplicate deliveries on your end.
SSRF Protection
DocuTrust validates all webhook URLs before delivering events. The following restrictions apply to protect against Server-Side Request Forgery (SSRF) attacks: Blocked IP ranges:
Additional restrictions:
- HTTPS required in production. HTTP URLs are only accepted in development/test environments.
- Localhost blocked. URLs containing
localhost,127.0.0.1, or[::1]are rejected. - Cloud metadata endpoints blocked. URLs targeting
169.254.169.254and similar metadata service IPs are rejected.
Best Practices
Verify signatures on every request
Verify signatures on every request
Always validate the
X-Webhook-Signature header before processing any webhook payload. Never skip verification, even in development.Use the delivery ID for deduplication
Use the delivery ID for deduplication
Store the
X-Webhook-Delivery-Id header value and check for duplicates before processing. Retries will send the same delivery ID.Respond quickly, process asynchronously
Respond quickly, process asynchronously
Return a
200 status immediately and enqueue the payload for background processing. Long-running synchronous handlers risk timeouts and unnecessary retries.Handle events idempotently
Handle events idempotently
Your webhook handler may receive the same event more than once due to retries. Design your processing logic to be safe for repeated execution.
Subscribe only to events you need
Subscribe only to events you need
Selecting specific events reduces traffic to your endpoint and simplifies your handler logic. You can always add more events later.
Monitor your endpoint health
Monitor your endpoint health
Set up alerting for elevated error rates or slow response times on your webhook handler. DocuTrust will stop retrying after 5 failures.