Skip to content

Webhooks

Add an endpoint under Dashboard → Webhooks. We POST JSON to it when something you started finishes:

Event When
job.succeeded a background job (async=true) finished
job.failed a background job failed for good
batch.completed a batch finished; data.result.summary has the counts
invoice.generated an invoice was created with POST /v1/invoices/generate
delivery.succeeded · delivery.failed a routed document was delivered (with receipt) or failed for good
compliance.change a mandate or rule-set change in the register concerns formats you sent in the last 90 days and its next date is within 120 days; data has id, title, nextDate, affectedFormats, verification; once per change
quality.alert the share of failing documents in the last 24 hours rose clearly above your own level of the 7 days before (at least 20 documents, at least 20 percentage points and at least twice the earlier share); data has failureRate, baselineFailureRate, documents and topRules; at most once a day
usage.threshold 80 % or 100 % of the documents included in your plan or contract, or of a partner's limit for a customer, were used this month; data has threshold, used, quota, plan, period, afterQuota (overage or blocked) and source (plan, contract or customer_limit); a partner receiving it for a customer also gets customer
webhook.test you pressed "Send test"

Payloads carry ids, status and counts — never document content. Fetch details with the API (/v1/jobs/{id}, /v1/invoices/{id}). Test-mode and live-mode events go to the endpoints of the matching mode.

{ "type": "job.succeeded", "timestamp": "2026-11-22T16:00:00.000Z", "livemode": false,
  "data": { "id": "…", "object": "job", "type": "validate", "status": "succeeded", "statusUrl": "/v1/jobs/…",
            "result": { "status": "valid", "summary": { "errors": 0, "warnings": 0, "infos": 1 }, "invoiceId": "…" } } }

Verifying the signature

Deliveries follow Standard Webhooks: headers webhook-id, webhook-timestamp and webhook-signature: v1,<base64>, where the signature is HMAC-SHA256 over id.timestamp.body with the base64-decoded part of your whsec_… secret. Reject timestamps older than five minutes.

import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(secret, headers, rawBody) {
  const ts = Number(headers["webhook-timestamp"]);
  if (Math.abs(Date.now() / 1000 - ts) > 300) return false;
  const mac = createHmac("sha256", Buffer.from(secret.slice("whsec_".length), "base64"))
    .update(`${headers["webhook-id"]}.${ts}.`)
    .update(rawBody) // the raw body bytes (a Buffer): routed PDFs are binary
    .digest();
  return headers["webhook-signature"].split(" ").some((s) => {
    const sig = Buffer.from(s.replace(/^v1,/, ""), "base64");
    return sig.length === mac.length && timingSafeEqual(sig, mac);
  });
}

A complete receiver (verification, duplicate handling, receipt id) is in docs/examples/einv-receiver.mjs; it is tested against real deliveries.

Libraries for other languages: the Standard Webhooks SDKs work unchanged.

Retries

Answer with any 2xx within 10 seconds. Otherwise we retry after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h; after the seventh attempt the delivery is marked failed. webhook-id stays the same across retries — use it to ignore duplicates. Retries run on their own in the background worker, with no action needed; with several API replicas each attempt is claimed by one of them (row locks), so an attempt is not sent twice.

Failed deliveries and jobs

GET /v1/failures lists webhook deliveries and background jobs that failed after all automatic retries in the last 30 days (Dashboard → Failed jobs and deliveries). POST /v1/webhook-deliveries/{id}/retry sends a delivery again (POST /v1/webhook-deliveries/retry all failed ones). A failed job keeps its encrypted input for 7 days as a dead letter; POST /v1/jobs/{id}/retry runs it again within that time, afterwards the input is deleted.

Security

Endpoints must use https and resolve to a public address; the address is checked when we connect. The signing secret is stored encrypted and shown only once.