How to Automate Instagram DMs with AI

Set up an AI bot that replies to Instagram DMs and story mentions automatically — answer FAQs, qualify leads, and never miss a message. No code required.

💡 Want the big picture first? See what AI Instagram DM automation can do on the Instagram DM Automation overview.

Overview

This guide provides comprehensive instructions for configuring Instagram bots using the Meta Instagram Graph API and integrating them with the Mingleego platform. By following these steps, you will establish a bot capable of automating direct messaging, responding to customer inquiries, and enhancing engagement on Instagram. The process involves setting up a Meta Business account, creating a Meta Developer App, configuring API access, and integrating the bot with Mingleego.

Prerequisites

Before configuring an Instagram bot, ensure the following requirements are met:

  1. Meta Business Account: A Meta Business Account (also known as a Meta Business Portfolio) is required to access Meta's developer tools and APIs. If you don't have one yet, follow the instructions in the Creating a Meta Business Account section to set it up.
  2. Meta Developer App: A Meta Developer App is required to manage API connections, including webhooks and access tokens. Follow the instructions in the Meta Developer App guide to set up your app.
  3. Instagram Professional Account: Convert your Instagram account to a Professional Account (Business or Creator) to access API features. Follow Instagram's instructions to switch to a Professional Account.
  4. Facebook Page Roles: Administrator or Developer roles for a Facebook Page since Instagram accounts need to be linked to a Facebook page for using the Facebook Graph API.

Setting Up Meta Business and Instagram

Establishing a connection between your Meta Business account and Instagram Professional Account is a foundational step for enabling Instagram bot functionality. This section guides you through creating a Facebook Page and linking it to your Instagram account, ensuring seamless integration for your bot.

  1. Create or Access a Facebook Page: To begin, you need a Facebook Page where you have Administrator or Developer roles. If you already have a suitable Page, you can use it; otherwise, create a new one. For more detailed instructions on creating a Page, refer to Facebook's official guide.

    • Log in to your Facebook account at Facebook.
    • From the Facebook menu, locate and click Pages to access your existing Pages or create a new one. Facebook Menu with Pages Option
    • In the Pages section, you will see a list of Pages you manage. To create a new Page, click the Create new profile or Page button. Create New Profile or Page Button
    • Select Public Page as the Page type, then click Next to proceed. Select Public Page Option
    • Enter a name for your Page (ensure the name complies with the Page names allowed on Facebook policy), choose an appropriate category (e.g., Business), and click Create Page to finalize the setup. Set Page Name and Category
    • Ensure the Page is set up for business purposes by configuring its settings, such as adding a profile picture, cover photo, and business details.

    After creating your Page, you can further configure its settings to align with your business needs. For additional guidance on configuring your Page, refer to Facebook's official guide.

  2. Link Your Instagram Professional Account: Once your Facebook Page is set up, link it to your Instagram Professional Account to enable bot functionality. For more detailed instructions, refer to Facebook's official guide on connecting Instagram to a Page.

    • Navigate to the Settings section of your Facebook Page. Facebook Page Settings Menu
    • Under Permissions, select Linked Accounts to view available account options. Permissions and Linked Accounts Section
    • Click Instagram to initiate the connection process. Select Instagram Option
    • Follow the prompts to connect your Instagram Professional Account by logging in and confirming the connection. Instagram Login Prompt Confirm Instagram Connection Instagram Connection Success Linked Instagram Account Confirmation

With your Facebook Page and Instagram Professional Account now linked, you have established the foundation for your Instagram bot. Proceed to the Meta Developer App section to continue setting up the necessary API access for your bot.

Meta Developer App

A Meta Developer App is required to access the Instagram Graph API and enable bot functionality for Instagram.

If you have not yet created a Meta Developer App, follow the detailed instructions in the Meta Developer App guide to set up your app. Once created, return to this guide to proceed.

If you already have a Meta Developer App set up in the App Dashboard, proceed with the following steps to configure it for Instagram:

  1. Add Instagram Product:
    • In the Meta Developer App Dashboard, select your app. Then, choose Messenger from the product list and click Set Up to enable Messenger integration (Instagram uses Messenger settings). Set Up Messenger Product for Instagram

After adding the Messenger product, your app is ready for further configuration. Proceed to the Obtain Page ID and Access Token section to continue setting up your bot.

Obtain Page ID and Access Token

To send and receive Instagram direct messages, you need to obtain a Page ID and Access Token from your Meta Developer App.

  1. Access Instagram Settings:

    • In your Meta Developer App dashboard, navigate to Messenger and select Instagram Settings.
    • Click Add or Remove Pages to manage the Facebook Pages linked to your Instagram account. Add or Remove Pages Option
    • Add the Facebook Page you previously linked to your Instagram Professional Account.
  2. Page ID & Access Token:

    • Locate the number under your Page name in the Instagram Settings section. This is your Page ID. Copy and save it securely.
    • In the same section, click Generate Token to create an Access Token for your app. Generate Access Token Button
    • Copy the generated Access Token and save it securely, as it will not be displayed again. Copy Generated Access Token Button

Setting Up Webhook

Webhooks allow your bot to receive real-time updates from Instagram, such as incoming messages. Configure a webhook as follows:

  1. Access Webhook Settings:

    • In a separate tab, open the Mingleego platform and start creating the bot's social, as detailed in the Integrating with Mingleego section.
    • Copy the Webhook URL provided in the form. Copy Webhook URL from Mingleego
    • Return to Instagram Settings, navigate to Webhooks, and click Add callback URL.
    • Paste the copied Webhook URL into the Callback URL field.
    • Enter any Verify token you wish (e.g., a random string like "myInstagramBotToken"). Save the Verify Token securely for future reference. Add Callback URL in Webhooks
  2. Configure Webhook Subscriptions:

    • In the Webhooks section, click Edit Subscriptions. Edit Webhook Subscriptions
    • Select all relevant fields, such as messages and messaging_postbacks, to ensure your bot receives the necessary updates.
    • Save the changes to activate the webhook. Save Webhook Subscriptions

Integrating with Mingleego

With the Meta Developer App configured, integrate the Instagram bot with the Mingleego platform:

  1. Create a Social Bot:

    • On the Mingleego platform, navigate to Social Bots.
    • Click Create New Social Bot, select Instagram, and click Continue. Create New Social Bot Button Select Instagram Button Continue Button
  2. Enter Bot Details: Fill in the required fields to configure your Instagram bot on the Mingleego platform:

    Create Instagram Bot Form
    • Assistant: Select an AI assistant from the Select Assistant dropdown to power your bot's responses, aligning with its purpose. If none are listed, click Create Assistant. See the Creating an Assistant Guide for details.
    Select Assistant
    • Bot Name: Enter a unique name to identify your bot on the Mingleego platform.
    • Access Token: Paste the Access Token obtained from the Meta Developer App, as described in the Obtain Page ID and Access Token section, to authenticate your bot's connection to the Instagram Graph API. Ensure it includes instagram_basic and instagram_manage_messages permissions.
    • Page ID: Paste the Page ID retrieved from Meta Developer App's Instagram Settings, as outlined in the Obtain Page ID and Access Token section, to link your bot to the associated Facebook Page.
    • Webhook: Copy the Webhook URL and use it in Meta Developer App's Webhook settings, as described in the Setting Up Webhook section.
  3. Finalize Creation:

    • Review all entered details in the form to ensure accuracy, then click Create to activate your Instagram bot on the Mingleego platform.
    • After creation, your bot will appear in the Instagram tab under the Social Bots section, displayed in a table. From there, you can:
      • View Statistics by bot users to monitor engagement and performance.
      • Edit the bot by updating the same form fields to adjust its functionality.
      • Delete the bot if it is no longer needed, removing it from the platform. Created Instagram Bot

Once the bot is activated, it is ready to handle Instagram messages based on the configured settings. You can now proceed to the Submitting for Meta Review section to make your bot publicly accessible, or test its functionality using the Mingleego Playground.

Submitting for Meta Review

During Development Mode, your bot is accessible only to admins, developers, and testers. To make it available to the general public, you must submit your Meta Developer App for review and obtain approval from Meta.

  1. Prepare for Review:

    • Ensure your bot complies with Meta’s policies, including the Meta Platform Terms, to avoid rejection during the review process.
    • Thoroughly test all bot functionalities in Development Mode to confirm they work as intended.
  2. Submit for Review:

    • In your Meta Developer App dashboard, navigate to App Review > Requests.
    • Request permissions for instagram_basic and instagram_manage_messages to enable full bot functionality.
    • Provide detailed information about your bot’s use case, functionality, and compliance with Meta’s guidelines.
    • Submit the request and monitor your app dashboard for updates on the approval status. For more details on the App Review process, refer to Meta’s official guide: App Review Process.

Note: The review process may take several days or longer, depending on Meta’s review queue. Regularly check your app dashboard for status updates or requests for additional information.

Best Practices

To ensure optimal performance of your Instagram bot, follow these recommendations:

  • Test Thoroughly: Use the Mingleego Playground to test bot responses with various user queries.

  • Secure Tokens: Store Page ID and Access Token in a secure location to prevent unauthorized access.

  • Monitor Webhook: Regularly verify that the webhook is receiving Instagram messages correctly.

  • Comply with Meta Policies: Adhere to the Meta Platform Terms to ensure compliance and avoid app suspension. Review these terms to understand permissible bot activities, data handling requirements, and developer obligations.

  • Update Tokens: If the Access Token expires, generate a new one in the Meta Developer App.

Conclusion

You have successfully configured and integrated an Instagram bot with the Mingleego platform using the Meta Instagram Graph API. By following this guide, your bot is now equipped to automate direct messaging, respond to customer inquiries, and enhance engagement on Instagram. To ensure long-term performance, regularly monitor your bot’s activity, update its settings as needed, and adhere to Meta’s policies. For further customization or troubleshooting, refer to the Mingleego Playground or explore additional resources in the Social Bots Guides.