Social media webhooks: comments, mentions and messages to one endpoint
easyCoexistence forwards social media events to your own HTTPS endpoint as they happen: comments, mentions and DMs from Instagram and Facebook, and comments from TikTok. Each arrives in one envelope, with the network's event inside unchanged, signed per account with X-EC-Signature. Turn it on per account with set_social_webhook_destination from Claude or ChatGPT, or with the Partner API. A WhatsApp number's messages reach your server too.
- Comments, mentions and DMs as they happen
- One envelope, signed for each account
- Set from Claude, ChatGPT or the Partner API
Nothing charged for 3 days. Cancel anytime.
How many times easyCoexistence sends each forwarded social event; it keeps no copy, so nothing is sent again later.
How soon TikTok's comment.update webhook reports a comment created, deleted or changing visibility on an owned account's public videos.
Where apps on Instagram Login receive @mentions: inside the comments webhook notification, not as a field of their own.
What YouTube's push notifications report for a channel: a new upload, a new title or a new description.
How long Meta keeps retrying a WhatsApp webhook your server did not accept, which can deliver duplicates.
Which events does each network send?
Instagram, Facebook and TikTok push events to easyCoexistence, which passes each one to the URL you set for that account. Instagram sends new comments, with @mentions arriving inside the comments notification, and DMs. A Facebook Page sends feed activity, which covers new comments, plus Messenger messages and mentions of the Page. TikTok sends comment.update, fired when a comment is created, deleted or changes visibility.
YouTube and LinkedIn send easyCoexistence no comment or message events, so an agent reads their comments on request. A WhatsApp number works on its own path: Meta delivers its messages straight to your server, or easyCoexistence forwards them signed when the number runs in managed mode.
| What arrives | Sent by | |
|---|---|---|
| Comments, mentions and DMs | easyCoexistence, signed per account | |
| Feed activity, Messenger and mentions | easyCoexistence, signed per account | |
| TikTok | comment.update events | easyCoexistence, signed per account |
| Messages and echoes from the app | Meta directly, or easyCoexistence in managed mode | |
| YouTube | No comment events | Read with list_youtube_comments |
| No comment events | Read with list_linkedin_comments |
What does a forwarded event look like?
The same JSON envelope on each network, posted with Content-Type application/json: platform, the network; account_id, the ID the MCP tools and the Partner API use; external_id, the account's ID on the network; and entry, the network's own event as it arrived. For Instagram and Facebook, entry is Meta's webhook entry, with changes for comments and mentions and messaging for DMs. For TikTok it holds the comment.update event, with comment_id, video_id and parent_comment_id as strings, so 64-bit IDs are not rounded. A Messenger message arrives like this:
{
"platform": "facebook",
"account_id": "<ACCOUNT_ID>",
"external_id": "<PAGE_ID>",
"entry": {
"id": "<PAGE_ID>",
"time": 1793318400512,
"messaging": [
{
"sender": { "id": "<PAGE_SCOPED_ID>" },
"recipient": { "id": "<PAGE_ID>" },
"timestamp": 1793318399870,
"message": { "mid": "<MESSAGE_ID>", "text": "Are you open on Sunday?" }
}
]
}
}How do you verify X-EC-Signature?
With the signing secret returned when you set the destination, unique to that account and shown once. The header reads t=<unix>,v1=<hex>, and v1 is an HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with that secret. Read the body as bytes before parsing it, refuse a timestamp more than 5 minutes from your clock, look the secret up by the event's account_id and compare the two digests in constant time. Then answer 2xx and queue the work. In PHP, that takes a few lines:
<?php
// POST /hooks/social: one endpoint for the events of each account
$raw = file_get_contents('php://input'); // the exact bytes that were signed
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_EC_SIGNATURE'] ?? ''), $sig);
$event = json_decode($raw, true); // platform, account_id, external_id, entry
$secret = secret_for($event['account_id'] ?? ''); // the signing_secret stored for that account
$fresh = ctype_digit($sig['t'] ?? '') && abs(time() - (int) $sig['t']) <= 300;
$expected = hash_hmac('sha256', ($sig['t'] ?? '') . '.' . $raw, (string) $secret);
if (!$secret || !$fresh || !hash_equals($expected, $sig['v1'] ?? '')) {
http_response_code(401);
exit;
}
http_response_code(204);
enqueue($event); // keep this quick: the forward waits 8 seconds and is never resentHow do you turn forwarding on for an account?
From an assistant or from your backend. Ask Claude or ChatGPT to run set_social_webhook_destination with the account and your HTTPS URL, or call PUT /api/v1/channels/:id/webhook on the Partner API with your ec_live_ key and a body holding the url. Both return the account's signing_secret once, so store it against the account_id then. Calling either again issues a new secret, and a url of null turns forwarding off.
The URL has to be HTTPS on a public host: a private address is refused when you set it and again at delivery. One endpoint can serve many accounts, since each event names its account_id. For a WhatsApp number, set_webhook_destination routes Meta's deliveries to you, and set_inbound_mode with a forward_url forwards them signed instead.
What happens when your endpoint is slow or down?
The event is not sent again. easyCoexistence makes one attempt, waits up to 8 seconds for an answer, follows no redirects and keeps no copy, because retrying would mean storing your customers' comments and messages. Answer 2xx as soon as the signature checks out, do slow work from a queue, and deduplicate on the network's own IDs, such as a comment ID or a message mid, in case an event arrives twice.
WhatsApp differs. In direct mode, Meta retries a delivery your server did not accept for up to 7 days. In managed mode, easyCoexistence queues messages for your forward URL and retries with backoff. Partner status events, such as a connection dropping, are retried for about 33 hours.
How do YouTube and LinkedIn comments reach an agent?
By reading them on a schedule. YouTube's push notifications report a new upload, a new title or a new description, not comments, and easyCoexistence receives no comment events from LinkedIn, so neither forwards anything. An agent checks instead: list_youtube_comments returns a video's threads or the whole channel's, held-for-review ones included, and list_linkedin_comments returns a post's comments or the replies under one. In n8n, Make or Zapier a schedule trigger starts the check; in your own code, a cron job fetches the channel's credentials and calls YouTube's commentThreads or LinkedIn's comments endpoint directly.
How to set it up
- Set the destinationRun set_social_webhook_destination with the account and an HTTPS URL, or call PUT /api/v1/channels/:id/webhook with your ec_live_ key.
- Store the secretSave the signing_secret from the response against that account_id, since it is shown only once.
- Verify each deliveryCheck that the timestamp is fresh and that v1 matches an HMAC-SHA256 of the timestamp, a dot and the raw body.
- Acknowledge, then workAnswer 2xx straight away and hand the event to a queue, because easyCoexistence sends it only once.
Common mistakes
- Checking the HMAC over parsed JSON. The signature covers the raw body byte for byte, and serializing the parsed object again changes those bytes, so verify before you parse.
- Using one secret for every account. Each account signs with its own secret, so look it up by the event's account_id before comparing v1.
- Setting the destination again without updating your endpoint. Each call issues a new secret and the old one stops signing at once, so store the new one straight away.
- Giving a URL that redirects. Forwards follow no redirects, so a move to a new path or host loses the event; set the final address.
easyCoexistence sends Instagram and Facebook comments, mentions and DMs, and TikTok comments, to your endpoint as they happen, signed per account, and routes WhatsApp messages to your server, so your AI agents hear from customers through each network's official API, with every connection monitored 24/7. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
How do a WhatsApp number's messages reach my endpoint?
In one of two ways. set_webhook_destination has Meta deliver them straight to your server, while set_inbound_mode with a forward_url has easyCoexistence forward them signed with X-EC-Signature, retrying with backoff.
Can the same event arrive twice?
It can, so deduplicate on the network's own IDs, such as a comment ID or a message mid. Meta's retries of a WhatsApp delivery your server did not accept, for up to 7 days, can bring duplicates too.
Can one endpoint receive events from several accounts?
Yes. Each event carries platform and account_id, so one URL can serve many accounts, as long as it checks each signature with that account's own secret.
How much does easyCoexistence cost for social media webhooks?
US$ 9 to US$ 0.75 per connection per month, falling as you add connections and the same on every network. Forwarding, the MCP server and the Partner API are included, with the first 3 days free.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on