Skip to content

Instagram Webhook

Instagram Webhook starts a flow every time your Instagram account receives a direct message or a comment on a post or a live video. It delivers the text, who sent it and, if the message carries an image, audio, video or document, the file as well.

Instagram tells NappAI as soon as something new arrives. For that you need to paste your flow’s webhook address into your Meta app, as explained below.

When to use it

  • You want an AI agent to read the direct messages your brand receives and alert the team about urgent ones.
  • You want to log the comments on your posts in a spreadsheet.
  • You want to alert your team when someone comments on a campaign post.
  • You want to keep the photos customers send you by direct message.

Configuration

You need an Instagram credential with your Instagram account’s identifier, an access token from a Meta app, and a verification token you choose (Verification Token). See Credentials.

FieldWhat it does
Credential (required)The Instagram credential of the account that receives the messages.
DataTest field. It lets you try the flow with a sample event without waiting for a real one. Leave it empty in normal use.

Advanced options

FieldWhat it does
Store MessagesWhether the received text is saved in the flow’s conversation history. Default: on.

Connect Instagram to the flow

  1. Save the flow and publish a version. Instagram sends events to the published version. See Versions and publishing.
  2. In the editor, click API Access and open the Instagram Webhook tab. Copy the Webhook URL.
  3. In your Meta app’s webhook settings, paste that address and enter the same Verification Token as in your credential.
  4. Subscribe in Meta to messages and comments.

Output

The component has three outputs:

  • Data: the event’s details. For a direct message, its ID, who sends it, who receives it, the text, the date and, if it carries a file, its address and type (image, audio, video or document). For a comment, its ID, the commenter’s username, the post’s ID, the text and the date.
  • Message: the received text as a conversation message, ready to connect to an agent.
  • Media: the file the message carries, if any, so you can save or analyse it.

Each person who writes has their own conversation in the flow, so an agent connected to Message remembers what it has discussed with each one.

Example

A cosmetics store wants its team to handle direct messages with complaints first.

  1. Add Instagram Webhook and choose the store’s Instagram credential.
  2. Connect the Message output to an agent that decides whether the message is a complaint and summarises it.
  3. If it is a complaint, send the summary to the customer service team’s channel.
  4. Publish the flow, copy the Webhook URL from API Access and paste it into your Meta app.

Good practices

  • If you change the credential’s Verification Token, change it in the Meta app as well.
  • Test the flow with Data before connecting it to Instagram, so your tests do not mix with real customer messages while you build it.
  • Publication: post on Instagram and look up posts and comments.