Skip to content
Back to documentation

Facebook Messenger

Let your agent answer the messages sent to your Facebook Page.

Prerequisites

  • A Facebook Page you administer.
  • A Meta developer account to create the app (not needed when your AgentPro workspace offers "Continue with Facebook").
  • An AgentPro agent that is Active, with knowledge added.

Two ways to connect

Continue with Facebook

If the channel page shows a Continue with Facebook button, sign in with the account that manages your Page and pick the Page. AgentPro stores the tokens, subscribes the app to the Page and verifies the webhook for you. This option appears when the platform operator has registered a Meta app.

Your own Meta app

Follow the steps below. You stay in control of the app and its review status; it takes about fifteen minutes.

Setup with your own Meta app

  1. 1

    Create a Meta app and add Messenger

    At Meta for Developers create an app of type Business and add the Messenger product. Connect the Facebook Page you want the agent to answer for and generate a Page access token. Note the Page ID, and the App ID and App secret from Settings → Basic.
  2. 2

    Create the channel in AgentPro

    In the dashboard open Channels → Facebook Messenger, pick the agent that should answer and enter the Page access token, Page ID, App ID and App secret. Before anything is saved AgentPro asks Meta to confirm that the token belongs to that Page, that it was issued by that app, and that it carries the pages_messaging permission. A wrong value is explained field by field. The channel is created with the status Waiting for webhook.
  3. 3

    Add the webhook in your Meta app

    In Messenger → Settings → Webhooks, set the callback URL to the one shown on the channel page:
    https://agentpro.chat/api/v1/webhooks/messenger/<channelId>

    The verify token is the channel secret shown next to the URL (copy it from the channel page; you can regenerate it there at any time). When Meta calls the URL with the right token the channel page switches to Connected by itself.

  4. 4

    Subscribe the app to your Page

    Webhook fields and Page subscription are two separate things in Meta. Under the webhook settings, subscribe your Page to messages, messaging_postbacks, message_deliveries and message_reads. Leave message_echoes unsubscribed. The channel page has a one-click Subscribe app to Page button that does the same through the API, and the connection checklist shows whether the subscription is in place.
  5. 5

    Go live

    A Meta app in Development mode can only message people who hold a role on the app (admins, developers, testers). To answer the public, request Advanced access for pages_messaging under App Review, complete business verification if Meta asks for it, and switch the app to Live. Then send a message to your Page from another account: the agent replies, and the conversation appears in your AgentPro inbox.

How it works

  • Every inbound event is checked against the signature Meta sends using your App secret. Events without a valid signature are rejected and the rejection is shown on the channel page, so a wrong App secret is visible within a minute.
  • Meta is acknowledged immediately; the reply is generated in the background and sent with a typing indicator. A redelivered event is recognised by its message ID and never answered twice.
  • Messages create a conversation on the linked agent and are mirrored into the inbox. Delivery and read receipts update the agent's messages.
  • Pausing AI on a conversation in the inbox lets an agent reply from AgentPro. Replies go back through Messenger: within 24 hours of the customer's last message as a normal reply, afterwards with Meta's HUMAN_AGENT tag (allowed for seven days). If Meta refuses a reply, the inbox shows why.
  • Photos, files, stickers and voice notes are stored in the inbox, and the customer gets a short reply asking them to type their question (the agent reads text only). You can change that text in the channel configuration.
  • A rejected or expired Page token flips the channel to Needs attention and notifies the workspace owners. A customer who blocked the Page only fails that one message.
  • Regenerating the verify token does not interrupt message flow; it is only needed the next time Meta verifies the callback URL.

Troubleshooting

  • Verification failed: the verify token must match the channel secret exactly, the callback URL must contain the channel ID shown in the dashboard, and the credentials must be saved first.
  • No replies and "Meta last reached us: not yet": the app is not subscribed to the Page, or the app is in Development mode and the sender has no role on it. Run Test connection on the channel page; the checklist names the missing piece.
  • "Webhook rejected" on the channel page: the App secret you entered is not the one from the app that owns the webhook. Re-enter it under Update credentials.
  • Invalid credentials when saving: the message tells you whether the token belongs to another Page, was issued by a different app, or lacks pages_messaging. Regenerate the token for the right Page with that permission.
  • Token expiring: tokens generated through a short-lived user session expire after about 60 days; the channel page warns you a week ahead. Tokens generated for a System User in Meta Business Settings do not expire.
  • The agent answers its own messages: message_echoes is subscribed in the Meta app. Unsubscribe it.