Skip to content

Instagram Integration

Connect your AI assistant to Instagram for automated DM responses and comment engagement.

Requirements at a Glance

  • Instagram Business or Creator account (not personal)
  • Connected to a Facebook Business Page
  • Admin access to both accounts

What You Get

DM Automation

Automatically respond to Instagram Direct Messages with your AI assistant.

Comment Responses

Engage with comments on your posts using intelligent, contextual replies.

Unified Inbox

All Instagram conversations appear in your Functional AI dashboard.

Requirements

Requirement Details
Account type Instagram Business or Creator account
Facebook page Connected to a Facebook Business Page
Permissions Admin access to Instagram account
Functional AI Active account with configured assistant

Business Account Required

Personal Instagram accounts cannot use the Messaging API. You must have a Business or Creator account.

Setting Up the Integration

Step 1: Prepare Your Instagram

  1. Ensure you have a Business or Creator account
  2. Connect to a Facebook Business Page (required by Meta)
  3. Have admin access to both accounts

Step 2: Connect in Functional AI

  1. Go to Integrations or Social in your dashboard
  2. Find Instagram integration
  3. Click Connect

Step 3: Authorize with Meta

You'll be redirected to Meta's OAuth authorization flow. This secure process lets you grant Functional AI limited access to your Instagram account.

Understanding the Permissions

Permission Why We Need It What We Can Do What We Can't Do
instagram_manage_messages To read and respond to DMs View incoming DMs, send replies Access your personal DMs or post DMs
instagram_manage_comments To respond to comments Read comments on your posts, reply Delete comments, moderate all comments
instagram_basic To identify your account Get profile name, avatar, account info Access insights, followers, or posts
pages_manage_metadata Required by Meta Connect Instagram to Facebook Page Post on your behalf or manage page

Facebook Page Requirement

Meta requires Instagram Business accounts to be linked to a Facebook Business Page. This is Meta's requirement to enable the Messaging API.

Authorization Steps

  1. You'll be redirected to Meta's authorization screen
  2. Log in to your Facebook account (if not already logged in)
  3. Select the Instagram account to connect
  4. Select the connected Facebook Page
  5. Review the permissions requested
  6. Click Allow to grant permissions
What happens behind the scenes
sequenceDiagram
    participant User
    participant FunctionalAI
    participant Meta
    participant Instagram

    User->>FunctionalAI: Click "Connect Instagram"
    FunctionalAI->>Meta: Redirect to OAuth with scopes
    Meta->>User: Show permission screen
    User->>Meta: Approve permissions
    Meta->>FunctionalAI: Return authorization code
    FunctionalAI->>Meta: Exchange code for access token
    Meta->>FunctionalAI: Return long-lived token (60 days)
    FunctionalAI->>Instagram: Subscribe to webhooks
    Instagram->>FunctionalAI: Confirm webhook subscription
    FunctionalAI->>User: Connection successful

Token Management: - 60-day token expiration - Automatic token refresh - Encrypted storage (Fernet) - Webhook verification (HMAC-SHA256)

Step 4: Configure Settings

After connecting:

  1. Select which assistant handles Instagram
  2. Configure DM webhook settings
  3. Configure comment webhook settings
  4. Set response delays (optional)
  5. Save settings

Configuration Options

DM Settings

Setting Description
Enable DM webhooks Toggle auto-responses to DMs
Assistant Select which assistant responds
Response delay Add delay before responding

Comment Settings

Setting Description
Enable comment webhooks Toggle auto-responses to comments
Reply to all comments Respond to every comment
Reply to questions only Only respond to comments with questions
Keywords Only respond when specific words are mentioned

Response Delay

Add a human-like delay before responding:

  • Instant (0 seconds): Immediate response
  • Short (5-15 seconds): Brief pause
  • Medium (15-30 seconds): More natural feel
  • Long (30-60 seconds): Very human-like

Natural Engagement

A slight delay (10-20 seconds) makes interactions feel less robotic, especially for comments.

Best Practices

For DMs

Good assistant instructions:

You are the customer support assistant for [Brand] on Instagram.

Keep responses:
- Concise (Instagram messages are typically short)
- Friendly and personable
- On-brand with our social voice

Handle:
- Product questions
- Order inquiries
- General support

For complex issues:
- Collect basic info
- Let them know a team member will follow up
- Provide email: support@example.com

For Comments

Guidelines: - Keep responses short and engaging - Match the tone of the post - Be selective (don't spam every comment) - Add value, don't just promote

Example responses: - Question: "What size should I get?" → Helpful sizing advice - Compliment: "Love this!" → Brief thank you - Issue: "Had a problem..." → Empathetic response + DM offer

Managing Conversations

Viewing Instagram Messages

  1. Go to Conversations
  2. Filter by Instagram channel
  3. View all DMs and comment threads

Replying Manually

For conversations needing human touch:

  1. Open the conversation
  2. Type your reply
  3. Send

Your reply appears as if from your Instagram account.

Escalation

Set up rules to flag conversations for human review: - Negative sentiment - Specific keywords ("refund", "problem") - User requests human contact

See Channel Rules for configuration.

Understanding Message Flow

User sends DM or comments
Instagram sends webhook to Functional AI
AI assistant processes message
Response sent back to Instagram
User receives reply
Conversation logged in dashboard

Attachments

Receiving Attachments

When users send you images, videos, or other media via DM:

  • We display them in your Conversations dashboard
  • Media remains hosted on Meta's servers (we store a link)
  • Attachments may expire over time as Meta manages their CDN

Supported incoming types: Images, videos, audio, reels, stickers

24-Hour Window & Attachment Expiration

You can only respond within 24 hours of the user's last message. Instagram media links may also expire over time - save important files locally.

Sending Attachments

When replying manually from the Conversations dashboard:

Message Type Supported Attachments
DMs Images, videos, audio
Comments Text only (no attachments)

Not supported: Documents (PDFs, Word files, etc.) - Instagram doesn't allow these in DMs.

If you try to attach an unsupported file, your text message will still send, with a note explaining the attachment couldn't be included.

AI and Attachments

The AI assistant is aware when users send media but cannot analyze image or video contents. Consider training your assistant to:

  • Acknowledge when media is received
  • Ask clarifying questions about the content
  • Offer human support for visual inquiries

Limitations

Platform Restrictions

Restriction Details
24-hour window Can only respond within 24 hours of user message
No proactive messaging Can't message users who haven't messaged first
Rate limits Meta imposes API rate limits
Content policies Must follow Instagram's community guidelines
Webhook troubleshooting

Instagram uses webhooks to notify us of new messages in real-time.

Common Issues:

Symptom Likely Cause Solution
No webhooks arriving Subscription expired Reconnect Instagram account
Webhooks delayed Meta platform lag Check Meta Status
Some messages missing Rate limit hit Reduce message volume
Signature verification fails App secret changed Reconnect integration

Security: - Signature verification (HMAC-SHA256) - Duplicate prevention (5-minute window) - Rate limiting (100 webhooks/user/minute) - Timestamp validation

Troubleshooting

Quick Diagnostics

Problem Check Fix
Can't connect Business/Creator account? Switch to Professional Account
No messages Webhooks enabled? OAuth active? Check integration settings, reconnect
No responses Within 24 hours? Assistant public? Check timestamp, make assistant public

24-Hour Response Window

Instagram only allows responses within 24 hours of the user's last message.

Detailed connection troubleshooting

Can't Connect:

  • Account is Business or Creator type (not Personal)
  • Instagram connected to Facebook Business Page
  • Admin access to both Instagram and Page
  • No active restrictions

Steps: 1. Instagram App > Settings > Account > Switch to Professional Account 2. Connect to Facebook Business Page 3. Clear previous authorizations: Facebook Settings > Business Integrations 4. Try connecting from different browser

Messages not appearing
  1. Send test DM from another account (should appear within 5-10 seconds)
  2. Check integration settings for error badges
  3. Verify authorization: Facebook Settings > Business Integrations
  4. Check Meta platform status
Responses not sending

24-Hour Window Check: - Calculate time since user's last message - If > 24 hours: Cannot respond - If < 24 hours: Check other issues

Common Issues: - Private assistant → Make assistant public - No assistant selected → Select in integration settings - Invalid token → Reconnect Instagram - Test manually in dashboard to isolate issue

Privacy & Compliance

Data Handling

  • Messages are processed by your AI assistant
  • Conversations are stored securely
  • Follow Instagram's data policies

User Experience

  • Consider informing users they're chatting with AI
  • Provide option to reach human support
  • Respect opt-out requests

Testing

Before Going Live

  1. Connect a test account if possible
  2. Send test DMs from another account
  3. Comment on test posts
  4. Verify responses are appropriate
  5. Check dashboard logging

Ongoing Monitoring

  1. Review conversations daily
  2. Check for inappropriate responses
  3. Adjust settings as needed
  4. Monitor engagement metrics

Next Steps