Bind template variables

Sets where each variable ({{N}}) of an existing template gets its value at send time, the way the Modelos de mensagem screen does. Works for any template of a WhatsApp Official channel of the account, including one created directly on Meta. Only the variables sent are written; the others keep their binding. When Meta approved the template and no variable is left without a source, its status becomes APPROVED at once and it can be sent and used in campaigns. Requires the message-templates:write scope. Send every binding of a template in one call and never call it in parallel for the same template: concurrent calls can overwrite each other's bindings. Unknown item keys are ignored; fallback is refused unless source is field outside buttons.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
uuid
required

UUID

Body Params
mappings
array of objects
required
length between 1 and 20
mappings*
string
enum
required

Where the variable is: header (text header), body, or buttons (the {{1}} of a dynamic URL button).

Allowed:
string
required
^\{\{\d+\}\}$

The variable, as the template lists it in variables.

.variables.

string
enum
required

field: the value comes from a CRM field at send time. fixed: the same text on every send (never on a button).

Allowed:
string
required
length between 1 and 1024

With source field, the CRM field as [ENTITY.FIELD] (for example [CONTACT.FIRST_NAME], [DEAL.STAGE], [ORGANIZATION.NAME]; a custom field uses its key in upper case). With source fixed, the text, with no line break, tab or four spaces in a row.

string
length ≤ 1024

Only with source field, outside buttons (refused anywhere else): the text used when the field is empty for the contact.

Headers
string
required

API Token

Responses

401

Authentication error - invalid or missing api-token

403

The API key lacks the message-templates:write scope

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json