Skip to main content

How to Connect Instagram to AI Agent

Connect your Flametree AI agent to Instagram to automatically respond to Direct Messages (DMs). This integration uses the Meta Graph API and requires an Instagram Professional account linked to a Facebook Page.


Prerequisites

  • Instagram Professional Account (Business or Creator). Personal accounts are not supported by the API
  • Facebook Page linked to your Instagram account
  • Meta Developer Account and a Meta App (Type: Business)
  • Manage Queries permission enabled in Instagram settings (Settings > Privacy > Messages > Allow Access to Messages)

Setting Up Meta Infrastructure

  1. Open your Facebook Page settings
  2. Go to Linked Accounts > **Instagram
  3. Click Connect Account and log in to your Instagram Professional account

Step 2: Configure Meta Developer App

  1. Go to the Meta for Developers portal
  2. Select your App (or create a new one with the Business type)
  3. Click Add Product and select Instagram Graph API
  4. In the Instagram settings of your app, navigate to Token Generation
  5. Add your Facebook Page and generate an Access Token

Step 3: Webhook Configuration

  1. In the Meta App dashboard, go to Webhooks
  2. Select Instagram from the dropdown menu
  3. Click Edit Subscription and use the Callback URL and Verify Token provided in the Flametree connector settings (see below)
  4. Subscribe to the messages field

If the webhook verification fails, ensure the Instagram verify token in the Flametree portal matches Verify Token you entered in the Meta App Webhook settings.

Configuring Flametree Integration

  1. Navigate to Settings > Connectivity > Communication Channels

  2. Select Instagram from the list and click Add +

  3. Fill in the configuration fields using the values from your Meta Developer Console:

    FieldDescriptionRequired
    NameCustom name for the integration (for example, Main IG Support).
    Instagram IDYour Instagram Business Account ID.
    Facebook access tokenThe Page Access Token from your Meta App.
    Facebook page IDThe ID of the Facebook Page linked to Instagram.
    Instagram access tokenToken generated specifically for Instagram Graph API.
    Meta app IDThe ID of your Meta Developer App.
    Instagram app secretFound in App Settings > Basic in Meta Console.
    Instagram verify tokenAny value you make up yourself (for example, my_ig_webhook_2026). Works like a shared password — the same value must be entered in the Meta App webhook settings.
    Registration delayDelay between registration attempts (in seconds).
    Registration countNumber of retry attempts for webhook registration.
  4. Click Save.

  5. Click Start in the upper-right corner to start the channel.

  6. Go to your Agent Settings > Communication Channels and add the newly created Instagram connector.

  7. Restart the agent: click Stop agent then Start agent to apply the changes.

Testing the Integration

  1. Log in to a different Instagram account (not the business account itself)
  2. Send a Direct Message (DM) to your Instagram Business profile
  3. Verify that the AI Agent responds automatically
  4. Check the Sessions tab in the portal to see the conversation logs

If the agent is not receiving messages, there can be several causes to that:

  • Allow Access to Messages is disabled in the Instagram mobile app settings (Privacy > Messages)
  • The Facebook Page is not properly linked to the Instagram account
  • The Meta App is still in Development Mode. Switch it to Live Mode

Was this article helpful?