curl --request POST \
--url https://api.wsapi.chat/messages/buttons \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"to": "1234567890@s.whatsapp.net",
"text": "Can we confirm your appointment for tomorrow at 10:00?",
"footer": "Reply with a button",
"buttons": [
{
"id": "confirm",
"text": "Confirm"
},
{
"id": "reschedule",
"text": "Reschedule"
},
{
"id": "cancel",
"text": "Cancel"
}
]
}
'{
"id": "01234567890123456"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 409,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Send a buttons message (beta)
Beta. Send a message with 1 to 3 buttons. The response contains the message ID.
Button types can be mixed in one message:
reply(default) — sends a reply back to you. Needs anid, unique within the message. Tapping it produces amessageevent of typebutton_replywith the button’sidandtext. This is the only button type that produces an event.url— opensurlon the recipient’s device.copy— copiescopyCodeto the recipient’s clipboard.call— callsphoneNumberfrom the recipient’s device.
Header and footer are text only. Set aiLabel to show WhatsApp’s “AI” badge on the message; it applies to 1:1 chats only and is ignored in groups.
Rendering: buttons render on phones and on WhatsApp Web.
Interactive messages rely on WhatsApp behaviour that is not an official contract and may change without notice. WhatsApp accepts the message even if a client does not render it, so a 201 response does not guarantee the buttons are displayed.
Limits mirror the WhatsApp Cloud API: text up to 1024 characters, header and footer up to 60, button text up to 20, button id up to 256.
curl --request POST \
--url https://api.wsapi.chat/messages/buttons \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"to": "1234567890@s.whatsapp.net",
"text": "Can we confirm your appointment for tomorrow at 10:00?",
"footer": "Reply with a button",
"buttons": [
{
"id": "confirm",
"text": "Confirm"
},
{
"id": "reschedule",
"text": "Reschedule"
},
{
"id": "cancel",
"text": "Cancel"
}
]
}
'{
"id": "01234567890123456"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 409,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Instance or customer-level API key. Either the instance's own API key or the customer's API key is accepted. Must be paired with the X-Instance-Id header to identify the target instance.
Headers
The ID of the WhatsApp instance to use
Body
Message body
1024Buttons to show. Types can be mixed. Reply button ids must be unique within the message.
1 - 3 elementsShow child attributes
Show child attributes
Optional header text shown above the body
60Optional footer text shown below the body
60Show WhatsApp's "AI" badge on the message. 1:1 chats only; ignored in groups.
Response
Resource created
ID of the created resource