Log inStart Free Trial
easyCoexistence Official APIs

How to let your customers connect Facebook to your app

Your backend calls easyCoexistence's POST /connect-sessions with channel facebook and sends the customer to the returned url, where they sign in with Facebook and pick the Pages they admin or have task access to. The sign-in runs on easyCoexistence's Meta-reviewed app, so your app skips App Review. Each Page becomes one channel_id, billed as one connection, that your app posts to, hears comments and Messenger on, and replies through.

easyCoexistence is social media infrastructure for AI agents: its Partner API connects your customers' WhatsApp, Instagram, Facebook and TikTok accounts to your product, with no app review on your side.

1 hour

How long an easyCoexistence connect link works before its session expires and a new one is needed.

1 per Page

Connections a Facebook sign-in creates: each Page the customer picks is its own channel, monitored and billed on its own.

6 hours

How often easyCoexistence checks each connected Page, with an email when it needs reconnecting.

24 hours

Meta's standard Messenger window for replying after a person's message, for most user actions.

7 days

How long after a comment a Page can still send its one private reply on Messenger.

What does the customer do to connect a Facebook Page?

Sign in once and tick their Pages. Your backend creates a session with channel set to facebook, a redirect_url and your customer's id as external_ref, then sends the customer to its url with a redirect or a new tab, never an iframe. The hosted page shows your name from partner_name and a Continue with Facebook button, which opens Facebook's own login in the same tab, so it works on phones. When the login manages more than one Page, the customer sees the list and picks the ones to connect: nothing is connected until they choose, because each Page kept is a connection billed to your account. They land on your redirect_url with status=connected and a channel_id, which your backend confirms with GET /connect-sessions/{id} before it marks the customer as connected. If they choose Cancel and go back, your redirect_url gets status=cancelled instead; if the Facebook sign-in is refused or fails, they return to the hosted page with the reason and can try again while the link is open.

1Your appPOST /connect-sessions with channel facebook
2Hosted pageYour name and Continue with Facebook
3Facebook loginThe customer signs in and ticks their Pages
4Back to youredirect_url with status and channel_id

Which Facebook Pages can a customer connect?

Pages where the person signing in is an admin or has task access, since those are the Pages Facebook lists for their login. Personal profiles and Groups do not connect. An agency login can list dozens of Pages, so the picker matters: the customer ticks only the ones meant for your product, and only those are billed. A Page already connected through another easyCoexistence account is skipped, and when it was the only one picked, the session's last_error says so; it connects once it is removed there. The sign-in asks for Meta's Page permissions, among them pages_manage_posts, pages_manage_engagement, pages_messaging and read_insights, on easyCoexistence's own Meta app, which Meta has already reviewed, because easyCoexistence is a Meta Tech Provider. Your product submits nothing to App Review and never builds a Facebook login of its own.

What comes back when a customer connects several Pages?

One channel per Page, each tagged with the session's external_ref. The redirect and the session name the first Page's channel_id, and GET /channels?external_ref=customer_4821&channel=facebook lists every Page that customer connected. Your events URL receives one channel.connected event per Page, signed with X-EC-Signature and carrying the external_ref, so a handler can store each Page without polling. Keep each channel_id next to your customer's record, because every later call names the channel: posts, the webhook and automations are set per Page, and each Page's webhook signs with its own secret. A Page connected earlier for a different customer of yours keeps that customer's external_ref, so one Page never ends up under two of your customers, and a later session with the same external_ref adds more Pages.

What token does your app get for a Page?

None. Meta's terms do not allow handing a Page's access token to another app, so easyCoexistence keeps it, and GET /channels/{id}?credentials=1 returns the Graph API base and the Page's ID without a token. Your app acts on the Page through easyCoexistence instead, with the same ec_live_ key for every customer. That keeps one secret on your server rather than a token per Page, and nothing to refresh: easyCoexistence checks each Page every 6 hours and emails your account when one needs reconnecting. These calls take the token's place:

  • Publish and schedule: POST /channels/{id}/posts sends text, a link, one photo or one video to the Page, now or at publish_at up to 90 days ahead. Reels and Stories are not published to Facebook through it.
  • Receive: PUT /channels/{id}/webhook returns a signing secret and forwards the Page's comments, Messenger messages and mentions as they arrive, with no copy kept.
  • Reply and moderate: automations answer on Messenger or under the comment, and can hide a comment with hide_comment.

How does your app reply on Messenger and under comments?

Through an automation on the Page, created with POST /channels/{id}/automations and a dm_received or comment_received trigger. A call_webhook step posts the message or comment to your backend as JSON, signed with X-EC-Signature, and waits up to 20 seconds; when your answer is {"reply": "..."}, easyCoexistence sends that text from the Page. On a Messenger message the reply goes out in the same chat, within 24 hours of the person's last message, which is Meta's standard window. On a comment it goes out as the comment's one private reply on Messenger, within 7 days of the comment, and once the person answers, the conversation carries on in Messenger. Fixed answers need no backend at all: reply_text sends a set text, and reply_comment answers in public under the comment.

What happens when the customer's access ends?

Your events URL receives channel.disconnected when Facebook refuses the Page token or the owner withdraws access, and the channel reads disconnected. A new connect session for that customer brings the Page back. GET /channels/{id} reports the same status at any time: connected, disconnected, suspended when your subscription has lapsed, or removed. To end it from your side, DELETE /channels/{id} revokes access at Facebook and forgets the token, cancels the posts still waiting in the queue, and stops billing at the end of the cycle; nothing is left for the customer to do in Facebook. Removing a Page also clears its webhook destination and secret, so after it reconnects, call PUT /channels/{id}/webhook again and store the new secret against its channel_id.

How to set it up

  1. Create the sessionFrom your backend, POST /connect-sessions with channel facebook, a redirect_url and your customer's id as external_ref.
  2. Send the customerRedirect them, or open a new tab, to the session's url, where they sign in with Facebook and tick their Pages.
  3. Confirm the resultOn your redirect_url, read GET /connect-sessions/{id}, then list the customer's Pages with GET /channels?external_ref=.
  4. Turn on eventsCall PUT /channels/{id}/webhook for each Page and store the signing_secret it returns against that channel_id.
  5. Add repliesCreate an automation on each Page with POST /channels/{id}/automations and a call_webhook step pointing at your backend.

Common mistakes

  • Treating the redirect's channel_id as the customer's only Page. One sign-in can connect several and the redirect names the first, so list the rest with GET /channels?external_ref= or count the channel.connected events.
  • Asking the credentials call for a Page token. Meta's terms keep it with easyCoexistence, so GET /channels/{id}?credentials=1 returns the Page ID and the Graph API base; publish and reply through the posts API and automations.
  • Reusing one webhook secret across Pages. Each Page's PUT /channels/{id}/webhook returns its own signing_secret, so look the secret up by account_id before verifying X-EC-Signature.
  • Planning Messenger follow-ups past the 24-hour window. Meta refuses them and the automation skips the run with window_closed, so keep any wait step in a flow under a day.
Doing this with EasyCoexistence

easyCoexistence lets your customers connect their Facebook Pages to your app through one hosted sign-in, then gives your backend a posts endpoint, each Page's comments, messages and mentions by webhook and automations that reply on Messenger, with no Page token to store. The same calls cover Instagram and TikTok, and more networks are on the way. 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, Google Business Profile 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

Do I need my own Meta app to connect customers' Facebook Pages?

No. Customers sign in through easyCoexistence's Meta app, already reviewed by Meta, and your backend works on their Pages through easyCoexistence's API with one ec_live_ key, so there is no App Review on your side.

Can one customer connect several Facebook Pages?

Yes. One sign-in brings the Pages they tick, and later sessions with the same external_ref add more. GET /channels?external_ref= lists them, and each Page counts as one connection.

Can my app send Messenger messages for my customers?

Yes, as replies. An automation on the Page sends each new message to your backend, and the text your backend returns goes out on Messenger within 24 hours of the person's last message.

How much does easyCoexistence cost per Facebook Page?

Each Page your customers connect costs US$ 9 to US$ 0.75 a month, by the band of your total connections, 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