Skip to main content
Webhook and WebSocket share the same envelope and the same catalog of events. The only difference is the delivery channel, data is identical. This page documents the 6 types: message.exchange, message.status, call.update, group.flow, instance.state and label.update.

Envelope

Filtering is done by the event name in the events field of the config. Empty = all types.

Filtering and routing

When byEvents=true (webhook only), the event name is appended to the URL:
  • Config: url: "https://app/wh", byEvents: true
  • Delivery: POST https://app/wh/message.exchange
Useful for endpoint-based routing without inspecting the payload.

message.exchange

Messages sent and received (text, media, sticker, document, audio, poll, contact, location, etc.), edits and revocations.

Payload

Conditional fields

Only the fields relevant to the message type are populated. Edits have edit populated; revocations arrive with type: "message_revoke" in data.message.type.
chat.isCommunity appears only when true, indicating the chat is the announcement channel (parent / announcement channel) of a WhatsApp community. Subgroups linked to a community keep type: "group" and do not include the isCommunity field. In regular groups and DMs the field is also omitted.
media.base64 only appears when mediaBase64=true in the config (webhook or WebSocket). Otherwise, use media.url (whatsapp.net, expires) or media.s3Url (if S3 is configured on the instance).

adOrigin — origin attribution (Click-to-WhatsApp)

Present only on the first received message of a conversation started from a Meta ad or an entry point (wa.me link, search, QR). Lets you route the lead by campaign without querying the database. Two scenarios:
  • Native ad (Click-to-WhatsApp / Call Ads)entryPointSource is ctwa_ad and the full block is included: sourceId (ad ID — groups leads by campaign), ctwaClid (Meta attribution key, use it with the Conversions API), sourceApp, sourceUrl, title, body, mediaType, greetingMessageBody, plus conversionSource, entryPointExternalSource, ctwaPayload (base64 token for the Conversions API), originalImageUrl, and clickToWhatsappCall.
  • Non-ad entry point — wa.me link (click_to_chat_link), WhatsApp search (global_search_new_chat), QR code, etc. Only entryPointSource is present (plus entryPointApp / entryPointDelaySeconds when available), without sourceId / ctwaClid — Meta does not attach ad data to these.
Organic messages — and any message that is not the first of the conversation — do not carry adOrigin. An ad’s pre-filled text is not proof of origin: reliable attribution comes from sourceId / ctwaClid.

Example (image received)


message.status

Delivery receipts: delivered, read, played, etc.

Payload

status enum

  • messageSender in groups: JID of the original message author (relevant when someone reads a message from another participant).
  • chat.isCommunity follows the same rule as message.exchange: present and true only when the chat is the announcement channel of a community.

call.update

Call events: offer, accepted, rejected, terminated, latency.

Payload

type enum

To auto-reject calls, set autoRejectCalls=true in the instance settings block, you still receive the offer + rejected events on the webhook.

group.flow

Group changes: members, metadata, settings.

Payload, participant change

Metadata subtypes


instance.state

Changes in the instance’s own state (connection, QR, ban, pairing).

Payload

state enum

So your client knows when to refresh the QR in the UI, listen for instance.state with state=qr_ready and render data.codes[0].

label.update

Label edits/associations (WhatsApp Business labels).

Payload

type × action combinations


Events not emitted (internal)

Captured by the whatsmeow handler but not propagated via webhook/WS:
  • *events.Picture, profile picture change (logged only).
  • *events.FBMessage, Facebook Business (logged only).
  • *events.HistorySync, history sync (processed and stored in DB).
If you need to consume any of these changes, poll the corresponding REST endpoints (profile, history).

References

Configure webhook

Filter events via events[] in the config.

Configure WebSocket

Same filter syntax as the webhook.

Connect via WebSocket

Receive events in real time.

Events overview

Webhook vs WebSocket comparison.