Skip to content

Create message templates via API, SDK, and MCP

Released: June 14, 2026

You can now create WhatsApp message templates programmatically — previously the API surface was list / get / sync only, and authoring a template meant using the dashboard or Meta Business Manager.

The request body is components-only: it mirrors Meta’s message_templates create shape (the same philosophy as send_message mirroring the Cloud API send body). Provide a name, a category, a language, and a components array with exactly one BODY component (plus optional HEADER / FOOTER / BUTTONS). For IMAGE / VIDEO / DOCUMENT headers, supply example.header_url with a public HTTPS sample — see Create templates.

On success the template is submitted to Meta and persisted locally with status: "pending". Meta reviews asynchronously, so poll GET /v1/{phone_number_id}/templates/{name} (or re-run POST .../templates/sync) for the eventual approved / rejected transition.

Terminal window
curl -X POST https://api.kirimdev.com/v1/106540352242922/templates \
-H "Authorization: Bearer $KIRIM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "order_update",
"category": "UTILITY",
"language": "id",
"components": [
{
"type": "BODY",
"text": "Pesanan {{1}} sedang diproses.",
"example": { "body_text": [["A123"]] }
}
]
}'

A name + language pair that already exists on the account returns 409 template_already_exists (param: "name") before any Meta call, so a retry loop never burns Meta’s template-create rate limit on a known conflict. In the SDK this surfaces as a ConflictError.

const template = await kirim
.phoneNumbers('106540352242922')
.templates.create({
name: 'order_update',
category: 'UTILITY',
language: 'id',
components: [
{
type: 'BODY',
text: 'Pesanan {{1}} sedang diproses.',
example: { body_text: [['A123']] },
},
],
})
console.log(template.status) // "pending"

The MCP server gains a create_template tool wrapping the same endpoint, so AI assistants can author templates end-to-end and then sync_templates to surface the review outcome.