Webhooks at a glance
The Talonic webhook contract on one page: HMAC-SHA256 signing, up to 4 delivery attempts, idempotent handling by delivery ID, event names, and the event feed.
Webhooks let Talonic tell your server the moment something finishes, instead of your code polling for it. Each delivery is an HTTPS POST with a JSON body, signed with your secret, retried on failure, and carrying a delivery ID you use to handle repeats safely. This page summarises the contract for developers wiring Talonic into their own systems; the linked pages carry the detail.
Subscribe
Create a webhook configuration with POST /v1/webhooks (the events:write scope, or legacy write), naming the URL and the events you want. For a single extraction you can instead pass webhook_url on POST /v1/extract. URLs must be publicly reachable HTTPS: localhost and private network addresses are refused at delivery time. See Create a webhook configuration.
Event names
Event names are dotted, stable strings. The ones most integrations use:
document.extracted,extraction.complete,extraction.failed: a document was read and its fields are available, or extraction failed.run.completed,run.failed,run.cancelled: a Spec run fromPOST /v1/runorPOST /v1/pipelinesfinished, failed or was stopped.run.completedcarriesrecords[].process.completed,process.failed: a processing run fromPOST /v1/processfinished or failed.review.approved,delivery.sent,delivery.failed: a record was approved, or an outbound delivery succeeded or failed.app.run.completed,app.review.raised,app.review.resolved,app.action.execute: App runs, reviews and actions.
The full list, with payloads, is on Webhook events; the machine-readable catalog is GET /v1/delivery/catalog/signals.
Signing
When the configuration has a signing secret, every delivery carries X-Talonic-Signature: sha256=<hex>, the HMAC-SHA256 of the raw request body keyed with that secret. Recompute it over the exact bytes you received, before parsing the JSON, and compare in constant time. Other headers: X-Talonic-Event (the event name), X-Talonic-Delivery (the delivery ID), User-Agent: Talonic-Webhooks/1.0. See Webhook security for sample values to test against.
Node — verify, acknowledge, then process
import crypto from 'node:crypto';
import express from 'express';
const app = express();
const seen = new Set<string>(); // use a persistent store in production
app.post('/webhooks/talonic', express.raw({ type: 'application/json' }), (req, res) => {
const header = req.get('X-Talonic-Signature') ?? '';
const expected = crypto.createHmac('sha256', process.env.TALONIC_WEBHOOK_SECRET!)
.update(req.body).digest();
const received = Buffer.from(header.replace(/^sha256=/, ''), 'hex');
if (received.length !== expected.length || !crypto.timingSafeEqual(received, expected)) {
return res.status(401).end();
}
const deliveryId = req.get('X-Talonic-Delivery')!;
res.status(200).end(); // acknowledge within 30 seconds
if (seen.has(deliveryId)) return; // a retry of a delivery you already handled
seen.add(deliveryId);
const event = JSON.parse(req.body.toString('utf8'));
// enqueue event.event + event.data for your own processing
});Retries and idempotent handling
A delivery succeeds when your endpoint answers 2xx within 30 seconds. Otherwise Talonic tries again, up to 4 attempts in total, roughly 2, 4 and 8 seconds apart. Redirects count as failures and are not followed. Every attempt of the same delivery carries the same X-Talonic-Delivery ID, so store the IDs you have handled and skip repeats. Acknowledge first and do the work afterwards, so slow processing never turns into a duplicate delivery. See Webhook retry policy.
Recovering missed events
The retry window is short, but events are not lost when deliveries are. GET /v1/events lists the same events newest first, filterable by event_type and since; pass after with the last ID you processed to read forward from there, and resume from next_cursor. Sweep it on a schedule to close any gap left by downtime. See Event feed.