Send templates
Send templates with a Flow button
A Flow button opens an interactive multi-screen experience built
with WhatsApp Flows.
When the template was approved with a FLOW button, you launch it at
send time with sub_type: "flow".
Send a template with a Flow button
Section titled “Send a template with a Flow button”curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "appointment_booking", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Andi" } ] }, { "type": "button", "sub_type": "flow", "index": 0, "parameters": [ { "type": "action", "action": { "flow_token": "tok_abc123", "flow_action_data": { "customer_name": "Andi", "preferred_slot": "2026-06-01T10:00:00+07:00" } } } ] } ] } }'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: 'template', template: { name: 'appointment_booking', language: 'id', components: [ { type: 'body', parameters: [{ type: 'text', text: 'Andi' }], }, { type: 'button', sub_type: 'flow', index: 0, parameters: [ { type: 'action', action: { flow_token: 'tok_abc123', flow_action_data: { customer_name: 'Andi', preferred_slot: '2026-06-01T10:00:00+07:00', }, }, }, ], }, ], },})Parameter shape
Section titled “Parameter shape”| Field | Required | Purpose |
|---|---|---|
flow_token | Yes | Opaque string you generate to correlate the Flow response with this send. Echoed back in the webhook. |
flow_action_data | No | JSON object pre-populating the first screen of the Flow. Schema is defined by your Flow JSON. |
Receiving the response
Section titled “Receiving the response”When the customer completes the Flow, your webhook receives an
interactive message with interactive.type = "nfm_reply" containing
the submitted form data plus your original flow_token. Use the
token to look up which send the response belongs to.
{ "type": "interactive", "interactive": { "type": "nfm_reply", "nfm_reply": { "name": "flow", "response_json": "{\"customer_name\":\"Andi\",\"slot\":\"...\"}", "body": "Form submitted" } }}See Receive messages for the full webhook envelope.