create_whatsapp_template
Create a WhatsApp message template and submit it to WhatsApp for review (WhatsApp Business API numbers only). It works in steps. Call it with whatever the user has given so far: if anything is missing or breaks a WhatsApp rule, it returns needsInput with the exact questions to ask, and nothing is created. When everything is valid it returns a preview and a confirmToken, still without creating anything. Show the preview; only after the user approves, call it again with the same fields plus the confirmToken. Supports text, image, video, document and location headers, body variables ({{1}} or {{first_name}}) with sample values, a footer, quick reply, URL, phone number and copy code buttons, and authentication (one-time code) templates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Message body, up to 1024 characters. Mark per-message values with {{1}}, {{2}} or named variables like {{first_name}}; never at the very start or end, and never next to each other. Not used for AUTHENTICATION templates. | |
| name | No | Template name: lowercase letters, numbers and underscores, e.g. order_ready | |
| device | No | WhatsApp Business API device ID (24 hex characters) that will own the template. Use get_whatsapp_devices to find it. | |
| footer | No | Optional footer, up to 60 characters, without variables | |
| header | No | Optional header shown above the body | |
| buttons | No | Optional buttons: up to 10 in total, at most 2 URL, 1 PHONE_NUMBER and 1 COPY_CODE, with quick replies grouped together | |
| category | No | MARKETING (promotions and offers), UTILITY (order, account or appointment updates) or AUTHENTICATION (one-time codes) | |
| language | No | WhatsApp language code of the template text, e.g. en_US, es, pt_BR | |
| bodyExamples | No | One realistic sample value per body variable, keyed by the variable: {"1": "Maria"} or {"first_name": "Maria"}. Ask the user for them; never invent them. | |
| confirmToken | No | Token returned with the preview. Pass it only after the user approved that exact preview. | |
| authentication | No | Options for AUTHENTICATION templates only |