Skip to main content
metaAds.onMessengerMessageReceived starts when someone sends a selected Facebook Page a Messenger message.
automations/meta-ads-on-messenger-message-received.automation.ts
Messages the Page sends, read receipts, reactions, and button taps don’t start the trigger. Optional account selects a static project account binding. The event includes:
  • senderId, the person’s Page-scoped ID (PSID); pass it as recipientId to reply
  • pageId, recipientId, messageId, and timestamp in Unix milliseconds
  • text, attachments with each type and provider payload, and quickReplyPayload
  • replyToMessageId when the person replies to a specific message
  • referral when the message comes from a Click-to-Messenger ad, with adId, source, type, ref, and adsContextData
Each messageId starts at most one run. The trigger needs pages_manage_metadata, pages_messaging, and pages_show_list. Until the app has Advanced Access, Meta only delivers messages from people with a role on the Meta app.