Create a template
Create a message template on a direct Meta number and send it to WhatsApp for review.
Set up WhatsApp first. Connect a WhatsApp number in the dashboard or with Connect numbers. Included on every paid plan. See plans.
It answers the new template with status pending. WhatsApp usually
reviews it within minutes. Run syncWhatsappTemplates later to see the
result. Only an approved template can be sent.
The number must list template_create in its capabilities.
For an image or document header, upload the file with
POST /whatsapp/media first and pass its media_id in header_media.
AI assistants connected through MCP can't upload files, so they create
text headers only. Create a video header, an authentication template, or
a link that changes per message in the dashboard.
Path parameters
number_idintegerrequiredId of a WhatsApp number in your workspace, from
listWhatsappNumbers.
A number in another workspace answers 404.
Body
namestringrequiredLower-case letters, digits and underscores, such as order_update. It must not be on the number already, in any language.
Match ^[a-z0-9_]{1,512}$
languagestringrequiredWhatsApp language code, such as en, en_US or hi.
Match ^[a-z]{2,3}(_[A-Z]{2})?$
categoryenumrequiredutility is for an update the customer expects, such as an order or
appointment. marketing is for anything else. WhatsApp can change the
category when it reviews the template.
One of: marketingutility
bodystringrequiredThe message text. Placeholders are numbered from {{1}} with no
gaps, such as Hi {{1}}, your order {{2}} has shipped.
headerstringOptional header text. It can hold one placeholder, {{1}}. Send header or header_media, not both.
header_mediaobjectOptional image or document header. Upload the file with
POST /whatsapp/media first: the media_id works for 24
hours. A header image is JPEG, PNG or WebP, and a header
document is PDF, Word (.docx), Excel (.xlsx) or plain text.
A header file is at most 5 MB. The file becomes a public link,
because WhatsApp fetches header media from one, and every send
of the template shows it.
+ Show child fields (2)− Hide child fields
typeenumrequiredOne of: imagedocument
media_idstringrequiredThe media_id from POST /whatsapp/media, uploaded with the same type and number.
header_examplestringSample value for the header's {{1}}. Required when the header has one.
body_examplesstring[]One sample value per body placeholder, in order. Required when the body has placeholders.
footerstringOptional footer text, with no placeholders.
buttonsobject[]Items 1 to 10
+ Show child fields (4)− Hide child fields
typeenumrequiredOne of: quick_replyurlphone_number
textstringrequiredThe button label.
urlstringRequired for url. A fixed link, with no placeholder.
phone_numberstringRequired for phone_number, in international format, such as +919876543210.
Was this page helpful?
