Create a message template
/v1/whatsapp/templatesconst template = await bird.whatsapp.templates.create({
waba: "102290129340398",
slug: "order_update",
name: "Order update",
category: "utility",
default_language: "en",
languages: {
en: {
components: [
{
type: "body",
text: "Your order {{order_id}} has shipped.",
example_parameters: [{ type: "text", name: "order_id", text: "A-4192" }],
},
],
},
},
});
console.log(template.id, template.draft_version_id);template = client.whatsapp.templates.create(
waba="102290129340398",
slug="order_update",
name="Order update",
category="utility",
default_language="en",
languages={
"en": {
"components": [
{
"type": "body",
"text": "Your order {{order_id}} has shipped.",
"example_parameters": [
{"type": "text", "name": "order_id", "text": "A-4192"}
],
}
]
}
},
)
print(template.id, template.draft_version_id)template, err := client.Whatsapp.Templates.Create(context.Background(), bird.WhatsappTemplatesCreateParams{
Waba: "102290129340398",
Slug: "order_update",
Name: bird.String("Order update"),
Category: "utility",
DefaultLanguage: "en",
Languages: map[string]bird.WhatsAppTemplateLanguageUpsert{
"en": {Components: &[]bird.WhatsAppTemplateComponentWrite{{
Type: "body",
Text: bird.String("Your order {{order_id}} has shipped."),
ExampleParameters: &[]bird.WhatsAppTemplateExampleParameterWrite{
{Type: "text", Name: bird.String("order_id"), Text: bird.String("A-4192")},
},
}}},
},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(template.Id, template.Name)$template = $bird->whatsapp->templates->create(
(new WhatsAppTemplateCreate())
->setWaba('102290129340398')
->setSlug('order_update')
->setName('Order update')
->setCategory('utility')
->setDefaultLanguage('en')
->setLanguages([
'en' => (new WhatsAppTemplateLanguageUpsert())->setComponents([
(new WhatsAppTemplateComponentWrite())
->setType('body')
->setText('Your order {{order_id}} has shipped.')
->setExampleParameters([
(new WhatsAppTemplateExampleParameterWrite())->setType('text')->setName('order_id')->setText('A-4192'),
]),
]),
]),
);
echo $template->getId(), ' ', $template->getDraftVersionId(), "\n";bird whatsapp templates create order_update --body-file - <<'JSON'
{
"waba": "102290129340398",
"slug": "order_update",
"name": "Order update",
"description": "Sent when a customer's order ships.",
"category": "utility",
"default_language": "en",
"on_missing_language": "fallback",
"languages": {
"en": {
"components": [
{
"type": "body",
"text": "Your order {{order_id}} has shipped.",
"example_parameters": [
{
"type": "text",
"name": "order_id",
"text": "A-4192"
}
]
}
]
}
}
}
JSONcurl -X POST "https://us1.platform.bird.com/v1/whatsapp/templates" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"waba": "102290129340398",
"slug": "order_update",
"name": "Order update",
"description": "Sent when a customer'\''s order ships.",
"category": "utility",
"default_language": "en",
"on_missing_language": "fallback",
"languages": {
"en": {
"components": [
{
"type": "body",
"text": "Your order {{order_id}} has shipped.",
"example_parameters": [
{
"type": "text",
"name": "order_id",
"text": "A-4192"
}
]
}
]
}
}
}'{
"id": "wat_01krdgeqcxet5s7t44vh8rt9mg",
"slug": "bird_otp",
"name": "Order update",
"description": "Sent when an order ships.",
"scope": "system",
"waba": "102290129340398",
"category": "authentication",
"status": "active",
"default_language": "pt-BR",
"on_missing_language": "fallback",
"language_source_required": false,
"available_languages": [
"pt-BR"
],
"languages": {
"en": {
"status": "approved"
}
},
"draft_version_id": "wav_01krdgeqcxet5s7t44vh8rt9mg",
"live_version_id": "wav_01krdgeqcxet5s7t44vh8rt9mg",
"pending_version_id": "wav_01krdgeqcxet5s7t44vh8rt9mg",
"last_submitted_at": "2026-07-26T16:40:00Z",
"next": [
{
"kind": "operation"
}
]
}
Creates a WhatsApp message template. Supply languages to seed its first draft in the same call, or omit it to create the template alone and add content through the version and language paths. Nothing here reaches Meta: content is submitted for review as a separate, explicit step, so a template this call returns is draft and not yet sendable.
Request Payload
wabaThe WhatsApp Business Account to author this template on. A template belongs to one account at Meta and is reviewed, approved and sent under it, so every create names the account explicitly. It must be an account connected to this workspace.
slugThe template's workspace-unique handle, and what a send references. Editable only before the first submission. The bird_ prefix is reserved for our built-in templates and is rejected. Meta's own template name is derived from this handle, so the handle itself is validated against the charset Meta accepts.
nameThe template's display name, shown wherever the template is listed. Free text, changeable at any time. Defaults to the slug when omitted.
descriptionWhat the template is for. Free text.
categoryThe category Meta reviews the template under. Required, because Meta demands one on every template it holds and it determines what a send costs. There is no default. Meta can recategorize a template after review; the per-language summary reports what it actually holds.
Possible values: authentication, utility, marketing
default_languageThe language a send uses when it names none, and the last resort when a requested language is unavailable. When languages is supplied it must be one of its keys.
on_missing_languageHow a send behaves when it asks for a language this template does not carry. Defaults to fail: a WhatsApp send that silently fell back would deliver approved copy the recipient did not expect, at a price the sender did not choose.
Possible values: fallback, fail
language_source_requiredWhether a send has to name a language. Set it to have a send that names none rejected, leaving the default language for sends that ask for it.
languagesOptional seed for the template's first draft, keyed by BCP-47 language
tag. Supplying it opens the draft and writes every language in one
transaction: any invalid entry fails the whole create, leaving no
template behind. Tags are canonicalised, so pt-br lands as pt-BR, and
two keys canonicalising to one tag are rejected.
Omit it to create the template with no draft, and add content later through the version and language paths. Nothing here reaches Meta: content is submitted, never created.
Response Payload
idStable Bird identifier for the template.
slugThe template's handle, editable before the first submission. Address it by this handle, and reference it when sending. Handles beginning with bird_ are reserved for our built-in templates.
slug_editableWhether the slug can still be changed. False after the first submission and for built-in templates.
nameA display name for the template. Nothing resolves through it, so it is safe to show wherever a human reads the template.
descriptionWhat the template is for. Null when unset.
scopeWhether the template is one of our built-in templates (system) or one your workspace created (workspace).
Possible values: system, workspace
wabaThe WhatsApp Business Account that holds this template's languages at Meta. Absent on a built-in template: those live on a WABA that Bird manages centrally rather than on your account, so it is not yours to reconcile against and is not disclosed.
categoryThe category you declared for the template. It is fixed once the template exists. Meta applies its own category per language and may move one, which is what messages are priced at. Read the language for that.
Possible values (may grow over time): authentication, utility, marketing
statusThe template's lifecycle, aggregated over its languages.
Possible values: draft, pending, active, rejected, inactive
default_languageThe language a send is served in when it names none, whichever on_missing_language is set. A template that sets language_source_required refuses such a send instead. Under fallback it is also the last hop for a language that is not in available_languages, whether the template holds no copy in it or holds one WhatsApp has not approved. The template is required to hold this default, and it must itself be in available_languages for a send to resolve here.
on_missing_languageWhat a send does when the language it asks for has no approved copy. Defaults to fail on WhatsApp, because every language is separately approved and separately priced: falling back silently would send content the recipient did not expect at a rate the sender did not choose.
Possible values: fallback, fail
language_source_requiredWhen true, a send must name a language explicitly rather than letting the template resolve one.
available_languagesThe languages a send can resolve right now: approved and not held back by Meta. It shrinks for reasons you did not cause: Meta pauses, disables, archives or limits a language and it leaves the set with nobody having edited anything. Read languages to see which languages exist and why one is missing.
languagesWhere each of the template's languages stands, keyed by BCP-47 language tag. This is the summary of the version currently in service, so a template reading active can still hold a rejected or paused language: the aggregate says something is sendable, and this says which. Content is not here; it lives under a version.
draft_version_idThe open draft, or null when nobody is editing. Non-null is the answer to whether this template has unsubmitted work: a draft exists only because someone opened one.
live_version_idThe version Meta is serving. A version goes live as a unit the moment any of its languages is approved, superseding the one before it. Null until a first approval.
pending_version_idA submitted version still awaiting verdicts: what to poll. It stays set while any language is unresolved, including after a sibling's approval took the version live. Null when nothing is outstanding.
last_submitted_atWhen this template was last submitted. Null for a pre-approved built-in template.
created_atWhen the template was created. Null for a built-in template, which Bird ships rather than stores.
updated_atWhen the template was last modified. Null for a built-in template, which Bird ships rather than stores.
nextWhat to do next with this template, given the state it is in. Each entry names one action and says why it is worth taking, so you can act on this response without working out the order yourself. Present on reads that compute it: an empty list means there is nothing to do, and the field is absent entirely on responses that do not report next actions.
A draft template routes to opening its draft, a pending one to the version
under review, and a rejected or inactive one to a fresh draft. The template's
status is the aggregate over its languages, so an entry may send you to the
version to see where each language actually stands.
चाइल्ड एट्रिब्यूट दिखाएँ
next.kindWhat you do about this step.
operation: call the operation named inoperation, then read again.external: act somewhere this API does not reach, then read again.wait: nothing is asked of you, so read again later.terminal: nothing you do resolves this, so stop retrying.
Tolerate a value you do not recognize: show the description and
offer no action.
Possible values (may grow over time): operation, external, wait, terminal
next.descriptionA short, human-readable label for the step, suitable for display.
next.operationThe operationId to call. Present only when kind is operation. The operation's own schema says how to call it; this says only which one, and what to address it with.
next.paramsThe parameters that address the operation, by name: {"sender_id": "…"} for an operation on /v1/sms/senders/{sender_id}/requirements. A parameter the operation takes in its query string is given the same way, so an operation addressed as ?subject_id= carries {"subject_id": "…"}. Every parameter the call needs is here, whether its value came from the thing you were acting on or is fixed for this step, so you can make the call from this object alone. Present only when kind is operation and the operation names a subject. A request body, when the operation takes one, is described by the operation's own schema and never appears here.
next.urlA URL to open. Present only when kind is external, and only when the step has one. An external step whose description says to go and do something with no URL to open is normal.
संबंधित संसाधन
इस विषय के लिए दस्तावेज़, गाइड और उदाहरणों के साथ आगे बढ़ें।