# Add an AI agent to Instagram direct messages > Connect your Instagram business account so your QwryAI agent handles direct messages, with human takeover The Instagram channel connects your QwryAI 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 ask about sizes, stock and delivery in DMs. > [card] What you can do: | /docs/user-guides/integrations/instagram#how-to-connect-instagram | Answer Instagram DMs automatically, take over a conversation when you want to handle it yourself, and run different agents on different accounts. > [!NOTE] > > Customers can send photos and documents in DMs, and your agent reads them before it replies. See [Images and attachments](/docs/user-guides/chatbot/behavior/images-and-attachments). > [!NOTE] > > You can connect more than one Instagram account: add more later with **Connect a new Instagram Page** on the Instagram channel's **Connection** tab. ## Use cases **DM support.** Your agent answers from its [data sources](/docs/user-guides/chatbot/data-sources) and reads the photos and documents customers send. When a customer needs a person, the [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human) Action opens a ticket and your team replies from the **Inbox**. **DM sales.** With [Shopify](/docs/user-guides/integrations/shopify) connected, shoppers can find products and check orders in a DM. Choose which Actions run on Instagram on the channel's **Actions** tab. **Public comments.** [Comment monitoring](#comment-monitoring) turns comments on your Instagram posts into tickets, so your team sees them with your other tickets. ## Before you start * An Instagram professional account set to **Business**. * The Instagram username and password of that account. * A QwryAI agent. ## How to connect Instagram **1. Allow access to messages in Instagram** In the Instagram app, open your business account's settings, then under **How others can interact with you**, go to **Messages and story replies › Message controls** and turn on **Allow access to messages**. **2. Open the Instagram channel** Open your agent and select **Channels** in the sidebar. On the **Instagram** card, *Connect your agent to an Instagram page and let it respond to messages from your customers*, select **Setup**. If you've connected accounts before, the card shows **Manage**. ![The Channels page with the pointer on the Instagram card's Setup button.](annotated/01-card.webp "Channels › Instagram › Setup.") **3. Read the note and continue** QwryAI shows **Connect Instagram** first. Accounts you connect are granted access across your QwryAI agents, and unselecting one that's already connected disconnects it from its agent. Select **I understand**. ![The Connect Instagram dialog explaining that unselecting connected pages disconnects them, with Cancel and I understand.](annotated/02-confirm.webp "Read this before Instagram opens.") **4. Log in to Instagram and allow access** Instagram's sign-in window opens. Log in with the business account and allow QwryAI to manage its messages and comments. When the window closes, QwryAI connects the account. ![Instagram's sign-in window: logging in with the business account, allowing QwryAI access, and the Instagram Connection tab listing the account.](walkthroughs/instagram-login.gif) **5. Check the Connection tab** On **Channels › Instagram › Manage**, the **Connection** tab lists your **Connected Instagram pages**. Each one has an **Active** switch and a menu with **Open in Instagram** and **Delete page**. Add more with **Connect a new Instagram Page**. ![The Instagram channel's Connection tab with Connected Instagram pages, an account card and Connect a new Instagram Page.](connected/annotated/c01-connection.webp "Connected Instagram pages.") ![An Instagram account card with its menu open: Open in Instagram and Delete page.](connected/annotated/c02-page-menu.webp "Open in Instagram to test.") > [!TIP] > > Send a DM to your connected account from another Instagram account, and check that your agent replies. ## Human takeover Human takeover lets you take over a conversation whenever you want and reply to the customer yourself. It works per conversation: the agent stops answering that conversation until you hand it back. ### Enable human takeover for a conversation 1. Open the **Inbox** and select **Instagram** in the **Channels** list. 2. Open the conversation. 3. Select **Take over**. The AI stops answering and your replies go to the customer as DMs. 4. To give the conversation back, select **Hand back to AI**. ![Opening an Instagram conversation in the Inbox, selecting Take over, replying, then Hand back to AI.](walkthroughs/instagram-takeover.gif) > [!WARNING] > > When you delete an account from the channel, its conversations stay in the **Inbox**, but you can no longer reply to them. ## Response delay Customers on Instagram often send several short messages in a row. The response delay makes your agent wait after the customer's latest message; anything sent during the wait is answered in one reply. To set it: 1. Go to **Channels › Instagram › Manage › Delay**. 2. For each account, set a **Minimum delay** and a **Maximum delay** in seconds. 3. Select **Save**. ![The Instagram Delay tab with Minimum delay, Maximum delay and Save for an account.](connected/annotated/c05-delay.webp "A minimum and a maximum per account.") For each reply, the agent waits a random time between the two values. To always wait the same time, enter the same value twice. > [!NOTE] > > Both values must be from 2 to 30 seconds, and the maximum can't be lower than the minimum. An account you haven't set waits 2 seconds. ## Lead collection QwryAI can save each person who DMs your account as a contact, with their name and profile picture. On the **Leads** tab, turn on **Enable automatic collection of leads** and tick the accounts. Collected leads appear in [Contacts](/docs/user-guides/chatbot/contacts/contacts-overview). ![The Instagram Leads tab: Automatically collect the name and profile picture of users who message your Instagram pages.](connected/annotated/c04-leads.webp "Leads from Instagram.") ## Comment monitoring Comment monitoring turns comments on your **Instagram posts into tickets** in QwryAI. **1. Open the channel settings** Go to **Channels › Instagram › Manage**. **2. Open Comments** Select the **Comments** tab. **3. Enable comment monitoring** Turn on **Enable comment monitoring** and tick the accounts to monitor. ![The Instagram Comments tab with Receive comments on your Instagram posts as tickets in QwryAI Helpdesk and the Enable comment monitoring switch.](connected/annotated/c06-comments.webp "Comments become tickets.") **4. Receive comments as tickets** When someone comments on a post, QwryAI creates a ticket titled *Instagram comment from* the person's username, with the comment and a link to the post. **5. Reply on Instagram** Open the ticket, follow the post link, and reply under the comment on Instagram. ![An Instagram comment arriving as a ticket in QwryAI with the comment text and the post link.](walkthroughs/instagram-comment-ticket.gif) ## Connecting different AI agents to different pages Each Instagram account answers with one agent at a time. 1. Open the agent the account is connected to, go to **Channels › Instagram › Manage**, and on the **Connection** tab choose **Delete page** in the account's menu. 2. Open the agent you want to use and connect the account there with **Setup** or **Connect a new Instagram Page**. An account that answers with another agent is listed under **Instagram pages connected to other agents**: *To change the agent connected, delete the page and navigate to the other agent to connect it again.* ![The Delete Instagram page? dialog confirming the account will be removed from QwryAI.](connected/annotated/c03-delete.webp "Delete an account to move it to another agent.") ## Channel settings **Overview** shows the model, data sources, Actions and instructions Instagram uses. Turn off **Sync with global instructions** to write instructions for Instagram only. **Actions** lists the Actions with a switch for each, so you choose which run on Instagram. ![The Instagram channel's Overview tab with the model, data sources, Actions and instructions.](connected/annotated/c07-overview.webp "Overview: what Instagram uses.") ## Troubleshooting > [accordion] Instagram says This Instagram account is connected to another agent. > > The account already answers with another agent. Delete it from that agent's **Connection** tab, then connect it again here. See [Connecting different AI agents to different pages](#connecting-different-ai-agents-to-different-pages). > [accordion] An account card says Disconnected > > The card says *Disconnected: Facebook no longer accepts this page's access, for example after a password change.* Select **Connect a new Instagram Page** and log in again. > [accordion] The agent doesn't reply to DMs > > Check that **Allow access to messages** is on in the Instagram app, that the account's **Active** switch is on, and that the conversation isn't taken over, paused or covered by an open ticket. > [!NOTE] > > To pause the agent on an account without disconnecting it, turn off its **Active** switch. New chats still appear in the **Inbox**. ## Limitations * **A business account is required.** Personal accounts can't be connected; switch to a professional account set to Business first. * **Deleting an account stops replies in its conversations.** The conversations stay in the **Inbox**. * **The agent doesn't answer comments.** Comment monitoring turns them into tickets; replies are posted on Instagram. ## Best practices > [card] Sync your products | /docs/user-guides/chatbot/actions/shopify-actions | Shoppers send screenshots instead of product names. Connect Shopify so the agent can find the products they mean. > [card] Turn on the commerce Actions together | /docs/user-guides/chatbot/actions/shopify-actions | Turn on the cart and order Actions alongside product search on the Instagram channel, so shoppers can go from a question to an order in one DM thread. > [card] Turn comments into tickets | /docs/user-guides/integrations/instagram#comment-monitoring | Turn on comment monitoring so questions under posts don't go unanswered. > [card] Give Instagram its own instructions | /docs/user-guides/integrations/instagram#channel-settings | Turn off Sync with global instructions to ask for short, friendly DM answers. Changes to instructions and Actions go into a draft. Instagram customers keep talking to the live agent until you select **Publish**. See [Drafts and publishing](/docs/user-guides/chatbot/drafts-and-publishing). ## Frequently asked questions > [accordion] Can I connect a personal or creator account? > > Connect a professional account set to Business. Switch the account type in Instagram's settings first. > [accordion] Can I connect more than one Instagram account? > > Yes. Add each one with **Connect a new Instagram Page** on the **Connection** tab. > [accordion] Does the agent reply to comments? > > No. Turn on [comment monitoring](#comment-monitoring) to get a ticket for each comment, and reply on Instagram. > [accordion] How do I reply to a customer myself? > > Select **Take over** on the conversation in the **Inbox**, or let the customer reach your team through an [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human) ticket. > [accordion] How many message credits does Instagram use? > > Each reply uses message credits based on your agent's [model](/docs/user-guides/chatbot/models-comparison), the same as on every other channel. ## Next steps > [card] Messenger | /docs/user-guides/integrations/messenger | Connect your Facebook Pages for the same treatment.