Log inStart Free Trial
easyCoexistence Official APIs

AI replies to Facebook comments and Messenger messages

AI replies to Facebook comments and Messenger messages run on a Page's webhooks and Graph API: the feed field reports new comments, the messages field new Messenger messages, the business's own AI writes the reply, and the Page posts it. Messenger replies go to the person's Page-scoped ID within 24 hours of their latest message; a comment gets a public reply, or one private Messenger reply within 7 days.

easyCoexistence lets a business's own AI reply on its Facebook Page: automations reply to comments and DMs on their own with a fixed text, an AI reply written with your own Anthropic, OpenAI or OpenRouter key, an AI agent that knows your business, or your own agent through a webhook, and comment-to-DM rules send private replies around the clock.

24 hours

The standard Messenger window for most user actions, counted from the action, such as a message to the Page.

1 per comment

Private replies Meta allows per comment or visitor post, within 7 days; more messages wait until the person answers.

MESSAGING

The Page task the person behind the token needs for private replies, beside the pages_messaging permission.

Disclose

Where the law requires it, an automated chat must tell people they are interacting with an automated service.

50 rules

Comment-to-DM rules one Page can hold on easyCoexistence, each on one post or all of them.

How does an AI reply reach a comment or a Messenger message?

In three moves. Meta's webhook tells the app about a new comment, through the Page's feed field, or a new Messenger message, through its messages field, as it arrives; the app hands the text to an AI model, or to the business's own agent; and the reply goes back through the Graph API, as a Messenger reply, a public reply under the comment or a private reply. Nothing reaches a person who has not written or commented first.

1A comment or messageFrom someone who wrote first
2WebhookMeta notifies the app as it arrives
3The AI writesA model with the business's instructions, or its own agent
4The API sendsA Messenger reply, a public reply or one private reply

What does Meta allow an automated reply to do?

Meta's rules for each app on the Messenger Platform and the Pages API apply whether a person or a model writes the text:

  • Messenger: replies to people who wrote to the Page, within 24 hours of their latest message.
  • Comments: public replies under the comment as the Page, and hiding or showing it.
  • Private replies: one Messenger message per comment or visitor post, within 7 days; a follow-up waits until the person answers.
  • Other Pages: Meta allows no private reply to a Facebook Page.
  • Disclosure: where the law requires it, the chat says it is automated at the start, after a long pause, or when it passes from a person to automation.

How do easyCoexistence's automations decide when to reply?

An automation is a trigger and a flow of steps, up to 30 per line and 60 in all, that easyCoexistence runs on its own, around the clock, with no chat open. On a Page, dm_received starts on a Messenger message and takes the matches any, keyword, phone_number, first_message and outside_hours, the last with opening hours in a timezone; comment_received starts on a comment and takes any, keyword or phone_number, on one post or all of them; tag_added starts when a contact gets a tag. When several automations match, one replies, the most specific first: phone_number, then keyword, then first message, then outside hours, then any.

Which steps can an automation take?

Steps run in order and can branch: condition picks a path by rules, ai_decide lets the business's own AI pick one by meaning, and ask puts a question to the person and waits for the answer. On a Messenger message, reply_text, ai_reply, agent, ask and send_file reply in the conversation; on a comment, reply_text or ai_reply sends the comment's single private reply, so a comment automation holds at most one of them before the person answers, beside reply_comment for a public reply and hide_comment. tag, set_field, http_request, handoff and notify_owner work here too.

reply_textA fixed reply, sent in Messenger
ai_replyA reply written by Anthropic, OpenAI or OpenRouter with the business's own key
call_webhookThe event, signed, sent to the business's own agent, whose reply goes out
reply_commentA public reply under the comment, as the Page
hide_commentHides the comment
wait1 to 1,380 minutes before the next step
stopEnds the run, as the last step

How does the business's own AI write the reply?

In one of three ways. ai_reply calls Anthropic, OpenAI or OpenRouter with the business's own key, saved in the dashboard and never passed through a chat, and a prompt about the business; on Messenger the model also reads up to 20 earlier messages of the conversation, 10 by default. agent hands the Messenger message to one of the business's AI agents, which answers from the knowledge it was given (uploaded files, web pages and text) and its tools. call_webhook posts the message or comment, signed with X-EC-Signature, to the business's own agent or backend, and sends the text it returns as {"reply": "..."}.

How do comment-to-DM rules work?

A rule pairs keywords with a Messenger message and, if you like, a public reply. When a comment contains one of the keywords, ignoring case, the commenter gets the message as the comment's private reply and the public reply under the comment, with no agent involved; a rule with no keywords replies to any comment. A rule covers one post or all of them, the oldest matching rule replies and the Page's own comments are skipped. A Page holds up to 50 rules, each message up to 1,000 characters, managed with create_comment_rule, list_comment_rules and update_comment_rule. Rules go first, and automations take the comments no rule replied to.

What keeps automated replies in check?

Guards built into the runner, so an automation can be left running:

  • Free-form replies go out only within 24 hours of the person's latest message; later runs are skipped as window_closed.
  • AI replies are capped per conversation, at 10 an hour by default.
  • A comment that already got its private reply is not sent a second one.
  • test_automation runs the steps on a sample message without sending anything.
  • list_automation_runs explains each run that replied or was skipped, and the owner is emailed when an automation fails, at most once every 6 hours per automation.
  • A person answering from the Page inbox pauses automations on that chat for 4 hours by default (0 to 168); a handoff step pauses it on purpose and emails the owner.

How do you set one up from Claude or ChatGPT?

Ask in plain words, for example: when someone comments MENU on this post, send them the menu in Messenger and reply that it is in their inbox. The assistant creates the rule or the automation with the Page's account_id, runs test_automation, and reads list_automation_runs when you ask why something did or did not reply. AI keys are added in the dashboard, never through the chat.

Common mistakes

  • Putting two message steps in a comment automation. Meta allows one private reply per comment, so keep one reply_text or ai_reply and reply in public with reply_comment.
  • Picking a short keyword for a rule. Rules match keywords anywhere in the comment, so tea also fires on team and steak; an automation can instead require the whole comment to be the keyword, or to start with it.
  • Expecting a Messenger reply after the window. Free-form replies stop 24 hours after the person's latest message, and the run is skipped until they write again.
  • Pasting an AI key into a chat with the assistant. Keys are saved in the dashboard, and no MCP tool takes or returns one.
Doing this with EasyCoexistence

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 AI reply to Facebook Messenger messages automatically?

Yes, within Meta's rules: the person writes first, and replies go out within 24 hours of their latest message. An automation's ai_reply step writes each reply with the business's own AI key.

Can AI reply to Facebook comments?

Yes, in public under the comment as the Page, or in private with one Messenger message per comment, sent within 7 days of it.

Which AI models can write the replies?

Models from Anthropic, OpenAI or OpenRouter, called with the business's own key saved in the dashboard, one of the business's AI agents, through an agent step, or the business's own backend, through a call_webhook step.

What does easyCoexistence keep from these conversations?

With an automation on, the Messenger messages it acts on are kept for the period the owner picks, 30, 90 or 365 days (90 by default), as context for replies and for the Conversations screen, and its run logs, which hold the comments that started runs, 30 days. Events forwarded to your endpoint are passed on with no copy kept.

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