create_template
Create a new WhatsApp message template on the connected WhatsApp Business Account. Placeholders in body/header/URL use positional {{1}}, {{2}} … syntax. IMPORTANT — personalisation: for EVERY body placeholder you MUST set variable_mapping so it fills with each contact's real data at send time. Map {{1}} to a contact field: { "1": "name" } fills {{1}} with the contact's name; { "1": "name", "2": "fields.plan_tier" } maps a custom field. Without a mapping the placeholder sends as a blank space to everyone — NOT the sample value. body_examples is a SEPARATE thing: one sample value per placeholder (e.g. a name like Alex) used ONLY to satisfy Meta's approval review; it is never sent to a contact. Meta REQUIRES body_examples when the body has placeholders, so supply BOTH body_examples (for approval) and variable_mapping (for real personalisation). name must be lowercase letters, numbers and underscores. category is MARKETING, UTILITY, or AUTHENTICATION. New templates start PENDING Meta review — only APPROVED templates can be broadcast (poll with sync_templates / list_templates). VIDEO HEADER: pass header_video_url with a public link to an .mp4 to attach/embed a video at the top of the message; it is uploaded to WhatsApp for approval and re-sent with every broadcast. A template has ONE header, so set header_text OR header_video_url, not both. Returns the stored template row (or { id, status }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Body text; use {{1}}, {{2}} … for variables | |
| name | Yes | Lowercase a-z, 0-9 and underscores, e.g. order_update | |
| buttons | No | ||
| category | Yes | ||
| language | No | Language code, default "en_US" | |
| footer_text | No | Optional footer text | |
| header_text | No | Optional text header (max 1 placeholder). Mutually exclusive with header_video_url | |
| body_examples | No | Meta approval sample for each body placeholder, in order ({{1}}, {{2}}, …). For Meta review only — NEVER sent to a contact. Use variable_mapping for real personalisation. | |
| header_video_url | No | Public URL of an .mp4 to attach/embed as a video header. Mutually exclusive with header_text. WhatsApp reviews the video before the template can send. | |
| variable_mapping | No | Maps each placeholder number to the contact field that fills it at send time, e.g. { "1": "name", "2": "fields.plan_tier" }. Set one entry per body placeholder or it sends blank. Values: a top-level field (name) or fields.<key> for a custom field. |