Number sessions
A session is one WhatsApp number in the workspace and its connection state.
List sessions#
curl https://mcp.wagent.sh/v1/sessions \
-H "Authorization: Bearer wg_live_…"Each session has id, phone_number, state, status, sync_progress, external_ref (your user reference for numbers connected through the widget) and connected_at.
The six states#
| state | Meaning |
|---|---|
not_started | The number is added but linking has not begun. |
starting | Linking is starting. |
qr | Waiting for the owner to scan the QR code or enter the code. |
authorized | Connected and working. |
error | Linking failed, the number is in use elsewhere, or it was banned. |
sync_error | Connected, but chat sync failed. |
status is the plain summary: connected, syncing, logged_out, banned or not_yet (never linked).
Session events#
session.state(channel family): every state change, withfromandto.session.syncingandsession.banned(channel family).session.connectedandsession.logged_out(users family): the number signed in or out.