How to connect a Facebook Page to an API or AI agent
A Facebook Page connects to an API or AI agent through Facebook Login for Business. Someone who owns the Page or can perform tasks on it signs in with Facebook and approves the app's Page permissions, for publishing, comments, Messenger and insights; the app then reads each Page's access token from /me/accounts, a token with no expiration date when it comes from a long-lived user token.
easyCoexistence connects your Facebook Pages in one sign-in with Facebook Login for Business, keeps each Page's token encrypted and checks it every 6 hours, so Claude, ChatGPT or your own platform can publish, schedule, reply to comments and DMs and read insights through Meta's official API.
To get a Page token from a person, that person must own the Page or be able to perform a task on it.
A person given Admin access to a Page in Facebook's interface can perform all tasks on that Page.
Long-lived Page access tokens, generated from a long-lived user token, have no expiration date.
People with task access manage the Page in tools such as Meta Business Suite, not directly on Facebook.
How long an easyCoexistence connect link works before its session expires.
Who can connect a Page?
Someone who owns the Page or can perform tasks on it, since Meta issues a Page access token only to such a person. In Facebook's Page access settings that means Facebook access, with full or partial control, or task access, used from Meta Business Suite or Ads Manager; Meta's Pages API overview adds that Admin access covers all tasks. Each call is then checked against that person's tasks, so connect from the account whose access covers the work:
- Publishing posts:
CREATE_CONTENT. - Replying to and deleting comments: MODERATE.
- Messenger replies and private replies: MESSAGING.
- Insights: ANALYZE.
What does the person see when signing in?
Facebook's own login window, run by Facebook Login for Business. The app opens Facebook's login dialog with the config_id of a configuration that names the token type, the assets and the permissions it needs; with a user access token configuration, the person logs in with their personal Facebook account and grants the app access to their Pages. Facebook returns a code, which the app's server exchanges for a user token, then a long-lived one, before reading /me/accounts for each Page and its token.
What is each permission for?
The person approves them together in the same window, and each one opens part of the Graph API. easyCoexistence requests these nine, so an agent can publish, reply and measure on the Page; each note is what Meta's permissions reference says the permission allows:
Which Pages become connections?
Each Page the sign-in returns with a token becomes its own connection, billed like any other. A Page already live on another easyCoexistence account stays there and is reported as already connected, so nobody with access to it can pull it away from a paying account. Signing in again later brings in Pages added since, and refreshes the token of those already connected.
How do you connect it to easyCoexistence?
From the dashboard, in one sign-in: choose New connection, then Facebook, sign in with the Facebook account that runs the Page and pick the Pages. An account with no card on file is asked for one first, since each connection is billed. When Facebook hands back, each Page reads Connected, and easyCoexistence subscribes it to the feed, messages and mention webhook fields, keeps its token encrypted and checks it every 6 hours.
How does a platform connect its customers' Pages?
With a hosted connect link from the Partner API. Your backend posts to /api/v1/connect-sessions with channel set to facebook and a redirect_url, then sends the customer to the url it returns, where they continue with Facebook, with no easyCoexistence account of their own. The browser comes back with the session, the status and a channel_id, which your backend confirms with GET /connect-sessions/:id. Each Page the sign-in connected is announced with a channel.connected event and carries your external_ref, unless it was already tagged for another of your customers.
curl -X POST https://easycoexistence.com/api/v1/connect-sessions \
-H "Authorization: Bearer $EC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "facebook",
"redirect_url": "https://app.example.com/connect/return",
"external_ref": "customer_4821"
}'What happens after it connects?
The Page is ready for whatever works on it. list_social_accounts returns it to Claude, ChatGPT or your own agent, get_social_credentials hands its Page ID and API base to your code, and its feed changes, Messenger messages and mentions go to your endpoint once you set one, with set_social_webhook_destination or PUT /api/v1/channels/:id/webhook.
Why would a connection fail?
Usually for one of four reasons, each with a direct fix:
- The person runs no Page: Facebook returns none to connect, so sign in as someone with access to it.
- The person cancelled the sign-in: nothing connects, and starting again opens a fresh window.
- The Page is already connected to another easyCoexistence account: remove it there first.
- The connect link was opened after its hour: create a new session.
How to set it up
- Check your accessMake sure your Facebook account has full control, partial control or task access on the Page.
- Start the connectionIn the easyCoexistence dashboard, choose New connection, then Facebook.
- Approve the permissionsSign in with Facebook and approve access for the Pages you want to connect.
- Point your AI at itAdd https://easycoexistence.com/api/mcp to Claude or ChatGPT, or call the Page from your own code.
Common mistakes
- Connecting through someone about to leave the business. The Page token rests on that person's access and stops working when they lose it, so sign in from an account that will stay.
- Trusting the redirect's status on its own. Anyone can type status=connected into a URL, so confirm the session with GET /connect-sessions/:id from your backend.
- Sending webhook_url on a Facebook connect session. The API refuses it there; set each Page's event relay with PUT /api/v1/channels/:id/webhook once it connects.
- Reading only the channel_id in the redirect. One Facebook sign-in can connect several Pages, so list them with GET /api/v1/channels, filtered by channel and external_ref.
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
Do I need my own Meta developer app to connect a Page?
No. easyCoexistence's Meta app asks for the Page permissions, so the person signs in with Facebook and approves them, with no app, App Review or Business Verification of their own.
Can someone with task access connect a Page?
Yes, if the tasks cover the work: Meta gives a Page token to anyone who can perform a task on the Page, then checks each call against that person's tasks.
Can I connect several Facebook Pages?
Yes. Each Page from the sign-in becomes its own connection, billed at US$ 9 to US$ 0.75 per connection per month as your total grows.
What if the Page is already connected elsewhere?
It cannot join a second easyCoexistence account while it is live on the first. Remove it there, then connect it again.
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