Skip to content
API docsOpen the app
ContentsAPI reference

API reference

Generated from the gateway's own OpenAPI 3.1 document, GET /v1/openapi.json, so it always matches the API. Every path starts at https://mcp.wagent.sh.

Errors and rate limits · Idempotency · Webhooks

Operations#

POST/v1/agents/signup#

An agent asks the owner of an email address for access, with no key. The owner gets an email and approves on the web with a WhatsApp code; the agent then claims its key once with claim_token. The answer is the same whatever happens to the email.

No keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Request body
NameTypeRequiredDescription
owner_emailstringYes
agent_namestringYes
scopesarray of one of: read, draft_reply, transcribe, send_messageNo
notestringNo
Responses202400409429503
Response 202
NameTypeRequiredDescription
statusalways "pending_owner_approval"Yes
signup_idstringYes
claim_tokenstringYes
expires_atstring (date-time)Yes
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
already_requested409This request was already made.
rate_limited429Too many requests. Retry after the time in Retry-After.
unavailable503Wagent could not complete this request, so nothing was done. Try again shortly.

GET/v1/approvals#

Items waiting for the owner in chats this agent may read, oldest first, each with its exact payload and sha256. CRM changes are not listed.

Any key
Responses200401403423429
Response 200
NameTypeRequiredDescription
items[]array of objectYes
idstringYes
kindone of: draft, approvalYes
item_typeone of: message, file, quoteYes
stateone of: pending, failedYes
chat_idstringYes
channel_idstring or nullYes
agent_idstring or nullYes
payloadstring or nullYes
sha256string or nullYes
created_atstring (date-time)Yes
expires_atstring (date-time) or nullYes
countintegerYes
Errors
CodeStatusMeaning
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.

POST/v1/approvals/{id}/approve#

Approves an item by the sha256 of its payload; the stored payload is sent exactly as shown. Needs the owner's may-approve switch for this agent; never the agent's own items or a CRM change.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
idpathstringYes
Request body
NameTypeRequiredDescription
sha256stringYes
Responses200400401403404409422423429
Response 200
NameTypeRequiredDescription
statusone of: sent, failed, unknownYes
itemobjectYes
idstringYes
statestringYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
agents_paused403Agents are paused by the workspace owner.
approvals_off403Approving through the API is off for this agent.
own_item403A key cannot approve its own agent's items.
trial_limit403This number reached its trial limit.
not_found404Not found.
not_pending409This item is no longer waiting.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.

GET/v1/chats#

The chats this agent may read, newest activity first, each with what the agent can do there. Same as the MCP list_chats tool.

Any key
Parameters
NameInTypeRequiredDescription
limitqueryintegerNo
cursorquerystringNo
qquerystringNo
Responses200400401403423429503
Response 200
NameTypeRequiredDescription
countintegerYes
next_cursorstring or nullYes
wagent_dataobjectYes
untrustedalways trueYes
notestringYes
itemsarray of objectYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
tool_off403The workspace owner has not turned this tool on for this agent.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.
unavailable503Wagent could not complete this request, so nothing was done. Try again shortly.

GET/v1/chats/{id}/messages#

One chat's messages: the newest page first, each page oldest first, with gap markers and the history window. Same as the MCP get_messages tool.

Any key
Parameters
NameInTypeRequiredDescription
idpathstringYes
limitqueryintegerNo
cursorquerystringNo
Responses200400401403404423429503
Response 200
NameTypeRequiredDescription
chat_idstringYes
countintegerYes
next_cursorstring or nullYes
wagent_dataobjectYes
untrustedalways trueYes
notestringYes
itemsarray of objectYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
tool_off403The workspace owner has not turned this tool on for this agent.
not_found404Not found.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.
unavailable503Wagent could not complete this request, so nothing was done. Try again shortly.

POST/v1/connect/sessions#

A one-time connect session for one of your users, valid 15 minutes. Pass it to Wagent.connect() in your page; the number lands in this workspace tagged with `user`. Needs an active plan and a live key (a wg_test_ key gets 404). A repeat of the Idempotency-Key never returns a second session.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Request body
NameTypeRequiredDescription
userstringYes
Responses201400401403404409422429
Response 201
NameTypeRequiredDescription
sessionstringYes
expires_atstring (date-time)Yes
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
not_found404Not found.
widget_unavailable409This workspace cannot connect numbers through the widget until it has an active plan.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
already_requested409This request was already made.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
rate_limited429Too many requests. Retry after the time in Retry-After.

GET/v1/events#

Your webhook deliveries, newest first, 50 a page: event id, type, time, status, tries and the last answer's status and time taken. No payloads; replay an event to receive it again. status=not_delivered keeps pending, failed and skipped ones.

Any key
Parameters
NameInTypeRequiredDescription
statusqueryone of: all, not_deliveredNo
cursorquerystringNo
Responses200400401403423429
Response 200
NameTypeRequiredDescription
events[]array of objectYes
idstringYes
typestringYes
created_atstring (date-time)Yes
statusone of: pending, sending, delivered, failed, skippedYes
triesintegerYes
last_statusinteger or nullYes
last_latency_msinteger or nullYes
next_cursorstring or nullYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.

POST/v1/events/{id}/replay#

Sends one event to your webhook URL again now, with the same webhook-id, and answers how that attempt went. It never repeats the action behind the event. At most 10 replays a minute.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
idpathstringYes
Responses200400401403404409422423429503
Response 200
NameTypeRequiredDescription
statusalways "replayed"Yes
deliveryobjectYes
statusone of: pending, sending, delivered, failed, skippedYes
triesintegerYes
Errors
CodeStatusMeaning
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
read_only_key403This key is read only, so it cannot change anything.
not_found404Not found.
event_sending409This event is being delivered right now. Retry in a few seconds.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.
unavailable503Wagent could not complete this request, so nothing was done. Try again shortly.

GET/v1/me#

The key's workspace, agent, key and granted scopes.

Any key
Responses200401403429
Response 200
NameTypeRequiredDescription
workspaceobjectYes
idstringYes
namestringYes
agentobjectYes
idstringYes
namestringYes
kindstringYes
keyobjectYes
kindone of: server, read_onlyYes
envone of: live, testYes
last4stringYes
scopesarray of stringYes
access_ends_atstring (date-time) or nullYes
Errors
CodeStatusMeaning
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
rate_limited429Too many requests. Retry after the time in Retry-After.

POST/v1/messages#

Sends a WhatsApp text through the owner's rules: sent, waiting for the owner, or held. A retry after a crash that may have sent answers unknown and never sends again.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Request body
NameTypeRequiredDescription
chat_idstringYes
textstringYes
reply_tostringNo
Responses200400401403404409422423429502503
Response 200
NameTypeRequiredDescription
statusone of: sent, waiting, held, unknownYes
send_idstringNo
approval_idstringNo
draft_idstringNo
expires_atstringNo
notestringNo
reasonstringNo
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
agents_paused403Agents are paused by the workspace owner.
tool_off403The workspace owner has not turned this tool on for this agent.
blocked403The owner's rules do not allow this.
not_found404Not found.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.
send_failed502WhatsApp did not accept the message. Nothing was delivered.
unavailable503Wagent could not complete this request, so nothing was done. Try again shortly.

GET/v1/openapi.json#

This document: OpenAPI 3.1, generated from the code that serves the API. No key needed.

No key
Responses200
Response 200
NameTypeRequiredDescription
openapialways "3.1.0"Yes

POST/v1/pause#

Pauses every agent in the workspace at once and tells owners and admins. A second call keeps the first time. Only an owner or admin can resume, on the web.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Responses200400401403409422429
Response 200
NameTypeRequiredDescription
pausedalways trueYes
atstring (date-time)Yes
Errors
CodeStatusMeaning
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
rate_limited429Too many requests. Retry after the time in Retry-After.

POST/v1/sandbox/inbound#

Sandbox only (a wg_test_ key): a message from test contact 1 to 5 to the sandbox number. It arrives like a real message, through the inbox, the rules, Activity and your webhooks. 60 a minute per sandbox.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Request body
NameTypeRequiredDescription
contactintegerYes
textstringYes
Responses202400401403404409422429
Response 202
NameTypeRequiredDescription
message_idstringYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
not_found404Not found.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
rate_limited429Too many requests. Retry after the time in Retry-After.

POST/v1/sandbox/session#

Sandbox only (a wg_test_ key): moves the sandbox number to one of the six session states. Each change sends the same session events a real number would.

Needs a server keyIdempotency-Key required
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringYesA key you choose for this write, 1 to 255 visible ASCII characters. Repeating it never repeats the write.
Request body
NameTypeRequiredDescription
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
Responses200400401403404409422429
Response 200
NameTypeRequiredDescription
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
Errors
CodeStatusMeaning
invalid400The request is not valid.
idempotency_key_required400Send an Idempotency-Key header (1 to 255 visible ASCII characters) with every write.
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
read_only_key403This key is read only, so it cannot change anything.
not_found404Not found.
idempotency_in_progress409A request with this Idempotency-Key is still running. Retry shortly.
idempotency_key_mismatch422This Idempotency-Key was already used with a different request.
rate_limited429Too many requests. Retry after the time in Retry-After.

GET/v1/sessions#

Every WhatsApp number of this workspace that is not released, oldest first: its state (one of six), status, history sync progress from 0 to 100, and the user reference you passed when your user connected it through the widget.

Any key
Responses200401403423429
Response 200
NameTypeRequiredDescription
sessions[]array of objectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
sync_progressinteger or nullYes
external_refstring or nullYes
connected_atstring (date-time) or nullYes
Errors
CodeStatusMeaning
unauthorized401The API key is missing, unknown, revoked or not valid for this workspace.
ip_not_allowed403This address is not on the agent's allowed addresses.
agents_paused403Agents are paused by the workspace owner.
agent_off423This agent is switched off by the workspace owner.
rate_limited429Too many requests. Retry after the time in Retry-After.

Webhooks#

Each event arrives as a signed POST with the envelope below. See Webhooks and verifying signatures.

Eventmessage.received#

Family: messages

A message arrived in a chat the agent can read.

Payload
NameTypeRequiredDescription
idstringYes
typealways "message.received"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
wagent_dataobjectYes
untrustedalways trueYes
notestringYes
items[]array of objectYes
sourceobject, fields not shownYes
textstringYes
redactedobjectNo
metaobject, fields not shownYes

Eventmessage.status#

Family: messages

A sent message was delivered or read.

Payload
NameTypeRequiredDescription
idstringYes
typealways "message.status"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
statusone of: pending, sent, delivered, read, played, failed, deletedYes

Eventmessage.sent#

Family: messages

A message was sent from the number.

Payload
NameTypeRequiredDescription
idstringYes
typealways "message.sent"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes

Eventmessage.edited#

Family: messages

A message was edited.

Payload
NameTypeRequiredDescription
idstringYes
typealways "message.edited"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
wagent_dataobjectYes
untrustedalways trueYes
notestringYes
items[]array of objectYes
sourceobject, fields not shownYes
textstringYes
redactedobjectNo
metaobject, fields not shownYes

Eventmessage.deleted#

Family: messages

A message was deleted.

Payload
NameTypeRequiredDescription
idstringYes
typealways "message.deleted"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes

Eventstatus.posted#

Family: statuses

A contact posted a status (story).

Payload
NameTypeRequiredDescription
idstringYes
typealways "status.posted"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
message_idstring (uuid)Yes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
typestringYes

Eventchat.updated#

Family: chats

A chat was archived, muted or pinned, or changed otherwise.

Payload
NameTypeRequiredDescription
idstringYes
typealways "chat.updated"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
removedbooleanYes

Eventcontact.updated#

Family: contacts

A contact was added or renamed.

Payload
NameTypeRequiredDescription
idstringYes
typealways "contact.updated"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes

Eventgroup.updated#

Family: groups

A group's members or settings changed.

Payload
NameTypeRequiredDescription
idstringYes
typealways "group.updated"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
changeone of: updated, add, remove, promote, demote, leaveYes
countinteger or nullYes

Eventlabel.updated#

Family: labels

A label was added to or removed from a chat.

Payload
NameTypeRequiredDescription
idstringYes
typealways "label.updated"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
label_idstringYes
channel_idstring (uuid)Yes
removedbooleanYes

Eventpresence.updated#

Family: presences

A contact started typing or came online.

Payload
NameTypeRequiredDescription
idstringYes
typealways "presence.updated"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
presenceone of: online, offline, typing, recordingYes

Eventcall.received#

Family: calls

A call came in.

Payload
NameTypeRequiredDescription
idstringYes
typealways "call.received"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
chat_idstring (uuid)Yes
channel_idstring (uuid)Yes
call_idstringYes
statusone of: initiated, ringing, missed, answeredYes
videobooleanYes
groupbooleanYes

Eventdraft.created#

Always sent

An agent wrote a draft for the owner to review.

Payload
NameTypeRequiredDescription
idstringYes
typealways "draft.created"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
approval_idstring (uuid)Yes
agent_idstring (uuid) or nullYes
chat_idstring (uuid)Yes
channel_idstring (uuid) or nullYes
kindone of: draft, approvalYes
item_typestringYes
reasonstringYes
expires_atstring (date-time) or nullYes
created_atstring (date-time)Yes

Eventapproval.requested#

Always sent

An agent's action is waiting for the owner's approval.

Payload
NameTypeRequiredDescription
idstringYes
typealways "approval.requested"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
approval_idstring (uuid)Yes
agent_idstring (uuid) or nullYes
chat_idstring (uuid)Yes
channel_idstring (uuid) or nullYes
kindone of: draft, approvalYes
item_typestringYes
reasonstringYes
expires_atstring (date-time) or nullYes
created_atstring (date-time)Yes

Eventapproval.decided#

Always sent

The owner approved or declined a waiting item.

Payload
NameTypeRequiredDescription
idstringYes
typealways "approval.decided"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
approval_idstring (uuid)Yes
attemptinteger or nullYes
agent_idstring (uuid) or nullYes
chat_idstring (uuid)Yes
channel_idstring (uuid) or nullYes
resultone of: approved, skipped, expired, taken_overYes
viaone of: web, phone, api or nullYes
item_typestring or nullYes
actor_kindone of: agent, member, system, phoneYes

Eventrule.changed#

Always sent

The owner changed an agent's rights or a workspace rule.

Payload
NameTypeRequiredDescription
idstringYes
typealways "rule.changed"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
agent_idstring (uuid) or nullYes
fieldstring or nullYes

Eventagent.paused#

Always sent

An agent, or every agent, was paused.

Payload
NameTypeRequiredDescription
idstringYes
typealways "agent.paused"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
agent_idstring (uuid) or nullYes
allbooleanYes
viastring or nullNo

Eventagent.revoked#

Always sent

An agent's access was removed.

Payload
NameTypeRequiredDescription
idstringYes
typealways "agent.revoked"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
agent_idstring (uuid)Yes

Eventsession.state#

Family: channel

The number's connection state changed.

Payload
NameTypeRequiredDescription
idstringYes
typealways "session.state"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
sessionobjectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
external_refstring or nullYes
fromone of: not_started, starting, qr, authorized, error, sync_errorYes
toone of: not_started, starting, qr, authorized, error, sync_errorYes

Eventsession.syncing#

Family: channel

Chat sync started or moved on.

Payload
NameTypeRequiredDescription
idstringYes
typealways "session.syncing"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
sessionobjectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
external_refstring or nullYes

Eventsession.banned#

Family: channel

WhatsApp banned the number.

Payload
NameTypeRequiredDescription
idstringYes
typealways "session.banned"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
sessionobjectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
external_refstring or nullYes

Eventsession.connected#

Family: users

The number signed in.

Payload
NameTypeRequiredDescription
idstringYes
typealways "session.connected"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
sessionobjectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
external_refstring or nullYes
fromone of: not_started, starting, qr, authorized, error, sync_errorYes
toone of: not_started, starting, qr, authorized, error, sync_errorYes

Eventsession.logged_out#

Family: users

The number signed out.

Payload
NameTypeRequiredDescription
idstringYes
typealways "session.logged_out"Yes
created_atstring (date-time)Yes
workspace_idstring (uuid)Yes
envone of: live, testYes
dataobjectYes
sessionobjectYes
idstring (uuid)Yes
phone_numberstring or nullYes
stateone of: not_started, starting, qr, authorized, error, sync_errorYes
statusone of: connected, syncing, logged_out, banned, not_yetYes
external_refstring or nullYes
fromone of: not_started, starting, qr, authorized, error, sync_errorYes
toone of: not_started, starting, qr, authorized, error, sync_errorYes