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"
}Messages
Send a buttons message
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.
A 201 response means WhatsApp accepted the message. How it is displayed is up to the recipient’s WhatsApp app, and may change as WhatsApp evolves.
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.
POST
/
messages
/
buttons
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
Body
application/json
Message body
Maximum string length:
1024⌘I