> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Messenger

> Answer Facebook Page messages with an assistant

Messenger lets the assistant answer people who message your Facebook Page. A customer writes on the Page, the assistant replies in that chat, and the thread is kept in History so a teammate can take over.

## When to use it

Use it when the Page is already where customers ask for help: opening hours, an order, or a handoff to a person. Connecting an assistant means those Page messages use that assistant's instructions and tools, instead of sitting unread in the Page inbox.

## What the assistant hears

The assistant hears messages sent to the Facebook Page you connect. **Connect with Facebook** subscribes the Page for you. A manual app must subscribe the `messages` webhook itself.

## Where the keys come from

The linked provider guide shows the screens for these clicks. Follow the clicks below together with those pictures.

**Connect with Facebook** does not ask you to copy a token. A manual app is created at [developers.facebook.com](https://developers.facebook.com). You need the **Page access token**, the **App secret** from the app's basic settings, and a **Verify token** that you invent and type in both places. The callback address must be HTTPS. Official product: [Messenger Platform](https://developers.facebook.com/docs/messenger-platform).

## Create it at the provider

Skip this section if you use **Connect with Facebook**.

1. Open [developers.facebook.com](https://developers.facebook.com) and create an app.
2. Add the **Messenger** product.
3. Generate a **Page access token** for the Page the assistant should answer.
4. Copy the **App secret** from the app's basic settings.
5. Choose any **Verify token** string. You will type the same string in Famulor.
6. After the Famulor connection exists, paste the webhook URL as the callback, subscribe to **messages**, and save.

## Connect it in Famulor

Your plan includes this channel. Open **Settings → Channels**, choose the card, name the connection, pick an assistant and save. The shared conversation settings — response delay (default 5 seconds) and inactivity timeout (default 30 minutes) — are described on the [messaging channels](https://docs.famulor.io/channels/messaging.md) page.

**Connect with Facebook** is available on the Famulor platform domain, for a root workspace, and needs HTTPS. It uses the same platform Meta app as WhatsApp. It is not offered on a whitelabel domain. There, choose **Show manual credentials** and paste **Page access token**, **App secret**, **Verify token (choose any string)**, and optionally **Page name (optional)**.

## Point the provider at Famulor

A Facebook login does not need a URL. For a manual app, open the connection menu, choose **Copy webhook URL**, paste it as the Messenger callback, enter the same verify token, subscribe to **messages**, and save. A new Page message appears in History.

## History

Open [History](https://docs.famulor.io/monitoring/history.md) and filter by **Messenger**. The thread, the assistant reply and any analysis appear there. You can pause the assistant and answer manually.

## API, MCP and command line

On a root workspace, use `GET /api/v1/messenger/facebook-login` to get the Facebook Login configuration. After Facebook Login, call `POST /api/v1/messenger/facebook-login/pages` or `list_messenger_facebook_pages` with the returned `code` or classic `access_token`. Within 10 minutes, send the chosen Page's `id` as `page_id` together with its `page_selection` to `POST /api/v1/messenger/facebook-login` or `complete_messenger_facebook_login`. Use the same workspace and credential for both calls. The SDK exposes these operations as `listMessengerFacebookPages` and `completeMessengerFacebookLogin`.

For Business Login, open the OAuth dialog with the returned `config_id`, `response_type=code`, and the platform's registered root URL (including the final slash) as `redirect_uri`.

```bash theme={null}
famulor get-messenger-facebook-login-config
famulor list-messenger-facebook-pages --code FACEBOOK_LOGIN_CODE
famulor complete-messenger-facebook-login --assistant-id ASSISTANT_UUID \
  --page-id FACEBOOK_PAGE_ID --page-selection PAGE_SELECTION
```

```ts theme={null}
const { data } = await client.api.listMessengerFacebookPages(
  { body: { code: facebookLoginCode } },
  { maxRetries: 0 },
);

const selectedPage = data?.pages?.find((page) => page.id === selectedPageId);
if (selectedPage) {
  await client.api.completeMessengerFacebookLogin({
    body: {
      assistant_id: assistantId,
      page_id: selectedPage.id,
      page_selection: selectedPage.page_selection,
    },
  });
}
```

```bash theme={null}
famulor create-messaging-connector --platform messenger --name "Page" \
  --assistant-id ASSISTANT_UUID --page-access-token EAAB… --app-secret … \
  --verify-token my-verify-token --page-name "Acme Support"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.