Skip to content

Postback button

Updated: Jun 17, 2026

The postback button sends a messaging_postbacks event to your webhook with the string set in the payload property. This allows you to take an arbitrary action when the button is tapped. For example, you might display a list of products, then send the product ID in the postback to your webhook, where the product ID can be used to query your database and return the product details as a structured message.

Supported usage

Use the postback button with the following:

  • Persistent menu
  • Generic template
  • List template
  • Button template
  • Media template

Properties

PropertyTypeDescription
typeStringType of button. Must be postback.
titleStringButton title. 20 character limit.
payloadStringMessenger sends this data to your webhook. 1000 character limit.

Sample request

curl -X POST "https://graph.facebook.com/<LATEST_API_VERSION>/<PAGE_ID>/messages?access_token=<PAGE_ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": {
      "id": "<PSID>"
    },
    "message": {
      "attachment": {
        "type": "template",
        "payload": {
          "template_type": "button",
          "text": "Try the postback button!",
          "buttons": [
            {
              "type": "postback",
              "title": "Postback Button",
              "payload": "DEVELOPER_DEFINED_PAYLOAD"
            }
          ]
        }
      }
    }
  }'

Sample response

{
  "recipient_id": "1254477777772919",
  "message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P"
}

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