> For the complete documentation index, see [llms.txt](https://docs.1millionbot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1millionbot.com/chatbot/channels/instagram-messenger.md).

# Instagram Messenger

## Set up

> Meta frequently updates and redesigns its developer console, so the steps and menu names in this guide may become outdated. If something doesn't match what you see on screen, check Meta's official, always up-to-date documentation: [Instagram API with Instagram Login – Messaging](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login/messaging-api).

To set up your agent integration in Instagram Messenger, you will need the following:

* A Facebook account registered in the [developer console](https://developers.facebook.com/).
* A Facebook page connected to Meta Business.
* An Instagram account connected to Meta Business.

### Create a Meta app

> Meta assigns "use cases" when creating the app: Instagram is no longer activated by looking for the product in the Dashboard, but by selecting a dedicated use case during the app's own creation.

1. Access the [Meta developers console](https://developers.facebook.com/apps/).
2. Click on 'Create app'.
3. Enter the app name and a contact email.
4. On the use case selection screen, choose **'Manage messaging and content on Instagram'** and click 'Next'.
5. Select an existing business portfolio linked to your Meta Business, or create a new one.
6. Review the publishing requirements (they may appear empty at this point) and click 'Create app' to finish.

Once created, go to the app's **Dashboard** section, select that use case and click 'Customize' to configure it.

### Generate a Permanent Access Token

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. In the first step, click on 'Add Account'.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-9bdab8e9ba4f533fa2eb8b2defeb0a88f40fe814%2FIG_17.png?alt=media)
3. Log in with the Instagram account you want to connect to the agent.\\
4. Save and click on 'Generate Token'.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-34ec88d4e23716170c9c3a24708af979d4646399%2FIG_20.png?alt=media)
5. Copy the generated token for future use. ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-92245d1ef03f6c85158be093c8ae919ecce3dd4f%2FIG_18.png?alt=media)

### Obtain the Instagram Page ID

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. Copy the Page ID displayed below the Instagram account.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-34ec88d4e23716170c9c3a24708af979d4646399%2FIG_20.png?alt=media)

### Obtain the application secret key

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. In the third step, click on 'Configure' and add the URL of your website and save.
3. Again, click on 'Configure business login' and copy the Instagram application secret key.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-a84777ff3bbf1a2b5981d09017605d30dc66a38b%2FIG_22.png?alt=media)

### Connect your app with your agent

#### Activate integration in 1millionbot platform

1. Go to the **Channels** section on the platform.
2. Activate Instagram and click on 'Settings'.
3. Enter the previously obtained data: Application Secret Key, Permanent Access Token and Instagram Page ID
4. Click on 'Save'.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2FkBXs1fdtKLBByVRyfcph%2FIG_7.png?alt=media\&token=3af8ae97-fc98-473b-9436-568c1c9e16e1)

#### Activate integration in Meta

**Obtain the Callback URL**

1. Go to the 1millionbot platform and click on the 'Info' button in the Instagram channel to get the callback URL.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2FRW1Vwjt93NXl8XF61iJF%2FIG_8.png?alt=media\&token=01624692-adc1-441f-a197-63326047c13b)

**Configure the Meta Webhook**

1. In the **Instagram** > **Setting up the API with Instagram login** menu section, click on 'Edit' or 'Add' in the **Webhook** section (second step).\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-9bdab8e9ba4f533fa2eb8b2defeb0a88f40fe814%2FIG_17.png?alt=media)
2. Paste the previously obtained callback URL and Permanent Access Token.
3. Click on 'Save'.

### Set permissions

1. In the previous section, click on 'Administrate'.
2. Subscribe to messages permissions.\
   ![](https://2695835661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8C1OyhEMqQrgYKVMdeJ%2Fuploads%2Fgit-blob-c5aa6aaa70fbaae5ab67916a7cb4aa1be61b6259%2FIG_19.png?alt=media)

### Publish Meta app

1. While your application is in development mode, you can only test the agent's operation if you are the owner or have access to the connected Instagram account.
2. Since the application only sends and receives messages on the Instagram account you connect yourself — not on third-party accounts — Meta automatically grants **Standard Access** to the `instagram_business_manage_messages` permission. This means **you don't need to submit the application for Meta App Review** to publish it: full review (Advanced Access) is only required when a single app needs to manage Instagram accounts you don't administer — for example, a platform serving many different clients' accounts from a single app — which isn't the case for this integration.
3. To publish the agent for public interaction, complete any remaining information Meta requests in the app's Dashboard and switch the use case's status from "In development" to "Live".
4. Done! Once published, perform tests to verify the operation of your agent on the provided Instagram account. 🎉

## Limitations

* A maximum of (200 \* Number of Engaged Users) messages can be sent per day per bot.
* You can only reply within 24 hours of the user's last message.
* Buttons must have a maximum of 20 characters.
* Maximum of 3 buttons per message.
