> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/serve/choose-channel/fb.md).

# Connect a Messaging Platform: FB Messenger

Connect an AI agent to Messenger for a Facebook Page, including permission prerequisites, the authorization process, and FAQs

## <mark style="color:blue;">Before You Connect</mark> <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

**MaiAgent preparation**

* You have created an “AI agent” on the [MaiAgent platform](https://admin.maiagent.ai/).

**Facebook permission preparation**

* Your Facebook account has been invited to or has created a business portfolio.
* You have full control of that business portfolio.

**Page permission check**

* If the Page is already in the business portfolio: No additional changes are required.
* If the Page is not in the business portfolio: You must be an administrator of the Page and have full control.

{% hint style="info" %}
**Don't have a business portfolio yet?** Follow Meta's official instructions to [create a business portfolio](https://www.facebook.com/business/help/1710077379203657). The creator automatically receives full control.

**How do I check whether I have full control?** Go to <mark style="color:blue;">Settings → Users → People</mark> in [Meta Business Suite](https://business.facebook.com/), then select your name to view your permissions. If you only have partial access, ask a member with full control of the portfolio to update your permissions. See [Meta's official instructions](https://www.facebook.com/business/help/442345745885606) for details.

**Must I add the Page to the business portfolio first?** Not necessarily. You can claim the Page during authorization. If you prefer to organize it in advance, follow [Meta's official instructions](https://www.facebook.com/business/help/720478807965744) to add the Page to the portfolio.
{% endhint %}

{% hint style="warning" %}
A Page can be connected to only one messaging platform. To connect it to another AI agent, first delete the original messaging platform, then connect it again. To connect Instagram Direct for the same Page, create a separate [Instagram](/maiagent-user-guide/en/serve/choose-channel/instagram.md) messaging platform.
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-d6d1aa18fa70dede47b7daeaed0a4f0eadf3febf%2Fimage%20(12)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Start Connecting</mark> <a href="#start-integration" id="start-integration"></a>

### 1. Go to the messaging platform page in MaiAgent and select “Connect Messaging Platform” <a href="#step-go-to-maiagent-channel-page" id="step-go-to-maiagent-channel-page"></a>

a. Select <mark style="color:blue;">Connect Messaging Platform</mark> in the upper-right corner.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-45051526831861d07352f6b1084732e923c9fa5b%2Fimage%20(102).png?alt=media" alt=""><figcaption></figcaption></figure>

b. Select Messenger.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-54c2a072dbdd6e95a23e672d6d7779e764381955%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-21%20122626.png?alt=media" alt=""><figcaption></figcaption></figure>

c. Click <mark style="color:blue;">Log in with Facebook</mark> and sign in with the Facebook account that manages the Page. MaiAgent accesses only messages from the Pages you authorize and does not access your personal messages.

{% hint style="warning" %}
Make sure your browser allows pop-ups. Otherwise, it may block the Facebook login window.
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-dc446ea48022138a20907b9d1282def9e546042a%2Fimage%20(5)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### 2. Select a business and select (claim) the Page. <a href="#step-select-business-and-page" id="step-select-business-and-page"></a>

In the Facebook authorization window, first select the business portfolio to authorize, then check the Page you want to host (claim).

Confirm the authorization. Once the connection is created successfully, hosting is complete.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-711739d48ba4820003d4771f15abed0475eff185%2Fimage%20(13)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### 3. AI agent settings <a href="#step-ai-agent-settings" id="step-ai-agent-settings"></a>

| Field                       | Description                                                                                                                                                             |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Messaging platform name** | Give this connection a name so you can identify it easily.                                                                                                              |
| **AI agent**                | Select the AI agent that will reply to Messenger messages.                                                                                                              |
| **Select Page**             | In the list under <mark style="color:blue;">Messenger channel</mark>, select the Page you just claimed.                                                                 |
| **Enable reset commands**   | (Optional) When enabled, you can configure one or more commands. When a user sends one of these commands in Messenger, a new conversation begins, such as “Start over.” |

{% hint style="info" %}
If the Page list is not updated after authorization, click <mark style="color:blue;">Reload</mark> in the upper-right corner of the <mark style="color:blue;">Messenger channel</mark> section to authorize it again.
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-0bd1984760eed7ad89aaf3ddcfb63d6aaab0c98b%2Fimage%20(106).png?alt=media" alt=""><figcaption></figcaption></figure>

### 4. Verify the connection <a href="#step-verify-integration" id="step-verify-integration"></a>

Next, try sending a test message to this messaging platform from an internal MaiAgent conversation. If the AI agent replies normally, the connection was successful.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-1542ac8f364fb8abc6d3679953254b1d50961586%2Fimage%20(14)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

You can also open a conversation with the AI agent from the Page and send a test message. If the bot replies normally, the connection was successful.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-74d2aed8c0d151071b721aba80dbfe3627258b24%2Fimage%20(10)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

After the connection succeeds, MaiAgent automatically subscribes to message events for the Page through Meta. You do not need to configure a separate Webhook.

{% hint style="info" %}
After the connection succeeds, click Edit in the messaging platform list to configure additional options, including OCR, answering with the system time or sender name, handoff to a human agent, conversation tags, and access control. For details, see [Messaging Platform Settings Overview](/maiagent-user-guide/en/serve/platform-settings.md).
{% endhint %}

## <mark style="color:blue;">Supported Message Types</mark> <a href="#supported-message-types" id="supported-message-types"></a>

| Direction       | Supported content                                                                |
| --------------- | -------------------------------------------------------------------------------- |
| User → AI agent | Text, images, videos, voice messages, and stickers; OCR can be used with images. |
| AI agent → User | Text and images                                                                  |

## <mark style="color:blue;">FAQ</mark> <a href="#faq" id="faq"></a>

### Q: Why is the Page list empty after authorization? <a href="#faq-empty-page-list" id="faq-empty-page-list"></a>

The Facebook account you used to log in does not have full control of the Page, or the Page was not selected during authorization. Follow [Before You Connect](#pre-integration-checklist) to check the permissions, log in again as a Page administrator, and make sure the correct Page is selected in the authorization window.

### Q: Why does “This Page ID is already in use” appear when I save? <a href="#faq-page-already-used" id="faq-page-already-used"></a>

The same Page is already connected to another messaging platform in the organization. Delete the original messaging platform, then create it again.

### Q: Why hasn't MaiAgent received a user's message? <a href="#faq-no-incoming-message" id="faq-no-incoming-message"></a>

Make sure the authorized Facebook account is still an administrator of the Page and that the Page remains in the business portfolio selected during authorization. If the authorization has expired or the Page permission has been removed, delete the messaging platform and connect it again.

### Q: Can Messenger and Instagram use the same AI agent? <a href="#faq-share-agent" id="faq-share-agent"></a>

Yes. They are separate messaging platforms and can be linked to the same AI agent, or you can configure different options for each platform. For instructions on connecting Instagram, see [Connect a Messaging Platform: Instagram](/maiagent-user-guide/en/serve/choose-channel/instagram.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/serve/choose-channel/fb.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
