Messages
Receiving through Meta, the one-time history import, and sending with the number's token.
Messages never pass through EasyCoexistence. Meta delivers incoming messages straight to your URL, and your backend sends through Meta's Graph API with the number's own token from Get a number. This page is about those two calls to Meta, not to this API.
Receiving messages
Meta posts each number's messages to its webhook_url, directly. Two consequences:
- No signature you can check. Meta signs with EasyCoexistence's app secret, which is never shared, so
X-Hub-Signature-256cannot be verified on your side. Put a long random secret in the URL path and treat it as the credential; optionally allowlist Meta's IP range (AS32934). - Media is fetched from Meta by id with the number's token.
Webhooks for numbers with no webhook_url fall back to EasyCoexistence, where they are dropped unpersisted. Nothing is ever stored. With n8n, receive on the Webhook node, not the WhatsApp Trigger node.
Chat history and contacts
When a number connects with a webhook_url already set (on the connect session, or saved within 24 hours of connecting), EasyCoexistence asks Meta once to send the number's existing contacts and chats to it.
- Contacts arrive as
smb_app_state_syncwebhooks, one entry per contact withaction=addorremove. - Chats arrive as
historywebhooks: up to 180 days before the connection, both incoming and outgoing messages (fromtells which side sent each one). Group chats are not included. Media comes asmedia_placeholderwithout the file. - Order and completion. Chunks can arrive out of order: sort them by
metadata.chunk_order.metadata.progress=100means the import is complete. - The business decides. During the connection, the WhatsApp Business app asks whether to share chat history. Declining arrives as a
historywebhook with error2593109and no messages. - One chance per connection. Meta allows the import once, within 24 hours of connecting. Have your endpoint up before the number connects. It cannot be replayed; disconnecting and connecting the number again runs it again (deduplicate on message
id). - Not stored here. It goes from Meta to your endpoint, like messages. A number with no
webhook_urlat connection time gets no import.
Sending, templates and everything else
EasyCoexistence is not a proxy for Meta's API. With the number's token from credentials, your backend calls Meta's Graph API directly for everything the number does:
- Send:
POST /<phone_number_id>/messages. Text inside the 24-hour window;"type": "template"to start a conversation; media and interactive messages on the same endpoint. - List templates and review status:
GET /<waba_id>/message_templates?fields=name,status,category,language,components - Create a template (submits it for review):
POST /<waba_id>/message_templateswithname,language,categoryandcomponents - Delete a template:
DELETE /<waba_id>/message_templates?name=<name> - Upload media:
POST /<phone_number_id>/media. Business profile:/<phone_number_id>/whatsapp_business_profile
curl -X POST https://graph.facebook.com/v25.0/<phone_number_id>/messages \
-H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "5511999998888",
"type": "template",
"template": { "name": "order_update", "language": { "code": "pt_BR" } }
}'Templates are API-only in Coexistence: the WhatsApp Business app cannot send them, so anything outside the 24-hour window goes through your backend.
Review takes minutes, up to about 24 hours. Template status webhooks are not delivered to your webhook_url: poll the list for APPROVED or REJECTED. A deleted name cannot be reused for 30 days.
Meta bills conversations to the number's own WABA, on the payment method set in WhatsApp Manager; marketing templates fail without one. EasyCoexistence never charges for messages.
When token_ready is false there is no token to call Meta with. Connect the number again from the dashboard (New connection), or for a customer's number start a new connect session: a reconnection issues one and never replaces a token that already works.