Skip to main content

user.deactivated

A user was deactivated (is_active flipped to False) or suspended via the admin user management endpoints.

Category: User Lifecycle

Emitted when: After the Better Auth is_active flip commits. Platform-tier users (super_admin / admin) are excluded; agency-tier users fire one event scoped to their owning media_agency.

Envelope

Every delivery wraps the event-specific data block in the canonical envelope documented on the webhook overview page. The body carries SIX keys; the HMAC signature is delivered as the X-Webhook-Signature request header on the inbound POST to your endpoint (NOT as a body field; including it in the body would make the HMAC a function of its own output).

FieldTypeDescription
event_idstringULID; globally unique. Safe to persist as the dedup key.
event_typestringAlways user.deactivated for this event.
api_versionstringPayload schema version (YYYY-MM-DD).
timestampintegerUnix epoch seconds at dispatch time.
noncestringULID; unique per delivery, used for replay rejection.
dataobjectEvent-specific payload (see below).

Delivery also sets three HTTP headers on the inbound POST:

HeaderMeaning
X-Webhook-Event-IdMirrors event_id; cheaper than parsing the body to dedup.
X-Webhook-TimestampMirrors timestamp for replay-window checks.
X-Webhook-Signaturesha256=<hex> HMAC over timestamp.body.

Data schema

FieldTypeRequiredDescription
agency_idstringyesAgency Id
user_idstringyesUser Id
emailstringyesEmail address at deactivation time
role"media_agency" | "team" | "broker" | "agent" | "assistant" | "viewer"yesRole
deactivated_atstringyesDeactivated At
deactivated_bystringyesActor token: 'user:' for dashboard admin action, 'admin:' for reserved admin-tool/background paths.
reasonstring | nullnoFree-form reason from the admin dashboard form; None when no reason was captured.

Sample payload

The sample below is a live fixture. Feed the exact body bytes shown plus the timestamp into the HMAC-SHA256 recipe from the webhook overview using the documented test-vector secret (test_secret_001 ) and you will recover the signature header value printed below.

Body (delivered as the HTTP request body):

{
"event_id": "evt_62DB39V491PW9N63XM6WVERM4K",
"event_type": "user.deactivated",
"api_version": "2026-04-17",
"timestamp": 1745339401,
"nonce": "2QQSRP51BG3F4D2YR5HV1QVTM3",
"data": {
"agency_id": "user_01HXAGENCY0000000000000",
"user_id": "user_01HXAGENCYUSER000000000",
"email": "user@example.com",
"role": "agent",
"deactivated_at": "2026-05-29T12:00:00Z",
"deactivated_by": "apikey:key_01HXAPIKEY000000000000",
"reason": "agency_request"
}
}

Signature header (delivered as X-Webhook-Signature on the same request):

sha256=a7c32f8a794006e1860a5d39b9eb6b8e782e64c4f882b9b5d6ea21628ed164c6

Retry behaviour

Failed deliveries retry on the sequence 2, 4, 8, 16, 32 seconds (five attempts plus the initial call for a total of six over approximately 62 seconds of wall clock). After the final attempt the delivery lands in the dead-letter queue and the dashboard operator can replay it from Settings > API Keys > Webhook Endpoint > Deliveries. See the webhook overview for the full rules.

Verification

Every receiver MUST verify the X-Webhook-Signature header using the recipe in the webhook overview. Rejecting deliveries whose timestamp is more than 5 minutes off your wall clock (after NTP correction on your side) or whose nonce has already been consumed in the last 10 minutes is part of the contract.