Skip to main content
metaAds.onInstagramMessageReceived starts when someone sends a selected Instagram professional account a direct message.
automations/meta-ads-on-instagram-message-received.automation.ts
Find instagramAccountId with List Instagram accounts. The account must be linked to a Facebook Page the connection manages and must allow connected tools under Settings > Messages and story replies > Message controls > Connected Tools > Allow access to messages. Messages the account sends don’t start the trigger, and messages a person removes start On Instagram message deleted instead. Optional account selects a static project account binding. The event includes:
  • senderId, the person’s Instagram-scoped ID (IGSID); pass it as recipientId to reply
  • instagramAccountId, recipientId, messageId, and timestamp in Unix milliseconds
  • text and attachments, such as image, video, ig_reel, ig_post, or story_mention
  • quickReplyPayload, replyTo with a replied-to messageId or story, and referral for Click-to-Instagram-Direct ads
  • isUnsupported, true when Meta can’t render the message content
Each messageId starts at most one run. The trigger needs instagram_basic, instagram_manage_messages, pages_manage_metadata, pages_read_engagement, and pages_show_list.