Social media DM API: Instagram, Messenger and WhatsApp messages in one API
A social media DM API lets software reply to direct messages, and easyCoexistence is one for AI agents: Claude, ChatGPT or your platform replies to Instagram Direct, Facebook Messenger and WhatsApp messages through Meta's official APIs and one MCP connector. Replies go out within 24 hours of a person's last message, approved templates start WhatsApp conversations, automations reply on their own, and every connection is monitored 24/7.
- Instagram, Messenger and WhatsApp in one connector
- Templates to start WhatsApp conversations
- Automations that reply with text or AI
Nothing charged for 3 days. Cancel anytime.
The standard window Meta gives Messenger and Instagram replies after most actions that open a conversation, such as a person's message.
How long Meta's Human Agent tag lets a business representative reply by hand on Messenger and Instagram.
What WhatsApp accepts once 24 hours have passed since the customer last messaged or called the number.
The most text one Instagram DM can carry through the API, in UTF-8, so emoji and accents use more of it.
Free service messages Meta gives each WhatsApp business number every month; from the 1,001st, Meta charges them.
Which direct messages can an AI agent reply to?
Instagram Direct messages, Facebook Messenger conversations and messages to a WhatsApp number, each through Meta's official API. Claude, ChatGPT or your platform replies on Instagram and Messenger with send_social_dm and on WhatsApp with send_message, inside the window each network keeps open after a person writes, and send_template starts a WhatsApp conversation with an approved template.
On Instagram and Messenger the person makes the first move, by writing or by commenting. A comment can get one private reply, which reaches them as a message, in their message requests if they do not follow the account on Instagram, and a normal conversation opens when they answer.
| Reply window | What goes out | |
|---|---|---|
| 24 hours from the last message or call | Text inside the window; approved templates at other times | |
| 24 hours for most actions | Text up to 1,000 bytes; one private reply per comment | |
| Messenger | 24 hours for most actions | Text replies; one private reply per comment |
How long does each network keep a conversation open?
Twenty-four hours as a rule, with exceptions each network documents. A WhatsApp number's customer service window starts when someone messages or calls it and resets with each new message or call; once it closes, only pre-approved templates go out. On Messenger and Instagram, most actions that open a conversation give 24 hours, and a first message from a click-to-Messenger or click-to-Direct ad gives up to 7 days.
Meta also documents a Human Agent tag, for a person on the team replying by hand within 7 days, and a private reply goes to a commenter within 7 days of the comment. Three other Messenger tags, ACCOUNT_UPDATE, CONFIRMED_EVENT_UPDATE and POST_PURCHASE_UPDATE, have returned error 100 since April 27, 2026. send_social_dm replies inside the standard window.
Which tools send and receive messages?
Sending and receiving are separate, so an agent can reply while your own system keeps the record. Incoming Instagram and Messenger DMs reach your endpoint through set_social_webhook_destination, each carrying the sender's ID that send_social_dm takes as recipient_id. A WhatsApp number delivers through Meta: straight to your server with set_webhook_destination, or through easyCoexistence in managed mode, where automations can reply and messages are forwarded to you signed. Each send tool then replies on the right account, with the network's own rules applied, and a refusal from the network comes back to the agent as an error it can act on.
How do automations and AI reply to DMs?
An automation starts on an Instagram or Messenger DM or on a WhatsApp message, and runs up to 12 steps in a straight line, day and night, with no chat open. Its trigger is a new message, a keyword the message contains, starts with or equals, a customer's first message, or the hours you are closed. Its steps reply with a fixed text or with AI, send an approved WhatsApp template, call your webhook, wait or stop.
The AI step calls the Anthropic, OpenAI or OpenRouter model you choose with your own key, your instructions about the business and up to 20 earlier messages, and by default sends at most 10 AI replies per chat in an hour. On WhatsApp, automations run in managed mode and, by default, step back for 4 hours from a chat the owner answers from the phone.
Which networks have no DMs through easyCoexistence?
TikTok, YouTube and LinkedIn. TikTok gives direct messages a separate Business Messaging API, which needs its own data security and privacy review and is not available for accounts in the EEA, Switzerland or the UK, so a TikTok connection works in the comments and replies there in public. YouTube's API has no direct messages, and a LinkedIn connection here has none.
On those networks, your AI reads new comments and replies under them as the account. TikTok comments also reach comment rules and automations, which reply in public within minutes of the comment.
Common mistakes
- Leaving Allow access to messages off on Instagram. API messages fail until the account turns it on, under Settings, Messages and story replies, Message controls, Connected tools.
- Sending WhatsApp free text after the window closes. Once 24 hours pass without a new message or call from the customer, only an approved template is delivered, so fall back to send_template.
- Replying to echoes. A DM the account itself sends comes back as a message event with is_echo set to true, and answering it makes the agent talk to itself.
- Counting an Instagram DM in characters. The limit is 1,000 bytes of UTF-8, so emoji and accented letters use it up sooner; trim by encoded length.
easyCoexistence gives your AI agents one DM API for Instagram Direct, Messenger and WhatsApp on Meta's official APIs: reply to DMs, open WhatsApp conversations with templates and let automations reply with fixed text or AI, 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
Can an AI agent reply to Instagram DMs?
Yes, within 24 hours of the person's last message, with send_social_dm and the sender's ID from the forwarded event. The account must allow access to messages in the Instagram app first.
Can it message a customer who has not written first?
On WhatsApp, yes, with an approved template through send_template. On Instagram and Messenger the person writes or comments first, and a comment can get one private reply.
How long can an Instagram DM sent through the API be?
Up to 1,000 bytes of UTF-8 text. An accented letter takes two bytes and an emoji up to four, so measure the encoded length, not the characters, before sending.
How much does easyCoexistence cost for social media DMs?
US$ 9 to US$ 0.75 per connection per month, falling as you add connections, and easyCoexistence charges nothing per message. Meta bills WhatsApp messages to the business's own account, and the first 3 days are 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