Webhooks
Signed, at-least-once events for changes in your organization.
An event names what happened to which resource; fetch the resource's current state through the API. Payloads never carry entity bodies.
Delivery
| Property | Behaviour |
|---|---|
| At-least-once | An event can arrive more than once. Dedupe on the event id; answer duplicates with 2xx. |
| Unordered | Events can arrive out of order. Fetch the resource; don't rebuild state from event order. |
| Timeout | Answer 2xx within 10 seconds; acknowledge first, process later. A timeout is a failure. Bridge reads at most 64 KiB of your response. |
| Retries | A non-2xx or a timeout is retried, with jitter, 2m, 10m, 30m, 1h, 3h, 8h and 11h after the failed attempt: 8 attempts over about 24 hours. Then the delivery is DEAD. |
| Auto-disable | After 3 consecutive dead deliveries the endpoint is DISABLED with a reason. Its queued deliveries are cancelled, and events are not held while it is disabled. |
| Re-enable | Only a PATCH that changes url re-enables an endpoint, and it re-runs the handshake. A PATCH with the same url does neither. |
| Deleted endpoint | Its queued deliveries are cancelled. |
| Suspended or revoked API client | Its endpoints get nothing, and their queued deliveries are cancelled (lastError cancelled: api client inactive). Nothing is held for reactivation. The endpoint's status doesn't change. |
| Terminated organization | For 90 days it is read-only and its events are still delivered. After that, its events and those of the organizations below it reach no endpoint, and queued ones are cancelled (lastError cancelled: organization out of reach). The same holds for a deactivated or deleted organization. A parent organization's endpoint keeps hearing the rest of its subtree. |
GET /organizations/{organizationId}/webhooks/{webhookId}/deliveries is the delivery log:
one row per event and endpoint (not per attempt), with status (PENDING, DELIVERED,
DEAD), attempts, lastStatusCode, lastError, the exact payload and
deliveredAt. A cancelled delivery is DEAD with a lastError starting cancelled: and
no lastStatusCode.
Event payload
{
"id": "9a3f6d0e-8c2b-4d51-b1a7-2f4e5d6c7b8a",
"type": "reconciliation.created",
"occurredAt": "2026-08-20T12:34:56.789Z",
"data": {
"resourceType": "reconciliation",
"resourceId": "c2d3e4f5-…",
"companyId": "b1c2d3e4-…",
"organizationId": "a0b1c2d3-…"
}
}
data.companyIdis there when the resource belongs to a company. Use it to build the resource's URL, e.g.GET /v1/companies/{companyId}/reconciliations/{reconciliationGroupId}withresourceId. Treat it as optional: older events lack it.- Subscribe to chosen types at registration, or to all with an empty filter. An all-events
endpoint also receives its own
webhook_endpoint.*events. - New event types may appear. Ignore types you don't know.
What raises an event
Writes through /v1 by an API client (companies, access policies, webhook endpoints,
documents, reconciliation groups, imports and corrections) and the jobs they start.
Facts Accountflow records, whoever caused them (the app, its users, automation, runs,
ERP and bank fetches, the task service), announced a few seconds later. Each fact is
announced once; a re-delivered one keeps its id.
Nothing else raises an event:
reconciliation.createdmeans a group was created withPOST …/bank/reconciliations. A match made by the matcher or in the app raises no event; its run raisesreconciliation_run.completed.- No settings write raises an event: company settings and automation, account settings, mappings, the account template, contacts, routines, intercompany links.
- Comments, flags, settlements, reconciliation adjustments, accrual-suggestion decisions and work-queue state raise none.
- Controls (the second sign-off) and VAT, payroll and asset approvals raise no
approval.*event. A task's freshness, assignment and due-date changes raise notask.changed. - Facts recorded before Bridge began reading their source, or before your endpoint existed, are not sent.
To follow anything else, read it on a schedule.
Event catalog
Events up to job.failed come from writes through /v1; the rest from facts Accountflow
records. companyId "yes" means data.companyId is set.
| Type | resourceType |
companyId |
When |
|---|---|---|---|
company. |
company |
yes | POST / |
company. |
company |
yes | PATCH / |
company. |
company |
yes | POST / |
company. |
company |
yes | POST / |
company. |
company |
yes | DELETE / (soft delete) |
company. |
company |
yes | POST / |
access_ |
access_ |
— | A policy was created. |
access_ |
access_ |
— | A policy or its rules changed. |
access_ |
access_ |
— | POST …/ |
access_ |
access_ |
— | A user was assigned the policy. |
access_ |
access_ |
— | An assignment was revoked. |
document. |
document |
yes | POST / |
document. |
document |
yes | PATCH / |
document. |
document |
yes | DELETE / |
document. |
document |
yes | POST / |
reconciliation. |
reconciliation |
yes | POST / |
reconciliation. |
reconciliation |
yes | DELETE / |
webhook_ |
webhook_ |
— | An endpoint was registered. |
webhook_ |
webhook_ |
— | An endpoint was patched. |
webhook_ |
webhook_ |
— | An endpoint was deleted. |
webhook_ |
webhook_ |
— | POST …/ |
import. |
company |
yes | An import was accepted (202). The resource is the company; list its imports with GET /. The outcome is job. or job. for the import's jobId. |
correction. |
company |
yes | A deletion was accepted (202). As import.. |
ledger. |
company |
yes | POST / created the year's Api ledger. Its current says whether it became current; list with GET /. |
job. |
job |
— | A job succeeded. GET / names the import it ran (resource). |
job. |
job |
— | A job failed, including an import settled as FAILED because its job expired or crashed. |
reconciliation_ |
reconciliation_ |
yes | A run ended SUCCEEDED or SKIPPED: scheduled, ordered in the app, or ordered with POST …/. Read it at GET / (runId is resourceId). Each period it approves raises its own approval. a moment later. |
reconciliation_ |
reconciliation_ |
yes | A run ended FAILED: it failed, core refused it, or a run ordered here was not delivered (not_) or not started within two hours (not_). One terminal event per run, the first end seen. Rarely, a not_ run is run later and reads SUCCEEDED; act on what the run says. |
erp_ |
erp_ |
yes | An ERP fetch finished, whoever ordered it, including an API import that changed a ledger. resourceId is the fetch's correlationId. Read GET /. |
erp_ |
erp_ |
yes | An ERP fetch failed. recentFailures in data freshness names it. |
import. |
company or organization |
yes, except organization imports | An import made in the app finished: an import-center dataset, a trial balance, a migration from Accountflow 1.x (one event per dataset), or an organization import (companies, users). An API import raises job. instead. Read GET /. |
import. |
company or organization |
as above | Such an import failed. |
bank_ |
company |
yes | The company's bank accounts were read. Read GET / and the transactions. |
bank_ |
company |
yes | The bank could not be read. |
approval. |
approval |
yes | An account period was approved: by a person, an approval policy, automation or a 1.x migration. resourceId is the approvalId. Read GET / or the account's reconciliation (approval.). |
approval. |
approval |
yes | An approval was revoked. |
task. |
task |
yes | A task's status or evidence changed. Read GET / (taskId is resourceId). |
Registration handshake
A new endpoint, or one whose url changed, is PENDING_VERIFICATION. Bridge POSTs a
signed webhook.verification event (not a type you subscribe to):
{ "type": "webhook.verification", "data": { "challenge": "f1ac40a6c8e44f5b9e2d7a31b0c65d18" } }
Answer 2xx with the lowercase hex HMAC-SHA256(secret, challenge) anywhere in the body,
keyed with the whole whsec_… secret. Echoing the challenge is not enough. Suggested:
{ "challengeResponse": "2aacbbe8c5fcbb8b1428b009fa873d65e747b56eab9fb0c432c152c4604aae20" }
That is the answer for secret whsec_testsecret and the challenge above. The endpoint then
turns ACTIVE.
import hashlib, hmac, json
def answer_challenge(body: bytes, secret: str) -> bytes:
challenge = json.loads(body)["data"]["challenge"]
digest = hmac.new(secret.encode(), challenge.encode(), hashlib.sha256).hexdigest()
return json.dumps({"challengeResponse": digest}).encode()
Signature verification
Every delivery carries:
Webhook-Signature: t=<unix-seconds>,v1=<hex-hmac-sha256>
v1 is the hex HMAC-SHA256(secret, "<t>" + "." + <raw request body>). The secret
(whsec_…) is shown once, when you create the endpoint or rotate the secret.
- Parse
tandv1. - Reject if
|now − t|exceeds your tolerance (5 minutes is a good default). - Compute the HMAC over the raw body bytes, before any JSON parsing, and compare to
v1in constant time.
Test vector
| Field | Value |
|---|---|
| secret | whsec_ |
| t | 1700000000 |
| body | {"id":"evt_ |
| signature | t=1700000000,v1=c9be8761917e51cda36abc9ae6eaa0d6cb5c4a0874f22dd6efb6c3655b6ff018 |
import hmac, hashlib, time
def verify(header: str, body: bytes, secret: str, tolerance_s: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t, v1 = int(parts["t"]), parts["v1"]
if abs(time.time() - t) > tolerance_s:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, v1)
Endpoint requirements
httpsonly, in every environment, the sandbox included. For local testing, put a public https tunnel in front of your receiver.- The host must resolve only to public addresses. Loopback, private, link-local and unique-local IPv6 addresses are refused at registration and on every delivery, checked against the addresses Bridge actually connects to.
- Redirects are not followed: a 3xx is a failed delivery.