messaging_postbacks Webhook Event Reference

Postbacks occur when a postback button, Get Started button, or persistent menu item is tapped.

The payload field passed is defined in the above places.

You can subscribe to this callback by selecting the messaging_postbacks field when setting up your webhook.

Example

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "postback":{
    "title": "<TITLE_FOR_THE_CTA>",  
    "payload": "<USER_DEFINED_PAYLOAD>",
    "referral": {
      "ref": "<USER_DEFINED_REFERRAL_PARAM>",
      "source": "<SHORTLINK>",
      "type": "OPEN_THREAD",
    }
  }
}    

Properties

Breaking Change (May 5, 2020)

Graph API v7.0+ messaging_postback webhook event from the chat plugin will not be returning sender.id field. It will return a new sender.user_ref field. This changes will take effect on all older Graph API versions starting Nov 2, 2020.

sender

PropertyTypeDescription

id

String

The PSID of the user that triggered the webhook event.

user_ref

String

The user_ref of the user that triggered the webhook event. This is only available for webhook event from the chat plugin.

recipient

PropertyTypeDescription

id

String

Your Page ID.

postback

Property Type Description

title

String

Title for the CTA that was clicked on. This is sent to all apps subscribed to the page. For apps other than the original CTA sender, the postback event will be delivered via the standby channel.

payload

String

payload parameter that was defined with the button. This is only visible to the app that send the original template message.

referral

Structure follows referral event

Referral information for how the user got into the thread.

postback.referral

This section is present only if:

The information contained in this section follows that of the referral webhook.