Add a copilot to Facebook

Important

Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.

Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.

You can add your copilot to Facebook Messenger to use the Facebook experience to engage with your end users.

Facebook Messenger and related services are subject to Facebook's own terms and conditions. For support related to Facebook Messenger, contact Facebook directly.

Important

This article is intended for experienced IT professionals who manage your organization's Facebook page.

Note

By publishing your copilot to a Facebook page, some of your data such as copilot content and end-user chat content will be shared with Facebook (meaning that your data will flow outside of your organization's compliance and geographic or regional boundaries).
For more information, see Facebook's Platform Policies.

Add your copilot to Facebook Messenger

You need a Facebook app, and an associated developer account, to connect your Copilot Studio copilot to Facebook Messenger on your Facebook pages.

To connect your copilot to Facebook Messenger:

  1. Configure Facebook app settings: retrieve your Facebook app information, enable API access, add Facebook Messenger to your app, and configure the Facebook pages your app should appear on.

  2. Configure the Facebook publication channel in Copilot Studio.

  3. Connect your Facebook app to Copilot Studio using webhooks.

You will then need to submit your app for Facebook review before you can publish your app and make it public.

Configure Facebook app settings

Retrieve Facebook app information

  1. Sign in to the Facebook app that you want to add your copilot to at Facebook for Developers.

  2. Under Settings on the side menu pane, select Basic .

  3. Copy the App ID and App Secret. You need these values when you configure the Facebook channel in Copilot Studio.

    Get Facebook App ID and secret.

Enable API access for your Facebook app

  1. Sign in to the Facebook app that you want to add your copilot to at Facebook for Developers.

  2. Under Settings on the side menu pane, select Advanced.

  3. Make sure Allow API Access to App Settings is set to Yes.

  4. Select Save Changes to confirm your changes.

    Allow API Access to App Settings.

Add Facebook Messenger to your app

  1. Sign in to the Facebook app that you want to add your copilot to at Facebook for Developers.

  2. Go to the Dashboard. Under the Add a Product section, select Set Up on the Messenger tile.

    Add Messenger product.

Configure Facebook pages

  1. Sign in to the Facebook App that you want to add your copilot to at Facebook for Developers.

  2. Select Settings under Products and Messenger on the side menu pane.

  3. Add the pages you want to add the copilot to by selecting Add or Remove Pages under the Access Tokens section. You can also create a new page by selecting Create New Page.

    Add Facebook page to Facebook app.

  4. When adding pages, make sure Manage and access Page conversations in Messenger is set to Yes.

    Messenger permission for page.

  5. Copy the Page ID and Token for each of the pages that you want to add the copilot to. Select Generate Token for each page. You'll need these when you configure the Facebook channel in Copilot Studio.

    Get page ID and token.

Configure the Facebook channel in Copilot Studio

  1. Open your copilot in Copilot Studio.

  2. On the top menu bar, select Channels.

  3. Select the Facebook tile to open the configuration window.

  4. Paste the App ID, App Secret, Page ID, and Token you retrieved earlier into their corresponding fields.

    Provide Facebook app and page information.

  5. At least one page is required, but you can select Add Page to add additional pages.

    Provide multiple Facebook pages' information.

  6. Select Add and wait for the success confirmation message. Once successful, copy the Callback URL and Verify token. You need these when you connect your Facebook app to Copilot Studio.

    Get callback information for Facebook.

Connect your Facebook app to Copilot Studio

  1. Sign in to the Facebook app that you want to add your copilot to at Facebook for Developers.

  2. Select Settings under Products and Messenger on the side menu pane.

  3. Under the Webhooks section, select Add Callback URL.

    Set up webhooks for Facebook app.

  4. Provide the Callback URL and Verify token from the Configure the Facebook channel in Copilot Studio section and select Verify and Save.

    Add Callback URL and Verify Token.

  5. Select Add Subscriptions for each page that you want to add the copilot to.

    Add webhook subscription.

  6. Select the following fields:

    • messages
    • messaging_postbacks
    • messaging_optins
    • message_deliveries
  7. Select Save.

    Add webhook subscription fields.

Submit for Facebook review

You need to submit your app for Facebook review before you can make your Facebook app public. Facebook requires a Privacy Policy URL and Terms of Service URL. You need to provide those on the Facebook basic app settings page (after signing in to your app at Facebook for Developers, select Basic under Settings on the side menu pane).

The Code of Conduct page contains third-party resources to help create a privacy policy. The Terms of Service page contains sample terms to help create an appropriate Terms of Service document.

Facebook has its own review process for apps that are published to Messenger. You can learn more about it at Sample submissions and Common rejection reasons. Your copilot will be tested to ensure it is compliant with Facebook's Platform Policies before approved by Facebook to become public.

Make the app public and publish the page

Until the app is published, it is in Development Mode. The copilot will not be public and it will work only for admins, developers, and testers.

After the review is successful, in the app's Dashboard under App Review, set the app to Public. Ensure that the Facebook Page associated with the copilot is published. The status appears in the Pages settings.

Remove your copilot from Facebook Messenger

When you do not want the copilot to be reachable in Facebook Messenger, you can remove the copilot from Facebook.

  1. Open your copilot in Copilot Studio.

  2. On the top menu bar, select Channels.

  3. Select the Facebook tile to open the configuration window.

  4. Select Delete.

Updating copilot content for existing conversations on Facebook

To prevent disruptions during a chat between a user and the copilot, existing conversations are not updated to the latest copilot content immediately after a new publish. Instead, the content is updated after the conversation has been idle for 30 minutes.

New conversations between a user and the copilot have the latest published copilot content.

Known limitations

  • You need to create a new copilot if the Customer Satisfaction (CSAT) survey shows up as a non-interactive card image for a copilot created during public preview to access the latest CSAT content.
  • It may take a few minutes before the copilot becomes reachable by users on Facebook pages after the Facebook channel is added.
  • After removing the Facebook channel, it may take a few minutes before the copilot is removed fully and becomes unreachable on Facebook Messenger.
  • After removing a Facebook page, it may take a few minutes before the copilot becomes unreachable by visitors to the removed page through Facebook Messenger.