sendTemplate() in your bot code to deliver it to any number in your contact list.
New to templates? Understanding templates explains why WhatsApp makes you get them approved, and when to reach for one instead of a normal reply. This page is the hands-on how-to.
Template categories
When you create a template, you assign it to one of three categories. The category affects approval speed and how WhatsApp bills the message.UTILITY
Transactional messages tied to a user action or request — order confirmations, appointment reminders, shipping updates, payment receipts. Approved in minutes in most cases.
MARKETING
Promotional messages, product announcements, offers, and campaigns. Approval typically takes longer than UTILITY. Subject to per-message marketing pricing.
AUTHENTICATION
One-time passcodes and verification messages. Used for 2FA and account verification flows. Tightly scoped and approved quickly.
Template components
A template is made up of components. The only required component is a BODY. You can optionally add a HEADER (text or media), a FOOTER, and BUTTONS.BODY (required)
BODY (required)
The main text of the message. Supports variables using
{{1}}, {{2}} notation. Variable values are provided at send time.HEADER (optional)
HEADER (optional)
Displayed above the body. Can be plain text or a media type (image, video, document).
Placeholder rules
Two rules trip people up, both of them Meta’s:Number them in order from {{1}}
Placeholders must run {{1}}, {{2}}, {{3}} with no gaps. A body using only {{2}}, or jumping from {{1}} to {{3}}, is rejected — you’ll see Body variables must be sequential starting at {{1}} (no gaps).
A header or a URL button can hold one placeholder, and it must be {{1}}.
Give each one an example
Meta’s reviewers read your template as a message, not a form — so they need to see what real content looks like in it. When you build a template in the dashboard, a Variable examples card appears once your numbering is valid, with a box per placeholder. Fill in every one. The dialog won’t submit until you do. For a body readingHi {{1}}, your order {{2}} has shipped, sensible examples are Jane and A-4471.
Creating a template
Three ways, depending on where you are.- Via the dashboard
- Via the Code Agent
- Via the Broadcasting assistant
Open Settings → Templates and click Create Template. Fill in the name, category, language, and body, add a header, footer, or buttons if you want them, and fill in an example for each placeholder.A live preview on the left shows the message as your customer will see it. Click Create Template to submit it to Meta.
The live preview is hidden on phones, so you’d be composing blind. Templates are worth doing at a desk.
Template names must be lowercase letters, numbers, and underscores only, and must start with a letter. For example:
order_confirmation, appt_reminder_v2.Templates live under Settings → Templates. They didn’t move to the Tools tab with the database and the rest — a template belongs to your WhatsApp number rather than your bot’s runtime.
Template approval
After you submit a template, Meta reviews it. Approval times vary by category:- UTILITY — typically approved within minutes
- AUTHENTICATION — typically approved within minutes
- MARKETING — can take hours to a few days
This is worth knowing if you’re planning a broadcast around a new template: you can submit it and carry on working, rather than watching the page. Approval times still vary by category, so leave room for a MARKETING template to take a day or two.
Listing your templates
To see the current status of all templates for your project, ask the AI agent:“List my templates.”Or view them directly in the Templates section of your project dashboard.
Sending a template by hand
You don’t need code to send a template to one person. Open the Conversations tab, pick the contact, and click Send template in the composer. Fill in any placeholders and send — this is how you reach someone whose 24-hour window has closed. Paige also keeps a standard conversation starter template for exactly that job. See The conversation starter.Sending a template in bot code
Once a template is approved, usesendTemplate() in your bot code to send it.
to— recipient phone number (e.g."27821234567")templateName— the exact name of the approved templatelanguageCode— language code used when the template was created (e.g."en","en_US","pt_BR")components— array of component objects providing variable values at send time
Variable indices in the
components array at send time must match the {{1}}, {{2}} placeholders in the template definition, in order.