Auth Webhooks
Auth events, in your systems
Subscribe to sign-ups, sign-outs, bans and organization changes to sync your own database, kick off onboarding, or write an audit trail. Configure endpoints under Webhooks in the dashboard; auth events appear as the Authentication and Organizations categories.
The events
| Category | Types |
|---|---|
| Authentication | user.created · user.updated · user.deleted · user.banned · user.unbanned · session.created · session.revoked |
| Organizations | organization.created · organization.updated · organization.deleted · organization.membership.created · organization.membership.updated · organization.membership.deleted |
When user.updated and user.deleted fire
On user.updated, data.source says why and data.changed lists what changed. On user.deleted, data.reason says why.
user.updated: a password set or changed (password_setfor a first password,password_reset,password_change), a second factor turned on or a confirmed one removed (mfa_enabled,mfa_removed), a passkey added or removed (passkey_added,passkey_removed), an existing account verifying an email address or phone number for the first time (identifier_verified), a provider supplying the name of an account that had none (oauth_profile), a directory update through SCIM, including an email address change on its own (scim), and a directory reactivating a person it had deprovisioned (scim_reactivated, withdata.changed["active"]).user.deleted: the person deleting their account in your app (data.reasonself_service), an erasure request (data_erasure_request), and SCIM deprovisioning (scim_deprovision). Delete your own copy of the person when you receive it. Their active Journeys stop at the same time. After an in-app deletion or an erasure request they are never enrolled in a new one. A directory can reactivate a deprovisioned person, so deprovisioning does not block later Journeys, and reactivating them does not restart the ones it stopped. A reactivation sendsuser.updated(scim_reactivated): treat it as an upsert, since you were told the person was deleted.- Deleting an account in your app or by an erasure request also ends every organization membership the person held. Each arrives as
organization.membership.deletedwithdata.account_deleted: trueand the samedata.reason, alongside theuser.deleted. SCIM deprovisioning ends only the memberships the directory granted, announced as a directory removal (below); a membership you granted by hand stays. - Directory sync (SCIM) announces the memberships it creates and ends too, as
organization.membership.createdandorganization.membership.deletedwithdata.via: "directory". A member who already belonged and only gains a directory role is not a new membership. - For an erasure request, BillDog keeps no record naming the person afterwards, including the delivery record of these notices. They are sent immediately (the dispatch's three quick attempts) and never retried later: if your endpoint is down at that moment, reconcile from the erasure you requested.
- These account events are queued rather than sent inside the request that caused them: the
user.updatedof a password, second-factor, passkey, verification or provider-name change, theuser.deletedof an in-app deletion, every organization and membership event (except an erasure's notices, above), and theuser.created,user.updatedanduser.deletedof a directory (SCIM) sync. They reach your endpoint within about a minute and are retried on the schedule below. - An endpoint receives its queued events one at a time, oldest first. A retry can still arrive after a later event (the later one did not have to wait), so order by
occurred_atin the payload, not by arrival. - Every delivery carries an
X-BillDog-Event-IDthat stays the same across its retries. For a new organization, a deleted organization, a new membership, a membership a deletion or directory sync ended, a user the directory created, an in-app account deletion and a passkey removal, the id is derived from the change itself, so the same change reported twice (an invitation accepted while a directory sync adds the same person, two directory requests describing one join) is delivered once. Other events get a new id each time they are raised: deduplicate those on the event id and treat a repeat as a repeat.
The payload
{
"type": "user.created",
"environment": "production",
"occurred_at": "2026-08-30T12:00:00.000Z",
"user_id": "…",
"organization_id": null,
"data": { }
}The environment is in the payload as well as on the envelope, so a reader never has to infer it from which endpoint received the call. user_id is unhashed on purpose — you need to join on it.
What these payloads never contain
user.created carries the identifier the person signed up with, because that is the point of the event — it carries nothing that would let a receiver become them.Verifying a delivery
Every request carries X-BillDog-Signature and X-BillDog-Timestamp. The signature is HMAC-SHA256 over {timestamp}.{body} with your endpoint's secret — the timestamp is inside the signed material specifically so a captured delivery cannot be replayed forever.
import crypto from 'node:crypto';
function verify(rawBody, headers, secret) {
const timestamp = headers['x-billdog-timestamp'];
const expected = crypto
.createHmac('sha256', secret)
.update(timestamp + '.' + rawBody)
.digest('hex');
// Constant-time, and reject anything older than a few minutes.
const ok = crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(headers['x-billdog-signature']),
);
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
return ok && fresh;
}Verify against the raw body, before any JSON parsing — re-serialising changes bytes and the signature will not match.
Rotating the secret: for 24 hours after you regenerate it, deliveries are signed with both secrets. X-BillDog-Signature carries only the new one; the webhook-signature header lists both as v1,<hex> v1,<hex> (same HMAC as above). A server that has not switched yet should accept the delivery if any listed signature matches its secret.
Delivery, retries and auto-disable
- 2xx and 3xx are success. 4xx is a permanent failure and is not retried — your endpoint said the request was wrong, and repeating it will not change that. 5xx and network errors are transient and are retried.
- Delivery is retried in two stages, up to 8 attempts over about 2.5 hours: three immediate attempts in the dispatch itself, then five asynchronous retries at 5, 10, 20, 40 and 80 minutes. The timeout is 10 seconds. A queued event (above) has no immediate attempts: its first delivery comes within a minute, the next two about a minute apart, then 5, 10, 20, 40 and 80 minutes, eight attempts in about 2.6 hours.
X-BillDog-Retry-Attemptis present only on an automatic retry; a delivery you replay from the dead-letter list arrives without it, so recognise a repeat byX-BillDog-Event-ID. - Only an active endpoint is delivered to. An event waiting for delivery or a retry when its endpoint is paused or disabled is not sent.
- An endpoint failing ten consecutive times is disabled automatically, and must be re-enabled in the dashboard. The project owner is emailed when that happens, but alert on your own 5xx rate too — it tells you before the tenth failure.
A webhook can never fail a sign-in
Practical advice
- Be idempotent. A retry after your handler already succeeded but timed out is normal.
- Answer fast, work later. Acknowledge with a 2xx and queue; slow handlers turn into retries.
- Check
environmentbefore acting, especially if one endpoint receives both. - Do not treat
session.createdas a login count — a refresh does not create one, but a new device does.
Was this page helpful?
Or rate this page: