metaAds.onInstagramMessageReceived starts when someone sends a selected Instagram professional account a direct message.
automations/meta-ads-on-instagram-message-received.automation.ts
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 asrecipientIdto replyinstagramAccountId,recipientId,messageId, andtimestampin Unix millisecondstextandattachments, such asimage,video,ig_reel,ig_post, orstory_mentionquickReplyPayload,replyTowith a replied-tomessageIdorstory, andreferralfor Click-to-Instagram-Direct adsisUnsupported,truewhen Meta can’t render the message content
messageId starts at most one run. The trigger needs instagram_basic, instagram_manage_messages, pages_manage_metadata, pages_read_engagement, and pages_show_list.