Sending & receiving
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.
Find your template
Section titled “Find your template”List templates already approved for your WhatsApp account:
curl https://api.kirim.chat/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 template
Section titled “Send a template”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": "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' }, ], }, ], },})Component shapes
Section titled “Component shapes”Templates support header, body, and button components. Each
takes a parameters array whose shape mirrors Meta’s
Cloud API reference
verbatim — Kirim does not re-shape it:
| Component | Parameter types |
|---|---|
header | text, image, video, document (one per template) |
body | text (positional — fill {{1}}, {{2}} in order) |
button (per index) | text (quick reply), payload (URL / copy code) |
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? }. Kirim accepts both —
prefer the string form since policy was deprecated by Meta.
See also
Section titled “See also”- API Reference — Send a WhatsApp message (see the Template request-body tab)
- API Reference — List templates
- Recipe: Order Shipped Notifications