data varies by event type. The payload is normalized by Zapfy — it does
not change when the underlying connection to WhatsApp changes.
Envelope
string
Event type, in
UPPER_SNAKE. One of the values below.string
ID of the Zapfy instance that produced the event.
string
Unique event ID. Use it as an idempotency key (delivery is at-least-once).
string
Emission time, ISO 8601 (UTC).
object
Event-specific payload — described below. The examples that follow show the full
event (envelope +
data).Event types
MESSAGE_RECEIVED / MESSAGE_SENT
Message in a contact chat (1:1):chat is the group (phone: null) and sender is the participant who sent it:
data object:
string
Message ID on WhatsApp. Reuse it in
delete/edit.boolean
true if you sent it (MESSAGE_SENT); false if you received it.object
The conversation — the contact or group the message belongs to. This is where you reply.
object
Who sent this message. In a contact chat it’s the contact itself; in a group, the participant.
string
TEXT · IMAGE · AUDIO · VIDEO · DOCUMENT · STICKER · LOCATION ·
CONTACT · INTERACTIVE.string
Text content. For media, holds the caption.
object | null
Present for media:
{ mimeType, url, filename, caption }.MESSAGE_STATUS
Status of a message you sent —data carries chat (same shape), no sender:
string
PENDING · SENT · DELIVERED · READ · FAILED.object | null
Present on
FAILED: { code, message }.CONNECTION_UPDATE
string
CONNECTING · CONNECTED · DISCONNECTED.string | null
Connected account’s phone number, in E.164.
null while there is no session (e.g. CONNECTING or DISCONNECTED).string | null
Disconnect reason when
DISCONNECTED (e.g. LOGGED_OUT, BANNED).QRCODE_UPDATED
string
QR Code as a data URL (base64 PNG) to pair the number.
string
QR expiration, ISO 8601 (UTC).