Skip to content

Postback Button Setup

Updated: Nov 21, 2025

Postback buttons allow you to define a payload that will be sent to your webhook whenever a user clicks the button. This can enable a feature that allows for automated chat responses with clients. To get started, familiarize yourself with the data that we will send your webhook on postback button click:

{  
  "field": "messaging_postbacks",  
  "value": {  
    "sender": {  
      "user_ref": "USER_REF_ID"  
    },  
    "recipient": {  
      "id": "PAGE_ID"  
    },  
    "timestamp": "1527459824",  
    "postback": {  
      "mid": "m_MESSAGE_ID",  
      "title": "TITLE_FOR_THE_CTA",  
      "payload": "USER_DEFINED_PAYLOAD",  
      "referral": {  
        "ref": "USER_DEFINED_REFERRAL_PARAM",  
        "source": "SHORT_URL",  
        "type": "OPEN_THREAD"  
      }  
    }  
  }  
}

Reference the following table to understand what each of the above fields is referring to:

PropertyDescription
postback.midThe ID for the message
postback.payloadInformation defined in the CTA payload parameter. This is only included in the webhook notification sent to the app that sent the message to the person.
postback.referralInformation about the action the person took to enter a conversation. The referral property information is included in the webhook notification only when a person starts a conversation using one of the following then clicking a CTA such as a Get Started button: * An m.me Link * A Click to Messenger Ad * A Messenger QR Code * A Welcome Screen
postback.referral.refThe arbitrary data that was originally passed in the ref param added to the m.me link. Only alphanumeric characters as well as -, _, and = are supported
postback.referral.sourceThe URL for this referral. For m.me links, the value of source is "SHORTLINK". For referrals from Messenger Conversation Ads, the value of source is "ADS"
postback.referral.typeThe identifier for the referral. For referrals coming from m.me links, it will always be "OPEN_THREAD".
postback.titleThe title for the Call To Action (CTA) that a person clicked
recipient.idThe ID for your Facebook Page
sender.user_refThe ID for the reference for a person who took an action, such as clicked a Get Started, or Persistent Menu item, that sent a message
timestampThe Unix timestamp for date when the webhook notification was sent to your server

Follow these steps to set up and enable your own webhook to start working with postback messages:

  • You will need to setup a webhook to respond to the payload that we send when the button is clicked.
  • Open your app on the developers' app page
  • On the left-hand side select Webhooks.
  • Click the Select product dropdown and choose Page.
  • Fill in your webhook information and click Verify and save.
  • In the Webhook fields section, find the field messaging_postbacks and make sure the subscribe toggle is turned on.
  • You can send a test postback button with any payload and confirm that, on click, your webhook logs the event.

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About