> ## Documentation Index
> Fetch the complete documentation index at: https://onextel-09023014.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Callback: Button Clicks

> Callback payload structure for inbound WhatsApp button interactions submitted under incoming message events.

When an end user taps a button in a WhatsApp message, the OneXtel platform posts a
Button Click callback to your configured endpoint. Button clicks are inbound button
interactions submitted under incoming message events, so the payload follows the same
structure as [Incoming Messages](/api-reference/whatsapp/callback-incoming-messages)
with a `button` object in place of the message content objects.

> [!NOTE]
>
> In the sample below, each field's value shows that field's JSON path rather than an
> example value. All leaf fields are typed as `string`.

## Payload format

```json theme={null}
{
  "custref1": "custref1",
  "custref2": "custref2",
  "custref3": "custref3",
  "custref4": "custref4",
  "custref5": "custref5",
  "entry": [
    {
      "id": "entry.id",
      "changes": [
        {
          "value": {
            "messages": [
              {
                "id": "entry.changes.value.messages.id",
                "timestamp": "entry.changes.value.messages.timestamp",
                "type": "entry.changes.value.messages.type",
                "context": {
                  "id": "entry.changes.value.messages.context.id",
                  "from": "entry.changes.value.messages.context.from"
                },
                "from": "entry.changes.value.messages.from",
                "button": {
                  "text": "entry.changes.value.messages.button.text",
                  "payload": "entry.changes.value.messages.button.payload"
                }
              }
            ],
            "metadata": {
              "display_phone_number": "entry.changes.value.metadata.display_phone_number",
              "phone_number_id": "entry.changes.value.metadata.phone_number_id"
            },
            "messaging_product": "entry.changes.value.messaging_product",
            "contacts": [
              {
                "profile": {
                  "name": "entry.changes.value.contacts.profile.name"
                },
                "wa_id": "entry.changes.value.contacts.wa_id"
              }
            ]
          },
          "field": "entry.changes.field"
        }
      ]
    }
  ]
}
```

## Field reference

**custref1** `string`

Custom reference field 1, echoed back from the original send request. See
[custom reference passthrough](/api-reference/whatsapp/callback-events#custom-reference-passthrough).

**custref2** `string`

Custom reference field 2, echoed back from the original send request.

**custref3** `string`

Custom reference field 3, echoed back from the original send request.

**custref4** `string`

Custom reference field 4, echoed back from the original send request.

**custref5** `string`

Custom reference field 5, echoed back from the original send request.

**entry** `array of object`

Container array for the callback event.

**entry\[] properties**

**id** `string`

Identifier of the entry.

**changes** `array of object`

Array of change events within this entry.

**changes\[] properties**

**value** `object`

The event data for this change.

**value properties**

**messages** `array of object`

Inbound message objects carrying the button interaction.

**messages\[] properties**

**id** `string`

Identifier of the inbound message.

**timestamp** `string`

Timestamp of the button click message.

**type** `string`

Type of the inbound message.

**from** `string`

Sender of the inbound message.

**context** `object`

Context referencing the message that contained the button.

**context properties**

**id** `string`

Identifier of the referenced message.

**from** `string`

Sender of the referenced message.

**button** `object`

Details of the button the user tapped.

**button properties**

**text** `string`

Display text of the button that was clicked.

**payload** `string`

Payload configured for the button.

**metadata** `object`

Metadata about the business number that received the interaction.

**metadata properties**

**display\_phone\_number** `string`

Display phone number of the business.

**phone\_number\_id** `string`

Phone number identifier of the business.

**messaging\_product** `string`

Messaging product for the event.

**contacts** `array of object`

Contact details of the user who clicked the button.

**contacts\[] properties**

**profile** `object`

Contact profile information.

**profile properties**

**name** `string`

Profile name of the contact.

**wa\_id** `string`

WhatsApp ID of the contact.

**field** `string`

Field name describing the change.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.