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

# Adding the Facebook Messenger Channel

<Badge icon="arrow-left" color="gray">[Back to Available Channels](/ai-for-service/channels/adding-channels-to-your-bot#available-channels)</Badge>

To add the Facebook Messenger channel to your AI Agent, you need a **Facebook Developer** account. With this account, you can configure the connection between Facebook Messenger and Kore.ai. Enabling the Facebook Messenger Channel on the App Builder helps your users chat with the AI Agent using their **Facebook** accounts.

The steps to enable this channel are simple and summarized below:

1. [Create and set up a Facebook Messenger App](#step-1-create-and-set-up-a-facebook-messenger-app).
2. [Configure the Webhook or Callback URL to send and receive messages](#step-2-configure-the-webhookcallback-url).
3. [Subscribe to the app on the Facebook page using the Client ID and Client Secret](#step-3-set-up-app-id-and-secret).
4. [Submit the App for Approval.](#step-4-submit-the-app-for-approval)
5. [Enable the channel and complete the configuration on the Platform](#step-5-enable-the-channel).

## Step 1: Create and Set up a Facebook Messenger App

1. Log in to the [Facebook Developer Portal](https://developers.facebook.com/micro_site/url/?click_from_context_menu=true\&country=IN\&destination=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fdevelopment%2Fregister\&event_type=click\&last_nav_impression_id=0pWTvRHj057BWQ868\&max_percent_page_viewed=65\&max_viewport_height_px=657\&max_viewport_width_px=1366\&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fdevelopment%2Fcreate-an-app%2F\&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fdocs%2Fnav%2F%3Fpath1%3Ddevelopment%26path2%3Dcreate-an-app\&region=apac\&scrolled=true\&session_id=0lMcuYhMqR7uUNlDe\&site=developers) and click the **My Apps** top menu option.

   <img src="https://mintcdn.com/koreai/Xvq3iiQKgIBbMHlt/ai-for-service/channels/images/fbm.png?fit=max&auto=format&n=Xvq3iiQKgIBbMHlt&q=85&s=63f53173afce557e9897dc5415075eeb" alt=" Facebook app" width="1054" height="391" data-path="ai-for-service/channels/images/fbm.png" />

   <Note>    New users should [register](https://developers.facebook.com/micro_site/url/?click_from_context_menu=true\&country=IN\&destination=https%3A%2F%2Fdevelopers.facebook.com%2Fasync%2Fregistration\&event_type=click\&last_nav_impression_id=0z1et1xpn4nZpYCfR\&max_percent_page_viewed=30\&max_viewport_height_px=657\&max_viewport_width_px=1366\&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fdevelopment%2Fregister%2F\&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fdocs%2Fnav%2F%3Fpath1%3Ddevelopment%26path2%3Dregister\&region=apac\&scrolled=false\&session_id=1SbEaGTlt1aWgLNff\&site=developers) on the **Facebook Developer Portal**. [Learn more](https://developers.facebook.com/docs/development/register).</Note>

2. In the **My Apps** section, click **Create App**.
   <img src="https://mintcdn.com/koreai/Xvq3iiQKgIBbMHlt/ai-for-service/channels/images/fbm1.png?fit=max&auto=format&n=Xvq3iiQKgIBbMHlt&q=85&s=c12727d6e99c28e19e71bea22ff01889" alt=" Facebook My apps" width="1003" height="453" data-path="ai-for-service/channels/images/fbm1.png" />

3. In the **Select an App Type** window, select the **Business** tab, and click **Next**.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm2.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=5efa5d510d80875ff93d8854e4ead03e" alt=" Facebook Business" width="840" height="615" data-path="ai-for-service/channels/images/fbm2.png" />

4. In the **Details** section, enter the required details, and click **Create App**.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm3.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=2fb7b5308effabc195381888068d52ec" alt=" Facebook create app" width="899" height="366" data-path="ai-for-service/channels/images/fbm3.png" />

5. Provide your account password in the **Please re-enter your password** window when prompted, and click **Submit**.

6. Your App is now created and you are redirected to the **Add products to your app** page.

7. Click **Set Up** on the **Messenger** tab.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm4.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=fb853c71ee2b82e8270595ea6a22ee9b" alt=" Facebook add products" width="1040" height="363" data-path="ai-for-service/channels/images/fbm4.png" />

8. You now need to associate a page with the app. If you do not have a page, click **Create New Page** in the **Access Tokens** panel.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm5.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=6e9a7cd080841a2449b7634f833a2eac" alt=" Facebook access token" width="867" height="334" data-path="ai-for-service/channels/images/fbm5.png" />

9. Click **Add or Remove Pages** and follow the instructions to add your page.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm6.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=f8b412051716917471caf8664c14a020" alt=" Facebook remove pages" width="854" height="325" data-path="ai-for-service/channels/images/fbm6.png" />

10. Click **Generate Token**.
    <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm7.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=a7df89c7f147a15e73ad4594a494a9a4" alt=" Facebook generate token" width="897" height="314" data-path="ai-for-service/channels/images/fbm7.png" />

11. In the **Token Generated** window, select **I understand** and click **Copy** to copy the page Access Token.  <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm8.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=3a2a3ca3e427dfb50e0e93cad67f4ed5" alt=" Facebook generated token" width="738" height="390" data-path="ai-for-service/channels/images/fbm8.png" />

12. Click **Done**.

13. Copy the **Page ID** of the Facebook page.  <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm9.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=5527157415c4c1923493da131348c82e" alt=" Facebook configuration" width="917" height="316" data-path="ai-for-service/channels/images/fbm9.png" />

14. On the Platform, navigate to **Channels & Flows** > **Channels** > **Digital** > **All** > **Facebook Messenger**.

15. Click the **Configurations** tab, and paste the **Page Access Token** and **Page ID** values you’ve copied.  <img src="https://mintcdn.com/koreai/Xvq3iiQKgIBbMHlt/ai-for-service/channels/images/fbm11.png?fit=max&auto=format&n=Xvq3iiQKgIBbMHlt&q=85&s=9f5ba29a29029cc75fbabc21c23b9f21" alt=" Facebook page access" width="735" height="485" data-path="ai-for-service/channels/images/fbm11.png" />

16. Navigate to **Settings** > **Basic** and configure the **Privacy Policy URL** and **Terms of Service URL** fields for the app.
    <img src="https://mintcdn.com/koreai/Xvq3iiQKgIBbMHlt/ai-for-service/channels/images/fbm12.png?fit=max&auto=format&n=Xvq3iiQKgIBbMHlt&q=85&s=4e452226ebf520f78b00cccef7c0db01" alt=" Facebook Privacy" width="917" height="491" data-path="ai-for-service/channels/images/fbm12.png" />

17. Click **Save Changes**.

18. Enable the deployment of the app by changing **App Mode: Development** to **Live**.
    <img src="https://mintcdn.com/koreai/Xvq3iiQKgIBbMHlt/ai-for-service/channels/images/fbm13.png?fit=max&auto=format&n=Xvq3iiQKgIBbMHlt&q=85&s=c8c19eb9f126f25457ff8920eb82ed4b" alt=" Facebook Save Changes" width="972" height="248" data-path="ai-for-service/channels/images/fbm13.png" />

## Step 2: Configure the Webhook/Callback URL

To set up the webhook URL, follow the steps below:

1. Copy the **Webhook URL** and **Verify Token** from the Platform’s channel configuration panel.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm14.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=0cc896545b74cffae5f2f44c6bb26c73" alt=" Facebook Webhook URL" width="693" height="278" data-path="ai-for-service/channels/images/fbm14.png" />

2. On the **Messenger Settings** page of the Facebook Developer Portal, click **Add Callback URL**.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm15.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=6df9fe0152652a4c4add2da60f845636" alt="Copy Facebook Webhook URL" width="837" height="401" data-path="ai-for-service/channels/images/fbm15.png" />

3. Paste the copied values in the **Edit Callback URL** window, and click **Verify and Save**.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm16.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=53c5bfbc52a951f7463a1920d67c9fc7" alt="Edit Facebook Callback URL" width="676" height="268" data-path="ai-for-service/channels/images/fbm16.png" />

4. The webhook URL is successfully set up.

5. Click **Add Subscriptions**.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm17.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=d645d6ca55f1aef4e604b51e474bff0a" alt="Facebook add subscriptions" width="753" height="166" data-path="ai-for-service/channels/images/fbm17.png" />

6. Select **messages**, **messaging\_postbacks**, **messaging\_optins**, **message\_deliveries**, and **message\_reads** in the **Edit Page Subscriptions** window to select the webhook services.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm18.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=288ef37295b6036e34815720651d7b98" alt="Facebook details" width="667" height="512" data-path="ai-for-service/channels/images/fbm18.png" />

7. Click **Save**.

## Step 3: Set up App ID and Secret

To configure the **Client ID** and **Client Secret** for the app, follow the steps below:

1. On the **Facebook Messenger Developer Portal**, navigate to **Settings** > **Basic**.

2. Copy the **App ID** and **App Secret** values.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm19.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=125dd52013896e715d083f06fc9c8aa6" alt="Facebook Messenger Developer" width="949" height="445" data-path="ai-for-service/channels/images/fbm19.png" />

3. On the Kore.ai App Builder, navigate to the **Configurations** section of the Facebook Messenger channel and paste these values in their respective fields.
   <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm20.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=d73b7240db4e70826ddad45c754c2802" alt="Facebook messenger channel" width="613" height="255" data-path="ai-for-service/channels/images/fbm20.png" />

## Step 4: Submit the App for Approval

Configure any other settings that Facebook might require, then submit the app for approval. [Learn more](https://developers.facebook.com/docs/messenger-platform/app-review#submission).

Once approved, you can enable the **Facebook Messenger** channel for your assistant with the steps mentioned below.

## Step 5: Enable the Channel

On the Platform, enable the **Facebook Messenger** channel to complete the integration. To enable follow the steps below:

1. Navigate to **Channels & Flows** > **Channels** > **Digital** > **All** > **Facebook Messenger**.

2. Click the **Configurations** tab, and select **YES** for **Enable Channel**.  <img src="https://mintcdn.com/koreai/bwTBS2L_ljod2EHO/ai-for-service/channels/images/fbm21.png?fit=max&auto=format&n=bwTBS2L_ljod2EHO&q=85&s=a62c6f3d31af81c6f6c4be9b41013094" alt="Enable Facebook channel" width="534" height="146" data-path="ai-for-service/channels/images/fbm21.png" />

3. Click **Save**.

After enabling the channel and verifying all the configurations, you can optionally publish the app for the new channel. Learn more about [Publishing your App](/ai-for-service/deployment/publishing-app).
