{"templateId":"markdown","versions":[{"version":"v1","label":"API v1","link":"/api/webhooks","default":true,"active":true,"folderId":"702acf7c"},{"version":"v0","label":"API v0 (Legacy)","link":"/api/v0/webhooks","default":false,"active":false,"folderId":"702acf7c"}],"sharedDataIds":{"sidebar":"sidebar-api/@v0/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Webhooks","llmstxt":{"hide":true}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"webhooks","__idx":0},"children":["Webhooks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wisedocs can notify your system when work finishes, so you do not need to poll the API. Each event is an HTTPS ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," with a JSON body to an endpoint you provide."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Event"},"children":["Event"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Sent when"},"children":["Sent when"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file.processed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A file finishes processing, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["case.completed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every file in an upload batch processed successfully and the case is completed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["export.completed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An export produced by an automated processing rule finishes (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETED"]},") or fails (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILED"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api/openapi"},"children":["API reference"]}," documents each event's payload and headers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up","__idx":1},"children":["Set up"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhooks are configured by Wisedocs for your workspace. Provide:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://"]}," endpoint URL on a public host. Plain ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http"]},", IP addresses in private ranges, and hosts that resolve to private addresses are rejected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The event types you want to receive. Events you do not subscribe to are not sent."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["At least one way to authenticate deliveries: an HTTP Basic credential, a signing secret, or both. Wisedocs sends no events until one is configured."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optionally, extra headers to include on every request."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-format","__idx":2},"children":["Request format"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every event shares the same envelope:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"5b8e3f40-ac6d-5e9f-b021-3c4d5e6f7081\",\n  \"type\": \"case.completed\",\n  \"createdAt\": \"2026-11-23T10:16:02Z\",\n  \"tenant\": \"acme\",\n  \"data\": {\n    \"caseUuid\": \"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d\",\n    \"lastUploadDate\": \"2026-11-23T10:02:11Z\",\n    \"batchId\": \"9ee18c53-2d4a-5b6c-8e7f-0a1b2c3d4e5f\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Timestamps are UTC with second precision and a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Z"]}," suffix. Payloads carry identifiers and statuses only: call the API to read case or file details."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each request includes these headers:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Header"},"children":["Header"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/json"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["User-Agent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Wisedocs-Webhooks/1.0"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Wisedocs-Event-Id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The event's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Wisedocs-Event-Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The event's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Wisedocs-Delivery-Attempt"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Attempt number, starting at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Basic …"]},", when an HTTP Basic credential is configured. It replaces any ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," in your extra headers."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Wisedocs-Signature"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["t=<unix seconds>,v1=<hex>"]},", when a signing secret is configured"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"verify-the-signature","__idx":3},"children":["Verify the signature"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]}," is the hex HMAC-SHA256 of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<t>.<raw request body>"]},", keyed with your signing secret. Compute it over the raw bytes you received, before parsing the JSON, and reject requests whose ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["t"]}," is more than a few minutes from your clock to block replays. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["t"]}," changes on every attempt."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import hashlib\nimport hmac\nimport time\n\ndef verify(secret: str, body: bytes, header: str, tolerance_seconds: int = 300) -> bool:\n    try:\n        fields = dict(part.split(\"=\", 1) for part in header.split(\",\"))\n        timestamp, provided = int(fields[\"t\"]), fields[\"v1\"]\n    except (KeyError, ValueError):\n        return False\n    if abs(time.time() - timestamp) > tolerance_seconds:\n        return False\n    expected = hmac.new(secret.encode(), f\"{timestamp}.\".encode() + body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, provided)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wisedocs shows the signing secret once, when it is created. When the secret is rotated, the old one stops working immediately."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"respond-and-retries","__idx":4},"children":["Respond and retries"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Respond with any ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2xx"]}," status within 10 seconds to acknowledge an event. Do slow work after responding."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Your response"},"children":["Your response"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What Wisedocs does"},"children":["What Wisedocs does"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2xx"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Delivered."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5xx"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["408"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]},", timeout, or connection error"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retries with exponential backoff, starting at 10 seconds and doubling up to 1 hour between attempts, for up to 24 hours. A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Retry-After"]}," header in seconds sets the next delay."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Any other ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4xx"]},", or a redirect (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3xx"]},")"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fails permanently. Redirects are not followed."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"handle-duplicates-and-ordering","__idx":5},"children":["Handle duplicates and ordering"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Delivery is at least once: the same event can arrive more than once, for example when your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2xx"]}," response is lost. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," is the same on every attempt and on any resend of the same occurrence, so store it and ignore events you have already processed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Events can arrive out of order when some are retried. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batchId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastUploadDate"]}," to tell upload batches apart: every ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["case.completed"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["export.completed"]}," from the same batch shares one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batchId"]},", and a later upload to the case starts a new batch."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["case.completed"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["export.completed"]}," still waiting to be retried is dropped if the case receives a newer upload in the meantime, so an older batch never arrives after a newer one has started."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"export-downloads","__idx":6},"children":["Export downloads"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["export.completed"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status: \"COMPLETED\""]}," includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["download.url"]},", a presigned link to the file, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["download.expiresAt"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["download.contentType"]},". Each attempt gets a new link, valid for two hours by default. Download the file promptly and treat the URL as a secret: anyone holding it can download the export."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Only exports that a processing rule produces automatically send this event. Exports a user starts in Wisedocs do not. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reportUuid"]}," is present when the export includes a report."]}]},"headings":[{"value":"Webhooks","id":"webhooks","depth":1},{"value":"Set up","id":"set-up","depth":2},{"value":"Request format","id":"request-format","depth":2},{"value":"Verify the signature","id":"verify-the-signature","depth":2},{"value":"Respond and retries","id":"respond-and-retries","depth":2},{"value":"Handle duplicates and ordering","id":"handle-duplicates-and-ordering","depth":2},{"value":"Export downloads","id":"export-downloads","depth":2}],"frontmatter":{"seo":{"title":"Webhooks"}},"lastModified":"2026-11-24T18:26:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api/webhooks","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}