Send templates
Templates are pre-approved message structures you use to start a conversation, send transactional notifications, or re-engage past customers — anything outside the 24-hour customer service window.
This page covers the simplest case: a body-only template with text parameters. For richer variants — header media, dynamic URL buttons, Flow buttons, named parameters — see the dedicated pages below.
Find your template
Section titled “Find your template”List templates already approved for your WhatsApp account:
curl https://api.kirimdev.com/v1/$PHONE_ID/templates \ -H "Authorization: Bearer $KIRIM_KEY"Each template returns its name, language, status (approved /
pending / rejected), and the parameterised body.
Send a body-only template
Section titled “Send a body-only template”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": "order_shipped", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Andi" }, { "type": "text", "text": "INV-4521" } ] } ] } }'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: 'order_shipped', language: 'id', components: [ { type: 'body', parameters: [ { type: 'text', text: 'Andi' }, { type: 'text', text: 'INV-4521' }, ], }, ], },})Positional parameters fill the {{1}}, {{2}}, … placeholders in the
template body in declaration order.
Component shapes at a glance
Section titled “Component shapes at a glance”Templates support three component types. Each takes a parameters
array whose shape mirrors Meta’s
Cloud API reference
verbatim — Kirimdev does not re-shape it.
| Component | Purpose | Dedicated page |
|---|---|---|
header | Media or text shown above the body | Header media |
body | Parameterised text content | This page |
button (per index) | Dynamic URL, quick reply, copy code | Buttons |
button (sub_type: url) | OTP / verification code (AUTHENTICATION) | OTP |
button (sub_type: flow) | Trigger a Meta Flow | Flow buttons |
Parameters can be positional (default) or named — see Named parameters.
Language object form
Section titled “Language object form”Meta accepts language as either a bare string code ("id",
"en_US") or an object { code, policy? }. Kirimdev accepts both —
prefer the string form since policy was deprecated by Meta.