Coexistence webhooks: echo and account lifecycle
The four webhook fields Meta asks for under coexistence, what the message echo carries and how to handle each without importing history.
Under coexistence, your webhook endpoint receives more event types than on a dedicated connection, because the app and the API talk to each other. Meta asks for four additional fields and describes what each carries. This article explains the four, says which ones the Hub uses and which it does not, and ends with an implementation script for whoever consumes the events.
Which webhook fields coexistence requires
Meta asks that the app be subscribed to account_update, history, smb_app_state_sync and smb_message_echoes, besides the normal message fields. They are configured in the app dashboard, under WhatsApp, Configuration, in the messaging account fields.
| Field | What it carries | Hub usage |
|---|---|---|
| smb_message_echoes | Messages sent from the app or a companion device | Echo delivered to your endpoint |
| account_update | Account lifecycle: partner removed, offboarding, reconnection | To react to drops |
| smb_app_state_sync | Contact sync and contact changes | Part of Meta's sync |
| history | Chat history in phases | The Hub does not import history |
The usage column describes Hub behaviour: history is not imported and the Groups API is not used. Meta, for its part, defines the content of each field.
What the message echo carries
The echo arrives when the business sends a message to a WhatsApp user from the app or a compatible companion device. The payload has a message_echoes array with sender, recipient, id, timestamp, type and the message content.
The echo is what lets you show the full conversation in your system, including what was answered on the phone. It does not open the API service window or change billing: app messages stay free and neither create nor extend the window.
What to do with lifecycle events
Treat account_update events as operational alerts, not conversation data. PARTNER_REMOVED says the link dropped, ACCOUNT_OFFBOARDED that the business left or the number changed device, and ACCOUNT_RECONNECTED that it came back with the same partner.
Each event should update the channel state and notify whoever looks after the portfolio. The possible disconnection reasons are in why coexistence disconnects.
What error 131060 means under coexistence
Meta cites error 131060, unsupported messages, as expected on a user's first message or when the message comes from an incompatible companion device. The guidance is to ask the business to check the WhatsApp Business app.
For your code this means treating the message as not delivered to the system but visible in the app, and showing the operator a useful notice. The Hub's general webhook behaviour is in webhooks.
An implementation script for consuming them
The script below covers the minimum to consume coexistence events safely. It leans on the Hub's general webhook practices.
- 1. Validate each request's signature in the X-Hub-Signature-256 header before any processing.
- 2. Return 200 immediately and process in the background, because webhooks can be large.
- 3. Deduplicate by message id and event id, since redeliveries happen.
- 4. Keep the echo queue apart from the incoming message queue, to avoid mixing up authorship.
- 5. Mark in your database that the echo message was sent from the app, not the API.
- 6. Treat account_update as an alert and update the channel state.
- 7. Explicitly ignore the history and contact events that the Hub does not import.
How to test before going live
Test the four paths with a real test account before turning production on. The order is: incoming message, template sent, message typed in the app and a disconnection triggered in the app.
- The incoming message arrives with a valid signature.
- The echo of the message typed in the app appears exactly once.
- The triggered disconnection produces a handled lifecycle event.
- Reconnection restores the channel state without manual database action.
For the product view, see WhatsApp Coexistence.
How to read a message echo
To understand the echo, think about who wrote and to whom. In an incoming-message webhook, the sender is the end user. In the echo, the sender is the business itself and the recipient is the user. That inversion is the difference between the two queues.
- Echo sender: the business number.
- Echo recipient: the WhatsApp user.
- Id and timestamp: used to order and deduplicate.
- Type and content: text or media, as in any message.
- Origin: the app or a compatible companion device.
A good practice is to store the message direction as an explicit field in your database, with values such as inbound, outbound via API and outbound via app. This stops reports from adding everything up as if it were automated sending.
Media messages arrive in separate webhooks, with asset identifiers. If your product displays images from the echo, plan the download as soon as the identifier arrives, not later.
Summary of safe consumption
Validate the signature, answer fast, deduplicate, keep the message origin separate and treat account events as alerts. With those five rules, the coexistence endpoint behaves like that of any Cloud API channel, with one extra stream of events.
Log every event you ignore on purpose, such as history and contact sync. If a customer asks why their old conversations are not in your system, that log is the evidence that the omission is a design choice, not a failure.
Finally, keep a test number for regression checks. Each time you change the webhook handler, replay the four test paths before you deploy.
Common pitfalls with echo events
The usual pitfalls are counting echo messages as automated sends in reports, showing them to the customer as if the agent had not written them, and triggering automation rules on messages the business itself typed. Each one comes from treating the echo as an incoming message.
Guard against them by filtering on direction before any rule runs, and by testing one flow where a person answers from the phone in the middle of an automated conversation.
Frequently asked questions
Do I need to subscribe to history if the Hub does not import history?
Meta lists history among the additional coexistence fields. Confirm in your connection flow whether it must be subscribed; on your endpoint, treat those events as ignorable, since the Hub does not import history.
Does the echo open the 24-hour window?
No. Per Meta, messages sent from the app do not create, extend or affect API windows or pricing.
Why did the same event arrive twice?
Redelivery is part of how webhooks work. Deduplicate by event id and message id, and return 200 quickly to reduce retries.
Can I use the echo to build history in my system?
It works for new messages, from onboarding on. Earlier history stays in the app, because the Hub does not import Meta's history sync.
Fontes
Documentação oficial da Meta, conferida em 31 de outubro de 2026.