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

# Instagram via Instagram Business Login

> Connect your Instagram Professional account to ChatbotX using the recommended Instagram Business Login method to automate conversations.

Connecting your Instagram account to ChatbotX allows you to automate responses, handle customer queries instantly, and manage all your direct messages from a single dashboard. This guide explains how to connect Instagram to ChatbotX using the recommended **Instagram Business Login** method, which provides a direct and reliable connection.

## Prerequisites

Before starting the setup, ensure you have:

* A valid Facebook account.
* A valid Instagram Professional account (either Business or Creator type).
* A publicly accessible ChatbotX installation with an HTTPS URL.

<Info>
  If you are running your instance locally, you need a tunneling tool like [ngrok](/docs/channels/local-development-with-tunnels) to expose your local port to the internet. This allows Meta's servers to reach your webhook callback URL.
</Info>

## Step 1: Create a Meta Developer App

To connect your Instagram account, you first need to create a developer application on Meta's platform. This app acts as a secure bridge that allows ChatbotX and Instagram to share message data safely.

<Steps>
  <Step title="Create a new app">
    Go to the [Facebook Developer Portal](https://developers.facebook.com/apps/) and click **Create App**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/mnigC960BtWx0ZdQ/images/facebook-create-app.avif?fit=max&auto=format&n=mnigC960BtWx0ZdQ&q=85&s=b08e72cb1568ba0eb507b8564b585104" alt="Facebook Create App" width="1650" height="518" data-path="images/facebook-create-app.avif" />
    </Frame>
  </Step>

  <Step title="Enter app details">
    Enter your **App name** and **contact email**, then click **Next**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/mnigC960BtWx0ZdQ/images/facebook-business-details.avif?fit=max&auto=format&n=mnigC960BtWx0ZdQ&q=85&s=e22b5a942aa4766aa7e2ca359bd2008d" alt="Facebook Business Details" width="1650" height="703" data-path="images/facebook-business-details.avif" />
    </Frame>
  </Step>

  <Step title="Select a use case">
    When asked for a use case, select **Other**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/mnigC960BtWx0ZdQ/images/facebook-other-app.avif?fit=max&auto=format&n=mnigC960BtWx0ZdQ&q=85&s=5c1e2a15c5ea900894bad7cbbf83fabf" alt="Facebook Other App" width="1650" height="1310" data-path="images/facebook-other-app.avif" />
    </Frame>
  </Step>

  <Step title="Choose app type">
    For the app type, choose **Business**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/mnigC960BtWx0ZdQ/images/app-type-business.avif?fit=max&auto=format&n=mnigC960BtWx0ZdQ&q=85&s=740962bdf515a22cf6350c65c762a121" alt="App Type Business" width="1650" height="640" data-path="images/app-type-business.avif" />
    </Frame>
  </Step>

  <Step title="Finish creation">
    Review your details and click **Create App** to finish.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/v49Fn0HrIrHSrZrU/images/facebook-confirm-creation.avif?fit=max&auto=format&n=v49Fn0HrIrHSrZrU&q=85&s=6c28f13016257639dadcba32bf6478ef" alt="Facebook Confirm Creation" width="1650" height="836" data-path="images/facebook-confirm-creation.avif" />
    </Frame>
  </Step>

  <Step title="Add the Instagram product">
    From your Meta Developer App dashboard, locate the **Instagram** card and click **Set up**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/v49Fn0HrIrHSrZrU/images/instagram-product.avif?fit=max&auto=format&n=v49Fn0HrIrHSrZrU&q=85&s=09364d2bc1c8f490fa4db0bbf21a2f7d" alt="Instagram Product" width="1650" height="803" data-path="images/instagram-product.avif" />
    </Frame>
  </Step>

  <Step title="Copy Instagram App ID and App Secret">
    After creating your app, go to Instagram and select **API setup with Instagram business login**. Copy the **Instagram App ID** and **Instagram App Secret** shown on this screen.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/fs6lrQwxe8ZP4qJq/images/app-id-and-secret.png?fit=max&auto=format&n=fs6lrQwxe8ZP4qJq&q=85&s=221148dfde570e75c4c34d7a232c84d1" alt="Copying Instagram App ID and App Secret" width="2774" height="1639" data-path="images/app-id-and-secret.png" />
    </Frame>
  </Step>
</Steps>

## Step 2: Configure Credentials in ChatbotX

With your Instagram credentials generated and Webhooks configured in Meta, save these settings in ChatbotX to link the integration.

<Steps>
  <Step title="Open Integrations">
    In your ChatbotX installation, navigate to:

    ```text theme={null}
    https://app.yourdomain.com/admin/platform-credentials
    ```
  </Step>

  <Step title="Open the Instagram configuration">
    Click the **Edit** button on the Instagram card to open the configuration modal.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/YC3bcNDUN8lxhBXY/images/chatbotx_super_admin_instagram_edit_modal.png?fit=max&auto=format&n=YC3bcNDUN8lxhBXY&q=85&s=99fb59ba02b7184c1451b833495a068c" alt="chatbotx_super_admin_instagram_edit_modal" width="2097" height="1408" data-path="images/chatbotx_super_admin_instagram_edit_modal.png" />
    </Frame>
  </Step>

  <Step title="Enter your credentials">
    Provide the details from your Meta Developer Portal configuration:

    * **Client ID**: Paste your **Instagram App ID** (copied in Step 1-7).
    * **Client Secret**: Paste your **Instagram App Secret** (copied in Step 1-7).
    * **API Version**: Select v23.0 or higher.
    * **Webhook Verify Token**: A secret string used to validate incoming webhook requests, choose your own value, for example, a random string
  </Step>

  <Step title="Click Save. Instagram will now be available as a channel when creating chatbots.">
    After saving, ChatbotX will display a **Auth Callback URL & Webhook  URL**. Copy and keep this URL, you will need it when configuring  in Step 3.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/YC3bcNDUN8lxhBXY/images/chatbotx_super_admin_integrations_instagram.png?fit=max&auto=format&n=YC3bcNDUN8lxhBXY&q=85&s=4388cd61196dacb10d83bf77b72cba49" alt="chatbotx_super_admin_integrations_instagram" width="2096" height="1055" data-path="images/chatbotx_super_admin_integrations_instagram.png" />
    </Frame>
  </Step>
</Steps>

## Step 3: Configure Instagram Business Login Settings in Meta

Before saving settings in ChatbotX, you must set up the Instagram product in the Meta Developer Portal to retrieve your Instagram credentials and establish the webhook connection.

<Steps>
  <Step title="Configure Webhooks">
    Under **Instagram: Webhooks** in the Meta portal:

    * **Callback URL**: Paste `https://app.yourdomain.com/integrations/instagram/webhook`.
    * **Verify Token**: Enter a secure random string of your choice (e.g. `INSTAGRAM_VERIFY_TOKEN`).

    Click **Verify and save**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/MJzzQpOt3XJ-A1CU/images/configuring-webhook-callback-url-and-verify-token.png?fit=max&auto=format&n=MJzzQpOt3XJ-A1CU&q=85&s=243f98114747a03fc4634133b9a6c564" alt="Configuring Webhook Callback Url And Verify Token" width="1976" height="622" data-path="images/configuring-webhook-callback-url-and-verify-token.png" />
    </Frame>
  </Step>

  <Step title="Configure Redirect URL">
    In the Client OAuth settings on the same page, enter your Redirect URL:

    * **Valid OAuth Redirect URIs**: Paste `https://app.yourdomain.com/integrations/instagram/callback`.

    Save your changes.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ouPdQYUkmnHqNDWn/images/configuring-instagram-business-login-redirect-url.png?fit=max&auto=format&n=ouPdQYUkmnHqNDWn&q=85&s=906dd692adbd5fdb6b8031c4e24b9af4" alt="Configuring Instagram Business Login Redirect Url" width="2025" height="879" data-path="images/configuring-instagram-business-login-redirect-url.png" />
    </Frame>
  </Step>

  <Step title="Subscribe to webhook events">
    Once verified, subscribe to the following fields:

    * `messages`
    * `messaging_seen`
    * `message_reactions`

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ouPdQYUkmnHqNDWn/images/subscribing-to-webhook-events.png?fit=max&auto=format&n=ouPdQYUkmnHqNDWn&q=85&s=79717f4195088c63ec44253b80bbf1a2" alt="Subscribing To Webhook Events" width="1966" height="1389" data-path="images/subscribing-to-webhook-events.png" />
    </Frame>
  </Step>

  <Step title="Complete app review">
    To receive messages from the general public, Meta requires your app to go through an App Review process. During this review, you must request specific permissions that allow the bot to read and reply to messages.

    Request Advanced Access for the following scopes:

    | Permission                           | Description                                                                                |
    | :----------------------------------- | :----------------------------------------------------------------------------------------- |
    | `instagram_business_basic`           | Retrieve connected Instagram Business account metadata: username, ID, and profile picture. |
    | `instagram_business_manage_messages` | Receive and respond to Instagram Direct Messages.                                          |
    | `human_agent`                        | Enable human agents to respond to messages outside the standard 24-hour window.            |

    <Frame>
      <img src="https://mintcdn.com/chatbotx/ouPdQYUkmnHqNDWn/images/instagram-request-permissions.png?fit=max&auto=format&n=ouPdQYUkmnHqNDWn&q=85&s=a9d4c36961b5fb7f39f073c75ea4a5c1" alt="Instagram Request Permissions" width="2022" height="1037" data-path="images/instagram-request-permissions.png" />
    </Frame>
  </Step>
</Steps>

## Step 4: Test Your Connection

Before you open your chatbot to the public, it is best to test the connection using a test account. This ensures everything is set up correctly without affecting real customers.

<Steps>
  <Step title="Register an Instagram Tester">
    In the Meta Developer Portal, go to **App Roles: Roles** and click **Add Users**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/SHsGARJLSleZj0Xw/images/instagram-testers-list.png?fit=max&auto=format&n=SHsGARJLSleZj0Xw&q=85&s=677a91c2db3daf23b1bf8c0b9ac5f0cb" alt="Instagram Testers List" width="2955" height="1173" data-path="images/instagram-testers-list.png" />
    </Frame>
  </Step>

  <Step title="Select the Instagram Tester role">
    Choose the **Instagram Tester** role, enter the Instagram username of your test account, and click **Submit**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/SHsGARJLSleZj0Xw/images/instagram-add-tester.png?fit=max&auto=format&n=SHsGARJLSleZj0Xw&q=85&s=d5484b03005573d296d75643e9bce5e2" alt="Instagram Add Tester" width="2950" height="1349" data-path="images/instagram-add-tester.png" />
    </Frame>
  </Step>

  <Step title="Accept the invitation">
    Log in to the test Instagram account, go to **Settings: Apps and Websites: Tester Invites**, and accept the pending invitation from your app.
  </Step>

  <Step title="Connect the Instagram channel in ChatbotX">
    Go to **Settings: Channels** in your ChatbotX dashboard. Click **Add Instagram**, select **Connect**, and follow the on-screen Meta authorization prompt. Select the test Instagram account to finalize the link.
  </Step>

  <Step title="Send a test message">
    Ensure the test account has **Allow Access to Messages** enabled in the Instagram mobile app:

    ```text theme={null}
    Settings and privacy: Messages and story replies: Message controls: Allow Access to Messages (ON)
    ```

    Send a DM to your business profile. It should appear in the ChatbotX dashboard immediately.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Insufficient Developer Role Error">
    Ensure the Instagram test user has accepted the **Instagram Tester** role invitation under **Settings: Apps and Websites: Tester Invites** on their Instagram account.
  </Accordion>

  <Accordion title="API Access Deactivated Error">
    Verify that your Meta app has a valid and reachable **Privacy Policy URL** configured in **Settings: Basic**.
  </Accordion>

  <Accordion title="Invalid redirect_uri Error">
    Check that the **Valid OAuth Redirect URI** in the Instagram Business Login settings matches your ChatbotX installation URL callback format exactly.
  </Accordion>

  <Accordion title="Token Exchange Failure">
    Verify that the Meta App is in **Live** mode and all permissions have been correctly approved or the test user is properly linked to the app.
  </Accordion>
</AccordionGroup>
