/templatesCreate a template
Creates an SMS or WhatsApp template. Saved as a DRAFT; send it for review with POST /templates/{templateId}/submit. SMS and WhatsApp; Viber templates are not offered yet. An SMS template takes content and optionally variables and messageType. A WhatsApp template is Meta's: name, language, category and components as Meta defines them, on one of your WhatsApp accounts, within the supported subset (see TemplateCreate.components). Scope portal:write.
Request body
application/jsonViber templates are not offered through the API yet.
Values:smswhatsappprofileIdstring (uuid)requiredAn SMS sender or a WhatsApp account of the brand.
namestringrequired· min 1 chars· max 100 charsWhatsApp: lowercase letters, digits and
_, as Meta names templates.languagestring· max 20 charsWhatsApp only, a language Meta reviews templates in.
Example:
"en"categorystringWhatsApp only.
Values:MARKETINGUTILITYcomponentsarray of object· max 10 itemsWhatsApp only. Meta's template components, as Meta defines them: one
BODY, and optionally aHEADER, aFOOTERandBUTTONS. Parameters are named ({{order_number}}). Carousels, limited-time offers and call requests are not supported yet (400on the component).A
HEADERisformat: TEXTwith itstext, orformat: IMAGE,VIDEOorDOCUMENTwith the file inexample.header_handle: a one-item array holding theidPOST /mediaanswered, as in{type: HEADER, format: IMAGE, example: {header_handle: [med_3f9c…a18.jpg]}}. The file must be of the header's kind (an image forIMAGE, a video forVIDEO, a PDF forDOCUMENT) and uploaded by your brand; anything else is a400oncomponents[i].example.header_handle[0]. The template is held to Meta's rules before it is saved, the same rules the portal's builder checks. Each one broken is an entry in the400'serrors, on the field that broke it (components[0].text,components[2].buttons[1].url) with its owncode, for examplebody_starts_or_ends_with_variable(the body opens or closes on a variable),adjacent_variables(two variables with nothing between them),too_many_variables(too many for the length of the text),footer_has_variables,header_too_many_variables,label_too_long,bad_phone(not+and digits),bad_url(nothttps://),url_has_variable(a variable before the end of a link),too_many_buttons,too_many_of_one_kind,quick_replies_split(quick replies not side by side) andcopy_code_not_marketing.messagesays the rule in words; branch oncode.contentstring· max 2000 charsSMS only, with
#{variable}placeholders.messageTypestringSMS only.
Values:MARKETINGTRANSACTIONALDefault:
"MARKETING"The placeholders' fallbacks, sent to a contact without a value. Sent, the list replaces the template's. SMS: a contact field's (
first_name, ...) fallback is written into its placeholders; any other name is the template's own variable and needs atype(short_text,name,number,amount,date,time,reference,otp). WhatsApp: eachfallbackis that parameter's.
Responses
Ready to send your first message?
We set up your account, sender profiles and API key with you, and help you through the first integration.

