This guide shows how to configure the Instagram channel in Sendbot (backend + Studio) to receive and reply to messages via DMs and comments.

Prerequisites

  • A Meta Developers app with Instagram Messaging access
  • A valid Instagram Access Token
  • The Instagram User ID of the account that will receive messages

Backend Configuration (API)

In your API environment, both production and staging, configure:
META_APP_SECRET=your_meta_app_secret
NEXT_PUBLIC_SENDBOT_API_URL=https://api.sendbot.co
Important notes
  • META_APP_SECRET is used to validate webhook signatures. Without it, the webhook returns 500.
  • NEXT_PUBLIC_SENDBOT_API_URL must point to your public API so Studio can generate the webhook URL.
  • In a local environment, use a public URL such as https://<your-ngrok>.ngrok.io and make sure HTTPS is enabled.

Webhook Configuration in Meta

In Meta Developers:
  1. Open Webhooks and add an endpoint for Instagram.
  2. Use the webhook URL generated by Studio:
/v3/integrations/instagram/{workspaceId}/instagram/{credentialsId}/webhook
  1. Generate the Verification Token in Studio and provide it in Meta to validate the signature.
  2. Select Instagram messaging events to receive DMs.
  3. For comments, also enable the Comments events on the same webhook.

Studio Configuration

  1. Go to Share on the bot -> Instagram.
  2. Create the credentials:
    • Access Token
    • Instagram User ID
    • Optional: Facebook Page ID
  3. Click Generate token and copy the Verification Token.
  4. Configure the webhook in Meta with the URL and token.
  5. Enable Enable Instagram integration and publish the bot.

Comment Replies

In Studio, you can enable automatic replies to comments:
  1. Open Share on the bot -> Instagram.
  2. In Comments, enable Enable comment replies.
  3. Choose the Reply mode:
    • Public reply: replies on the comment
    • DM only: sends a DM to the user
    • Public + DM: replies on the comment and sends a DM
  4. Optional: define the Start condition (comments) to filter which comments start the bot.
  5. Publish the bot.

Production Checklist

  • META_APP_SECRET configured in the backend
  • Public API URL configured in Studio
  • Webhook validated in Meta using the token generated by Studio
  • Credentials saved and integration enabled on the bot
  • Comments events enabled on the webhook if you use comment replies

Quick Troubleshooting

  • Webhook 401: invalid signature or incorrect token
  • Webhook 500: missing META_APP_SECRET or unsigned request body
  • No reply: make sure the Instagram account is connected to the Meta app and the correct events are enabled