Skip to main content

CreateTemplateRequest

Either components (your copy) or libraryTemplateName (Meta's copy) — sending both results in 422.

namestringrequired

Lowercase letters, digits and underscore only.

Possible values: non-empty and <= 512 characters, Value must match regular expression ^[a-z0-9_]+$

Example: confirmacao_pedido
categorystringrequired

Possible values: [MARKETING, UTILITY, AUTHENTICATION]

componentsobject[]

Components in Meta's dialect (HEADER, BODY, FOOTER, BUTTONS), with examples in example.header_text, example.body_text or example.body_text_named_params.

Required, except when the template comes from the library.

Possible values: >= 1

libraryTemplateNamestring

Name of the item in Meta's library (GET /templates/library) — not your template's name, which goes in name. With it, components is not sent: the copy is written by Meta.

Possible values: <= 512 characters

Example: delivery_update_1
libraryTemplateButtonInputsobject[]

What each button of the item needs, in Meta's dialect — the button URL ({ type: URL, url: { base_url, url_suffix_example } }) or the phone number ({ type: PHONE_NUMBER, phone_number }). Only valid alongside libraryTemplateName.

Possible values: <= 10

libraryTemplateBodyInputs object

Tweaks the item allows. Only valid alongside libraryTemplateName.

addContactNumberboolean
addLearnMoreLinkboolean
addTrackPackageLinkboolean
addSecurityRecommendationboolean

Authentication templates — the "do not share this code" notice.

codeExpirationMinutesinteger

Authentication templates — how long the code lasts, in minutes.

Possible values: >= 1 and <= 90

languagestring

Possible values: >= 2 characters

Default value: pt_BR
wabaIdstring
allowCategoryChangeboolean

Lets Meta reclassify the category instead of rejecting the template.

Default value: true
parameterFormatstring

Inferred from the text when omitted. Declaring a format that contradicts the text results in 422.

Possible values: [POSITIONAL, NAMED]

CreateTemplateRequest
{
"name": "confirmacao_pedido",
"category": "MARKETING",
"components": [
{}
],
"libraryTemplateName": "delivery_update_1",
"libraryTemplateButtonInputs": [
{}
],
"libraryTemplateBodyInputs": {
"addContactNumber": true,
"addLearnMoreLink": true,
"addTrackPackageLink": true,
"addSecurityRecommendation": true,
"codeExpirationMinutes": 0
},
"language": "pt_BR",
"wabaId": "string",
"allowCategoryChange": true,
"parameterFormat": "POSITIONAL"
}