Events
Wireevent / X-Documate-Event values are dotted machine keys only. Title Case names in the app UI are labels, not the wire contract.
Set up which events to send, and webhook vs email vs in-app, in Events and notifications.
Statuses in the payload use snake enum keys (
ready, failed, …). Sync extract / api_sync intake does not send webhooks. Polling the partner API also does not emit webhooks.
Headers
When a shared secret is configured, verify
X-Documate-Signature. Do not use X-Documate-Test for authentication.
Shared secret
You store the plaintext webhook secret on your side for HMAC verification. Documate stores the secret Data-Protected at rest and unprotects it only when signing a delivery.Body
Webhook JSON uses snake_case fields such asevent, event_id, queue_id, file_id, document_id, status, data, error, and occurred_at.
Example document.ready (placeholders only). Top-level url is the document PDF. Document events omit original_file for every source, including email.
document.ready uses the same shape. source is email, and original_file is still absent. The uploaded pack is only on file.received and file.completed.
The first run uses document:{documentId}:ready (or :failed). Each document reset appends :r1, :r2, and so on, for example document:{documentId}:ready:r1. Handle that as a new delivery of document.ready or document.failed for that document only. A document reset does not repeat other documents on the file and does not send file.completed.
A file reset sends document.ready or document.failed for each new document. file.completed stays file:{fileId}:completed and is not sent again after a successful delivery. See Reset.
Get the original file after file.received
Use this sequence when a partner system (for example ERP intake) needs the uploaded blob.
1
Receive the webhook
Documate POSTs JSON to your HTTPS endpoint.
X-Documate-Event is file.received. The body includes file_id, queue_id, source, and original_file metadata — not the file bytes.2
Verify the signature
When a shared secret is configured, verify
X-Documate-Signature over the raw body bytes. See API webhooks.3
Download the blob
Prefer
original_file.url when it is present and not past original_file.url_expires_at (S3-style signed URLs work without an API key). If the URL is missing or expired, call authenticated External content:GET /api/v1/files/{fileId}/content with your API key (X-Api-Key or Authorization: ApiKey …).That endpoint returns the original file bytes. For the document PDF, call GET /api/v1/documents/{documentId}/content only after the document is ready and its PDF is stored. That call reads the stored document PDF. Until then it responds with 409.file.received shape (placeholders):
When url may be omitted or not directly fetchable
- Refresh can fail or storage may not yet have a key —
original_file.urlcan be null; useGET …/files/{fileId}/contentwith an API key. - On some environments the payload URL points at Documate’s own content route (
…/api/v1/files/{fileId}/content). That still requires an API key (it is not an anonymous signed S3 URL). - On document events (
document.ready/failed/cancelled), the document PDF is top-levelurl(orGET /api/v1/documents/{documentId}/contentwhen that document is ready and its PDF is stored). These events omitoriginal_file. When the file is one document covering every page, that PDF’s bytes may equal the upload. The URL is still the document URL. - When a document link is missing, expired, or cannot be fetched, fall back to
GET /api/v1/documents/{documentId}/content, neverGET /api/v1/files/{fileId}/content. The file route returns the whole uploaded pack. - On
file.completed, the top-levelurlis the original uploaded file. Per-document PDFs are indocuments[].url. - Links are minted fresh on every delivery attempt, including retries. If Documate cannot build a public link,
urlis omitted rather than sent unusable.