Account webhooks
Receive an event when an account is connected to a profile or stops working, and know how fast each disconnect path reaches you.
Account events tell you when an account joins a profile and when it can no longer be used. Subscribe with POST /v1/webhooks/settings and the event names below (first event); delivery, retries and signatures are the same for every event (how webhooks behave).
Events
| Event | Description |
|---|---|
account.connected | An account was connected to a profile. |
account.disconnected | A connected account stopped working or was removed. |
How it behaves
How disconnect detection works
Zernio sends account.disconnected through 4 paths, and the path decides how quickly you hear about it.
- An API removal, for example
DELETE /v1/accounts/{id}, emits immediately withdisconnectionType: "intentional". - A phone-side WhatsApp disconnect (WhatsApp Business app, Settings, Account, Business Platform, Disconnect) emits within seconds of Meta's notification, with
disconnectionType: "unintentional".reasoncarries Meta's own explanation where Meta gives one, which separates a deliberate disconnect (BUSINESS_DOWNGRADE,CHANGE_NUMBER,USER_RE_REGISTERED) from Meta dropping an idle number (PRIMARY_INACTIVITYafter about 14 days,COMPANION_INACTIVITYafter about 30), and says whether the user or Meta initiated it. - An expired or revoked grant on any platform surfaces the next time Zernio calls it: a publish or an analytics sync that gets a definitive auth error deactivates the account and emits with
disconnectionType: "unintentional". The publish path tries a token refresh first, so the event means the refresh failed too.reasoncarries the platform's own message on that path, andYour linkedin access token is no longer valid. Please reconnect your account.when the sync path found it. Reconnect the account to clear it (connecting accounts). - Everything else (a number deleted in WhatsApp Manager, a revoked grant, a channel Meta silently stops serving) is caught by a periodic reconciliation against Meta, not a notification. That path confirms across more than one probe before acting, so it lags by anywhere from minutes to about a day.
Poll liveness for WhatsApp
Meta's notifications are best-effort, so a disconnect can still fall through to the slower reconciliation path. Do not read the absence of account.disconnected as proof a channel is alive. For WhatsApp, poll the liveness check (GET /v1/whatsapp/number-info) or account health, which runs a live Meta link probe for WhatsApp accounts.
account.connected
An account was connected to a profile, through OAuth or credentials. Reconnecting an account you already hold fires it again: the connect flow upserts the row for that profile and platform, so the repeat carries the same accountId rather than a new one. Key your own upsert on accountId and expect the event more than once per account.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Webhook payload for account connected events
Response Body
Example Requests
Webhook payload for account connected events
/account.connectedaccount.disconnected
A connected account stopped working or was removed. disconnectionType is intentional for removals you made and unintentional for the rest; see how disconnect detection works for what fills reason.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Webhook payload for account disconnected events
Response Body
Example Requests
Webhook payload for account disconnected events
/account.disconnectedRelated
- Webhooks: create an endpoint, retries, signatures.
- Connecting accounts: what fires
account.connected. - Account health:
canPostandcanFetchAnalyticsper account, on demand. - Disconnect an account: the intentional path.
- WhatsApp phone numbers: the liveness check.