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

# Add an AI agent to Instagram direct messages

> Connect your Instagram business account so your AI agent can handle direct messages, with human takeover

The Chatbase Instagram integration connects your AI agent to an Instagram business account, so it answers the direct messages (DMs) customers send that account. It's for businesses that support and sell to customers on Instagram, such as brands whose shoppers DM them about products seen in posts. You can also take over any conversation yourself, so routine inquiries are automated but you keep the freedom to step in whenever you want.

> [card] What you can do:
>
> Answer Instagram DMs automatically, take over a conversation the moment you want to handle it yourself, and run different AI agents on different pages.

> [!NOTE]
>
> Attachments are supported, so your AI agent can process them and respond based on their content. See [Attachments](https://chatbase.co/docs/user-guides/chatbot/channels.md#attachments).

> [!NOTE]
>
> You can connect more than one Instagram page: select multiple pages during setup, or add more later from the **Manage** page.

## Use cases

**DM support.** Your AI agent answers from its [Data Sources](https://chatbase.co/docs/user-guides/chatbot/data-sources.md) and can read the photos and documents customers send in DMs. When a customer needs a person, the [Escalations](https://chatbase.co/docs/user-guides/chatbot/actions/escalate-to-human.md) Action opens a ticket and the AI agent tells the customer a ticket was opened. With Chatbase Helpdesk as the ticket platform, the AI agent then stops replying, your team's replies show up live in the DM, and closing the ticket hands the conversation back. See [Handover with Chatbase Helpdesk](https://chatbase.co/docs/user-guides/chatbot/actions/escalate-to-human.md#handover-with-chatbase-helpdesk).

**DM sales.** With [Shopify](https://chatbase.co/docs/user-guides/integrations/shopify.md) connected, these [Shopify Actions](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#channel-compatibility) work on Instagram: **Retrieve and display products**, **Update cart**, **Get cart**, **Create order**, **Create exchange (new order)**, and **Retrieve and display orders**. For example, a shopper sends a screenshot of a jacket from one of your posts. With [search by image](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#search-by-image), the AI agent finds the matching product in your catalog, adds it to the cart, and places the order when the shopper is ready to check out.

**Comment replies.** [Comment monitoring](#comment-monitoring) turns comments on your Instagram posts into Helpdesk tickets. Your team replies from the ticket, and the reply is posted under the original comment.

## Before you start

* An Instagram business account (a [professional account](https://www.facebook.com/help/instagram/138925576505882) set to Business). Creator accounts can't be connected.
* A Facebook Page connected to that account
* A Chatbase account with an AI agent

## How to connect Instagram

**1. Allow access to messages in Instagram**

In your Instagram settings for your business account, under **How others can interact with you**, click **Messages and story replies > Message controls > Allow Access to Messages**.

**2. Open the Instagram channel**

Navigate to your dashboard, pick an AI agent, and go to **Channels**. Click **Connect**, then **I understand**.

![Starting the Instagram connection from the Channels tab](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-3.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=9c78dce53951846421a3741576819381)

Click **Continue**.

![Continuing the Instagram connection flow](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-4.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=c0b264c52c1efbe06c4a02f4b61083d1)

**3. Log in to Instagram**

Click **Get Started** to log in to Instagram. This also converts your account to a professional account if it isn't one already. Make sure it's set to Business: Creator accounts can't be connected.

![The Get Started screen for Instagram login](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-5.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=6214019546f762dabc638531374b659c)

![Logging in to Instagram](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-6.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=baeac2262e002ef52a4017b1d4d65e40)

**4. Choose your businesses and pages**

Choose the businesses affiliated with your Instagram page. If you have none, select **Opt in all current future businesses**.

![Choosing affiliated businesses](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-7.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=2b691f036247003ce6a26cb89c9bfc33)

Choose the Facebook Page or Pages linked to your Instagram.

![Choosing the linked Facebook Pages](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-8.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=14af52e349d5373071f5d34831ccff85)

Select the Instagram page or pages you want to integrate.

![Selecting Instagram pages to integrate](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-9.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=5bb68a8c285c91faa4c55d013a3c7d09)

**5. Save and confirm**

Click **Save**.

![Saving the Instagram page selection](https://mintcdn.com/chatbase/yfTgmAASFJyGs3D_/user-guides/integrations/images/instagram/instagram-10.png?fit=max\&auto=format\&n=yfTgmAASFJyGs3D_\&q=85\&s=b24a1cce742591e6a3ec004378f46f27)

Your page should be integrated successfully. Click **Manage** to see the integrated page.

![The Manage button for the Instagram integration](https://mintcdn.com/chatbase/BmrOmHxfb5Jvt0l2/user-guides/integrations/images/instagram/instagram-11.png?fit=max\&auto=format\&n=BmrOmHxfb5Jvt0l2\&q=85\&s=73d9a6fbb8d60aa8f6eb0319c3fb2e06)

You can add more pages or delete existing ones from the Manage page.

![Managing connected Instagram pages](https://mintcdn.com/chatbase/BmrOmHxfb5Jvt0l2/user-guides/integrations/images/instagram/instagram-12.png?fit=max\&auto=format\&n=BmrOmHxfb5Jvt0l2\&q=85\&s=e33d5f67f400f060925af9108cb67ccc)

> [!TIP]
>
> Send a direct message to your connected Instagram account and confirm your AI agent replies.

## Human takeover

The human takeover feature lets you take over a conversation whenever you want so you can respond to customers directly. It works at the conversation level, so you can pick a specific conversation from the dashboard and stop the AI agent answering.

### Enable human takeover for a conversation

1. Navigate to **Activity > Conversations**.
2. In the **Conversations** section, filter to show only Instagram chats.
3. Click the human takeover icon.
4. Click the icon again to restore access to the AI agent.

![The human takeover icon in the Conversations list](https://mintcdn.com/chatbase/BmrOmHxfb5Jvt0l2/user-guides/integrations/images/instagram/instagram-14.png?fit=max\&auto=format\&n=BmrOmHxfb5Jvt0l2\&q=85\&s=6d85d350aa611b42f4e3ae12563378c6)

> [!WARNING]
>
> Some conversations won't have the human takeover icon. This happens when you delete a page from the Instagram integration. You keep access to the conversations in **Activity > Conversations**, but not the takeover feature. The same applies if you delete a page and add it back.

***

## Response delay

Customers on Instagram often send several short messages in a row. If your AI agent replies too fast, it answers each message separately before the customer has finished. The Instagram response delay sets how long your AI agent waits after the latest customer message before it replies. Messages sent during that wait are grouped into one reply instead of one reply per message.

To set it:

1. Go to **Channels → Instagram → Manage → Delay**.
2. For each Instagram page, set a **Minimum delay** and a **Maximum delay** in seconds.
3. Click **Save**.

For each reply, your AI agent waits a random time between the minimum and the maximum, so replies don't arrive at an exact, robotic interval. To always wait the same amount of time, set both values to the same number.

> [!NOTE]
>
> Both values can be between 2 and 30 seconds, and the maximum can't be lower than the minimum. Pages you haven't configured wait 2 seconds.

## Comment monitoring

Turn comments on your **Instagram posts into Chatbase Helpdesk tickets**, so your team can monitor and respond to customers directly from Chatbase. Comment monitoring is available from the channel settings for your Instagram accounts.

**1. Open your channel settings**

Go to **Channels** and select your connected **Instagram** channel.

**2. Open Comments**

Select the **Comments** tab.

**3. Enable comment monitoring**

Turn on **Enable comment monitoring** and select the connected accounts you want to monitor.

**4. Receive comments as tickets**

When someone comments on a monitored Instagram post, Chatbase automatically creates a ticket in the **Chatbase Helpdesk**.

The ticket includes information about the original post and the comment, giving your team the context needed to respond.

**5. Reply from the Chatbase Helpdesk**

Open the ticket in the **Chatbase Helpdesk** and reply directly to the comment.

Replies sent from Chatbase are posted as replies to the original Instagram comment.

## Connecting different AI agents to different pages

You can connect different AI agents to different Instagram pages, so each page gets specialized interactions.

1. After connecting your first pages, you have access to the **manage Instagram pages** integrations page. Navigate to the AI agent you want to connect, then **Channels > Manage**.
2. Click **Manage** to open the dashboard. To connect another AI agent to an already-connected page, click the page and delete it.
3. Navigate to the AI agent you want to integrate with the deleted page, then run through the integration steps again.

> [!WARNING]
>
> If you deleted a page, it will be preselected in the integration steps. Don't deselect any page you want to stay connected to the Instagram or Facebook integrations on Chatbase, because deselecting disables that page for Chatbase.

## Troubleshooting

> [accordion] Off-Meta activities tracking is disabled
>
> If your Facebook account has **Off-Meta activities** set to "Don't track", this can block the Instagram authentication. Go to your Facebook account settings, look under privacy settings for Off-Meta activities tracking, and enable it temporarily during the connection process.

> [accordion] Network redirect blocking authentication
>
> Some networks redirect Facebook from `facebook.com` to `web.facebook.com` during login, which can block the authentication flow. When this happens, the Instagram login popup completes successfully and closes, but the first Meta window doesn't move to the next step. Try switching to a different network, such as mobile data or a different WiFi connection, and attempt the connection again.

> [accordion] The AI agent stopped replying in a conversation
>
> Check whether human takeover is on for the conversation, or whether it has an open Helpdesk ticket. A conversation can also be [paused](https://chatbase.co/docs/user-guides/chatbot/activity.md#pausing-a-conversation) manually or by [Spam detection](https://chatbase.co/docs/user-guides/chatbot/guardrails.md#spam-detection). If it stopped on every conversation, check that the Instagram integration is enabled.

> [!NOTE]
>
> You can enable or disable the Instagram integration without disconnecting it. Disabling pauses messages while keeping your setup intact, and you can re-enable at any time. New chats still appear in **Activity > Conversations**.

## Limitations

* **A business account and a linked Facebook Page are required.** Personal and Creator accounts can't be connected.
* **Deleting a page removes takeover for its conversations.** The conversations remain, but the takeover icon disappears.

## Best practices

> [card] Sync your products for image search
>
> Shoppers can send a screenshot instead of a product name. Sync your Shopify products in the **Retrieve and display products** Action so the AI agent can match photos to your catalog.

> [card] Turn on the commerce Actions together
>
> Enable **Update cart**, **Get cart**, and **Create order** along with **Retrieve and display products** on the Instagram channel, so shoppers can go from a question to an order in one DM thread.

> [card] Route comments to the Helpdesk
>
> Turn on [comment monitoring](#comment-monitoring) so questions under your posts become tickets your team can answer.

> [card] Don't delete pages you still use
>
> Deleting a page removes takeover for its conversations, and adding it back doesn't restore it. When you reconnect, keep every page you want connected selected.

Changes you save to instructions, Actions, and channel settings go into a draft. Instagram customers keep talking to the live AI agent until you click **Publish**. See [Drafts and versions](https://chatbase.co/docs/user-guides/chatbot/versions.md).

## Frequently asked questions

> [accordion] Which Instagram accounts can I connect?
>
> Only an Instagram business account with a connected Facebook Page. Personal and Creator accounts can't be connected. If your account is a Creator account, switch it to Business in Instagram's settings first.

> [accordion] Can I connect more than one Instagram page?
>
> Yes. Select several pages during setup, or add more later from the **Manage** page.

> [accordion] Can different Instagram pages use different AI agents?
>
> Yes. To move an already-connected page to another AI agent, delete it from the **Manage** page, then run the integration steps again from the AI agent you want to use. See [Connecting different AI agents to different pages](#connecting-different-ai-agents-to-different-pages).

> [accordion] Does the AI agent answer replies to my stories?
>
> Yes. When someone replies to one of your stories, the AI agent gets the story as context. For an image story, it reads what the image shows. For a video story, it only knows the customer is replying to a video, so it may ask what they mean.

> [accordion] Does the AI agent reply to comments on my posts?
>
> No. The AI agent doesn't respond to comments. Turn on **Comment monitoring** in the channel settings to create a Chatbase Helpdesk ticket when a comment arrives. Your team replies from the ticket, and the reply is posted under the original Instagram comment. See [Comment monitoring](#comment-monitoring).

> [accordion] Why does the connection get stuck during login?
>
> This can happen when **Off-Meta activities** is set to "Don't track" on your Facebook account, or when your network redirects `facebook.com` to `web.facebook.com`. See [Troubleshooting](#troubleshooting).

> [accordion] How many message credits does Instagram use?
>
> Each reply uses message credits based on your AI agent's [model](https://chatbase.co/docs/user-guides/chatbot/models-comparison.md) (**Auto** by default). A reply that triggers an Action costs twice that, and [attachments](https://chatbase.co/docs/user-guides/chatbot/channels.md#attachments) add credits per image or PDF page.

## Next steps

> [card] [Messenger](https://chatbase.co/docs/user-guides/integrations/messenger.md)
>
> Connect the Facebook pages linked to your Instagram accounts for the same treatment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.