Receiving Webhooks
A webhook receiver is one HTTP route. Budget Thing POSTs a JSON body to it,
signs the request, and treats any 2xx answer as success.
This page describes the request and the guarantees around it. The signature itself is covered in Verifying Webhook Signatures, and you should implement both before you trust a payload.
The request
Every delivery is:
POST /your/webhook/path HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: BudgetThing-Webhooks/1.0
BudgetThing-Webhook-Id: whd_4Bn8Rk2Xm7Qd5Vz1Lp9Wsk
BudgetThing-Webhook-Timestamp: 1789499532
BudgetThing-Webhook-Signature: v1=3f0b2c9d7e5a1846bd4c0f7a2e9b6d13c8a5f2e4b7d90c1a6f3e8b5d2c7a4091
BudgetThing-Webhook-Event: transaction.created
BudgetThing-Webhook-Event-Id: evt_6Hn2Kq9Xd4Rb7Mz3Wt1Vpf
BudgetThing-Webhook-Api-Version: 2026-09-01
| Header | What it carries |
|---|---|
BudgetThing-Webhook-Id | The delivery id (whd_…). One attempt series to one endpoint. |
BudgetThing-Webhook-Timestamp | When the delivery was signed, as Unix seconds. Part of the signed message. |
BudgetThing-Webhook-Signature | One or more v1=<hex> signatures, separated by spaces. |
BudgetThing-Webhook-Event | The event type, for example transaction.created. |
BudgetThing-Webhook-Event-Id | The application event id (evt_…), the same value as id in the body. |
BudgetThing-Webhook-Api-Version | The payload contract version, currently 2026-09-01. |
Each attempt is given 10 seconds in total — connection, request and response. A slower answer is recorded as a timeout and retried.
Delivery id and event id are different things
This distinction matters more than any other header:
| Delivery id | Event id | |
|---|---|---|
| Header | BudgetThing-Webhook-Id | BudgetThing-Webhook-Event-Id |
| Prefix | whd_ | evt_ |
| Identifies | One delivery to one endpoint | One thing that happened in the workspace |
| Changes on a retry | No — retries reuse the delivery | No |
| Changes on a redelivery | Yes — a new delivery record is created | No |
| Differs per endpoint | Yes | No |
So the event id is the stable, logical identity of the change: two endpoints receive the same event id, and a manual redelivery months later still carries it. Deduplicate your business logic on the event id. Use the delivery id to identify the individual HTTP delivery — in logs, when matching a row in the delivery history, or to drop a retry of a delivery you have already answered.
The event envelope
Every payload, whatever the event type, has the same outer shape:
{
"id": "evt_6Hn2Kq9Xd4Rb7Mz3Wt1Vpf",
"type": "transaction.created",
"api_version": "2026-09-01",
"created_at": "2026-09-15T18:32:12.123Z",
"workspace_id": "wks_3fQ0mZk8Xr2Lp9Va6Ne1Ty",
"actor": {
"type": "user",
"id": "usr_7Hn4Wc2Qd8Rk1Ub5Jm3Zx"
},
"object": {
"type": "transaction",
"id": "txn_5Kd9Pw3Mb7Rq2Nx8Hj4Zt"
},
"data": {
"transaction": {
"id": "txn_5Kd9Pw3Mb7Rq2Nx8Hj4Zt",
"kind": "expense",
"account_id": "acct_8Vb2Nq6Xz1Wm4Kd7Rj9Lt",
"payee_id": "vnd_2Rt7Km4Xb9Nz3Wq6Hd1Lp",
"amount_minor": 425000,
"transaction_date": "2026-09-15",
"memo": "January invoice",
"is_cleared": false,
"is_reconciled": false,
"splits": [
{
"id": "spl_2Kd7Pw4Mb9Rq3Nx6Hj1Zt",
"category_id": "cat_5Hn8Kq2Xd7Rb4Mz9Wt3Vp",
"category_name": "Utilities",
"amount_minor": 425000
}
],
"tags": [],
"journal_entry_id": "jrn_7Wq4Jm1Xn8Rd5Vz2Kp6Bh"
}
}
}
| Field | Always present | What it holds |
|---|---|---|
id | yes | The stable application event id. The deduplication key. |
type | yes | The event type. A stable contract value, never localized. |
api_version | yes | The version of the payload contract the event was produced under. |
created_at | yes | When the change occurred, RFC 3339 in UTC. Use it to order events. |
workspace_id | yes | The workspace that produced the event. |
actor | yes | Who caused it: {"type": "user" | "system" | "integration", "id": "…"}. id is absent for a system actor. |
object | yes | The primary resource: {"type": "transaction", "id": "txn_…"}. id is absent for an event that is not about a single resource. |
data | yes | The event-specific payload. Its shape depends on type. |
correlation_id | no | Groups every event produced by one logical operation. |
causation_id | no | The event that caused this one, when applicable. |
correlation_id and causation_id are omitted when there is nothing to
report, like every other optional field on the wire — read defensively rather
than expecting null.
One action often produces several events. Where Budget Thing can tell that a
set of events came from the same logical operation, it stamps them with the
same correlation_id; where one event was caused by another, causation_id
names the earlier event. Both are hints for grouping activity in your own
system, and both are optional — never require them.
Inside data
data carries a snapshot of the resource as it stood when the event
happened, keyed by the resource name — transaction above. A snapshot is not a
reference: a transaction.deleted event still describes the transaction in
full, because the row is gone by the time you read it, and a redelivered event
describes the resource as it was, not as it is now.
Snapshots hold stored values only. Dates are YYYY-MM-DD, and computed
display values such as formatted amounts, payee labels or running balances are
deliberately absent — read them from the API when you need them.
Amounts in events
Every amount in an event (any field ending in _minor, such as
amount_minor, expected_amount_minor or ending_balance_minor) is an
integer at a fixed scale of 4: ten-thousandths of a currency unit,
whatever the workspace's currency or currencyPrecision. Divide by 10,000 to
get currency units: the $42.50 expense above arrives as 425000.
const amount = envelope.data.transaction.amount_minor / 10000; // 42.5
REST responses scale amounts to the workspace: amountMinor and
Money.minor follow the workspace's currencyPrecision, so the same $42.50
is 4250 from GET .../transactions in a two-decimal workspace (see
Amounts and dates). Events don't,
because they are durable records: a workspace can change its precision later,
and a fixed scale means a past event reads the same way no matter when you
process it. Don't reuse REST amount handling for event payloads.
The rule is the same for webhooks, the event history and the event stream, which all carry the same envelope.
Update events additionally carry changes, with one entry per field that
actually moved:
{
"type": "transaction.updated",
"data": {
"transaction": {"id": "txn_5Kd9Pw3Mb7Rq2Nx8Hj4Zt", "amount_minor": 510000},
"changes": {
"amount_minor": {"old": 425000, "new": 510000},
"memo": {"old": "January invoice", "new": "January invoice (revised)"}
}
}
}
A field that did not change is absent from changes, so you can react to a
re-priced transaction without diffing two snapshots yourself.
What to respond
Any 2xx status means Budget Thing considers the delivery successful — 200
and 204 are both fine, and the response body is ignored (only the first 4 KiB
is kept, for the delivery history).
A receiver should:
- read the raw body and verify the signature;
- check whether it has already processed this event id, and stop if it has;
- enqueue the event, or do the small amount of work that is genuinely fast;
- return
2xximmediately.
The attempt is abandoned after 10 seconds, and the delivery is then retried — so a slow handler turns one event into several deliveries of the same event, all of them still working. Acknowledge first, process afterwards.
Anything that is not 2xx is a failure and is retried, including 3xx:
redirects are not followed. If you must move the endpoint, register the new URL
rather than redirecting to it.
Delivery guarantees
What the delivery pipeline promises, and what it deliberately does not:
| Guarantee | What it means for your receiver |
|---|---|
| Asynchronous | Events are published when the change is committed and delivered by a background worker. The API call that caused the event does not wait for you. |
| Durable | A delivery is recorded before it is attempted, so it survives a restart and is not lost if your endpoint is down. |
| At least once | The same event may arrive more than once. Deduplicate. |
| Retried | A failure is retried with backoff, then marked failed. See Webhook Deliveries. |
| Unordered | A later event may arrive before an earlier one. |
| Concurrent | Several deliveries to the same endpoint can be in flight at once. |
At least once, never exactly once
Retries, redeliveries and network failures where your 2xx never arrived all
mean the same event can reach you twice. Make the handler idempotent:
- keep a record of processed
idvalues, and return2xxwithout re-applying anything when you see one again; - give that record a retention window longer than the retry schedule — a day or two covers the full 24-hour final retry, and longer if you also want manual redeliveries to be caught;
- if you deduplicate on the delivery id instead, you will process a manual redelivery a second time, because a redelivery is a new delivery of the same event.
Ordering is not guaranteed
Do not treat arrival order as the order things happened. A retried delivery arrives minutes or hours after later events, and concurrent delivery can reorder two events that were published a moment apart.
Order on created_at, or on the state of the resource itself:
- ignore an update whose
created_atis older than the state you have already stored; - for anything where the current value matters more than the history, read the resource back from the API on receipt and store that;
- never assume a
*.createdevent arrives before the*.updatedevent for the same resource.
Concurrency
Budget Thing may have several requests to your endpoint in flight at the same time, including two attempts for different events about the same resource. Handlers must be safe to run concurrently: guard per-resource work with a lock or a queue keyed on the resource id, and make the deduplication check atomic rather than a read followed by a write.
Security checklist
- Serve the endpoint over HTTPS, with a valid certificate.
- Keep the signing secret server-side — never in client code, never in source control.
- Verify the signature on every request, before you look at the body.
- Verify against the raw body bytes, not a re-serialized copy.
- Compare signatures in constant time.
- Reject stale timestamps — a tolerance of a few minutes is right.
- Deduplicate on the event id, and keep handlers idempotent.
- Return
2xxpromptly and do the work afterwards. - Rotate the signing secret periodically, and after any suspected exposure.
- Never log a full signing secret; log
secretPrefixand the delivery id instead. - Do not rely on the source IP address as authentication. The signature is the authentication.
Next
- Verifying Webhook Signatures — the exact algorithm, with runnable examples.
- Webhook Deliveries — retries, delivery states, tests and redelivery.
- Webhook Events — every event type and what it describes.