Send messages
Send interactive buttons
Kirim exposes WhatsApp’s interactive button surface as
type: "interactive" with one of three nested subtypes:
cta_url (this page), list
(Send lists), and carousel (a horizontally
scrollable strip of cards — see the
API reference for the
full schema).
A CTA URL button replaces a raw URL in the message body with a labelled tap target — better click-through and no exposed link.
curl -X POST \ https://api.kirim.chat/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "cta_url", "body": { "text": "Pesananmu siap diambil." }, "action": { "name": "cta_url", "parameters": { "display_text": "Lihat detail", "url": "https://example.com/orders/42" } } } }'import { Kirim } from '@kirimdev/sdk'
const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!)
await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'cta_url', body: { text: 'Pesananmu siap diambil.' }, action: { name: 'cta_url', parameters: { display_text: 'Lihat detail', url: 'https://example.com/orders/42', }, }, },})Limits
Section titled “Limits”| Field | Limit |
|---|---|
body.text | 1–1024 chars |
parameters.display_text | 1–20 chars |
parameters.url | Valid HTTPS URL |
See also
Section titled “See also”- Send interactive lists
- API Reference — Send a WhatsApp message (see the Interactive request-body tab)