Skip to main content
Button messages let users respond with a single tap, perfect for quick actions and surveys.

Send Button Message

const message = await client.messages.send({
  to: "+14155551234",
  text: "How would you rate our service?",
  channel: "whatsapp",
  messageType: "buttons",
  content: {
    buttons: [
      { id: "good", title: "Good" },
      { id: "average", title: "Average" },
      { id: "poor", title: "Poor" }
    ]
  }
});

Specifications

PropertyRequirement
Max buttons3
Button IDMax 256 chars, unique per message
Button titleMax 20 chars
Body text (text)Required, max 1024 chars

Handling Button Responses

When a user taps a button, you receive a webhook:
{
  "event": "message.received",
  "data": {
    "from": "+14155551234",
    "type": "button_reply",
    "button": {
      "id": "good",
      "title": "Good"
    }
  }
}
Use meaningful IDs like confirm_order or cancel_order to make webhook handling easier.

Use Cases

  • Customer satisfaction surveys
  • Order confirmations (Yes/No)
  • Appointment scheduling options
  • Quick response options
  • A/B testing user preferences