Message templates
List message templates
Return the WhatsApp message templates on this workspace with their approval status.
Lists WhatsApp templates with their status, category and variable placeholders. Use it before sending outside the 24-hour messaging window, when only an APPROVED template will deliver. Read-only. Filter with status, category or whatsapp_phone_number_id.
query Parameters
statusApproval status, e.g. APPROVED. Only APPROVED templates can be sent.
Approval status, e.g. APPROVED. Only APPROVED templates can be sent.
categoryTemplate category, e.g. MARKETING or UTILITY.
Template category, e.g. MARKETING or UTILITY.
whatsapp_phone_number_idRestrict to templates on one number, id from channels.phoneNumbers.
Restrict to templates on one number, id from channels.phoneNumbers.
limitRows to return, 1-100.
Rows to return, 1-100.
offsetRows to skip before reading.
Rows to skip before reading.
List message templates › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successCreate a draft template
Save a new template as a local draft, not yet submitted to Meta.
Creates a local draft template record (status PENDING, no Meta id) in this workspace. It is NOT sent to Meta and cannot be used for sending until it is submitted (templates.submit) and approved. Use it to prepare wording. Placeholders must be {{1}}, {{2}} in sequence, and variables must hold one example value per placeholder. Answers 409 when the name and language already exist.
Create a draft template › Request Body
templateNameLowercase letters, digits and underscores only, max 512 characters.
categoryMARKETING, UTILITY or AUTHENTICATION.
contentBody text. Use {{1}}, {{2}} for placeholders.
languageLanguage code such as id or en_US. Defaults to en_US.
headerTypeTEXT, IMAGE, VIDEO or DOCUMENT.
headerContentHeader text (max 60 chars) or a sample media URL/id. Required with headerType.
footerContentFooter text, at most 60 characters.
Up to 3 QUICK_REPLY buttons and up to 2 URL/PHONE_NUMBER buttons.
variablesOne example value per body placeholder, in order. Required when content has placeholders.
Create a draft template › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead one message template
Fetch a single WhatsApp template by id, with its body and variables.
Returns one template including its components, the variables it expects and its approval status. Use it after templates.list to learn exactly which parameters messages.send must supply. Read-only. Answers 404 when the id does not belong to this workspace.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Read one message template › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDelete a template
Delete a template locally and at Meta.
Permanently deletes the template. When it was submitted to Meta it is also deleted there (a failure at Meta is ignored and the local record is still removed), and its variable mappings stop applying. Messages already sent are unaffected, but broadcasts or flows that reference it will fail. A deleted name may be blocked from reuse at Meta. Cannot be undone.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Delete a template › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successEdit a template that is not approved
Change the content of a draft, pending or rejected template.
Edits the body, header, footer or buttons of a template. Approved templates cannot be edited (400): create a new one with a new name instead. The edit is local only: it does not resubmit to Meta and does not change the approval status, so call templates.submit afterwards when the template has been rejected. Passing no headerType clears the header.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Edit a template that is not approved › Request Body optional
contentNew body text.
headerTypeTEXT, IMAGE, VIDEO or DOCUMENT. Omit or null to remove the header.
headerContentNew header text or sample media.
footerContentNew footer, at most 60 characters.
Replacement button list.
Edit a template that is not approved › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successTemplate delivery analytics
Delivery, read and failure rates for one template.
Returns the quality rating and the delivery, read and failure counts and rates for one template. Use it to judge whether a template performs before reusing it in a broadcast. Read-only. The counts are computed over the template's 100 most recent messages, not its whole history.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Template delivery analytics › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successPreview a rendered template
Render a template with variable values without sending anything.
Fills a stored template's header, body, footer and buttons with the values you give and returns the final text. Use it to check wording before messages.send or broadcasts.create. Sends nothing and changes nothing. Keys of variableValues are either variable-library ids (templateVariables.list) or the placeholder numbers "1", "2" of the template body.
Preview a rendered template › Request Body
templateNameTemplate name from templates.list (template_name).
languageCodeTemplate language code, e.g. id or en_US.
Map of placeholder number or variable id to its value. Defaults to empty.
Preview a rendered template › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successValidate template variable values
Check values against the variable library's type rules before sending.
Validates the values you plan to send against the type rules of the named library variables (URL, currency, date and so on) and returns the errors per variable. Use it before messages.send or broadcasts.create. Sends nothing and changes nothing. Answers 404 when any listed variable id does not exist.
Validate template variable values › Request Body
variableIdsVariable ids from templateVariables.list to validate, at least one.
Map of variable id to the value you intend to send.
Validate template variable values › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successSync templates from Meta
Pull the current templates and statuses from every connected WhatsApp account.
Calls Meta for each connected WhatsApp Business account and upserts the local template records: new ones are created, changed statuses updated, and local templates that no longer exist at Meta are removed. Use it when templates.list looks stale after an approval. It sends nothing to customers. Heavy: one Meta call per account.
Sync templates from Meta › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successSubmit a template to Meta
Send a template to Meta for approval.
Submits the template to Meta for review. Practically irreversible: the template name is registered at Meta, a rejected or deleted name can be blocked from reuse for a period, and approved templates cannot be edited. Use it only when the wording is final (check templates.renderPreview first). Approval arrives later; read the status with templates.get or run templates.sync. Sends nothing to customers.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Submit a template to Meta › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successSend a test message of a template
Send one real WhatsApp message of an approved template to a test number.
Sends a REAL WhatsApp template message, without variable values, to the number you give. It is billed by Meta like any template conversation and cannot be recalled. Use it only to test your own device; to message a customer use messages.send. Only APPROVED templates, and only Indonesian numbers starting with +62, are accepted.
path Parameters
templateIdTemplate id from templates.list.
Template id from templates.list.
Send a test message of a template › Request Body
toTest number in international format starting with +62.
Send a test message of a template › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList quick replies
Return the workspace’s saved canned replies with their shortcuts.
Returns the quick replies the team has saved, each with its shortcut and text. Use it to answer in the workspace's own wording instead of inventing a phrasing. Read-only — sending the text is messages.send. Unlike WhatsApp templates these are internal text only, so they are not valid outside the 24-hour window. Paginated: follow meta.pagination.nextCursor until hasMore is false.
query Parameters
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
categoryIdOnly this category, id from quickReplies.categories.
Only this category, id from quickReplies.categories.
searchText to look for in the title, shortcut or content.
Text to look for in the title, shortcut or content.
List quick replies › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successCreate a quick reply
Save a new canned reply with a shortcut.
Creates a quick reply that every agent in the workspace can insert in the inbox by typing its shortcut. Writes the reply and sends nothing. Answers 409 when the shortcut is already taken.
Create a quick reply › Request Body
shortcutUnique shortcut, 1-50 characters, typed by agents to insert the reply.
titleLabel shown in the picker, 1-100 characters.
contentThe reply text, 1-4096 characters.
categoryIdCategory id from quickReplies.categories.
fileCenterFileIdFile to attach, id from quickReplies.attachments.
Create a quick reply › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successSearch quick replies
Find quick replies matching a typed fragment, as the inbox autocomplete does.
Autocomplete-style search over quick-reply shortcuts and titles. Use it when you have a few words and want the matching canned replies. An empty q returns an empty list. Read-only. For a full filtered listing use quickReplies.list.
query Parameters
qThe fragment to search for. Required; empty returns nothing.
The fragment to search for. Required; empty returns nothing.
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
Search quick replies › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead a quick reply by shortcut
Fetch one quick reply by its exact shortcut.
Returns the single quick reply whose shortcut matches exactly. Use it when the team refers to a canned reply by its shortcut. Read-only. Answers 404 when no reply has that shortcut.
path Parameters
shortcutThe exact shortcut from quickReplies.list, without a slash.
The exact shortcut from quickReplies.list, without a slash.
Read a quick reply by shortcut › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList attachable files for quick replies
Return the Files Center files that can be attached to a quick reply.
Lists the files a quick reply may carry as an attachment, each with the fileCenterFileId to pass to quickReplies.create or quickReplies.update. Read-only. At most 100 files.
List attachable files for quick replies › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList quick reply categories
Return the categories quick replies are grouped under.
Returns the quick-reply categories with their ids. Use it to pick a categoryId for quickReplies.list, quickReplies.create or quickReplies.update. Read-only.
List quick reply categories › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDelete a quick reply
Permanently remove a quick reply for the whole workspace.
Deletes the quick reply for every agent; its shortcut stops working at once. Cannot be undone. Use it only when the team asked for the reply to go away. Sends nothing. Answers 404 when the id does not exist.
path Parameters
idQuick reply id from quickReplies.list.
Quick reply id from quickReplies.list.
Delete a quick reply › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successUpdate a quick reply
Change the shortcut, title, text, category or attachment of a quick reply.
Updates only the fields you send. Writes the change and sends nothing; agents see the new text the next time they insert it. Answers 409 when the new shortcut is taken and 404 when the id does not exist.
path Parameters
idQuick reply id from quickReplies.list.
Quick reply id from quickReplies.list.
Update a quick reply › Request Body optional
shortcutNew unique shortcut, 1-50 characters.
titleNew label, 1-100 characters.
contentNew reply text, 1-4096 characters.
categoryIdNew category id, or null to remove the category.
fileCenterFileIdNew attachment id from quickReplies.attachments, or null to detach.
Update a quick reply › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList template variables
Return the workspace’s reusable template variable library.
Returns the named variables (customer name, tracking link and so on) that template placeholders can be mapped to, with their type and example value, most used first. Use it to find the variable ids that templates.validate and templates.renderPreview expect. Read-only. Paginated: follow meta.pagination.nextCursor until hasMore is false.
query Parameters
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
List template variables › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successCreate a template variable
Add a named, typed variable to the library.
Creates a reusable variable that template placeholders can be mapped to (templateVariables.saveMappings). Writes one library row and sends nothing. Answers 409 when a variable with that name already exists.
Create a template variable › Request Body
nameUnique display name, 1-100 characters.
typeOne of TEXT, URL, CURRENCY, DATE, IMAGE, VIDEO or DOCUMENT.
descriptionWhat the variable holds, up to 500 characters.
exampleValueSample value used when submitting templates to Meta, up to 500 characters.
Create a template variable › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead a template’s variable mappings
Show which library variable fills each placeholder of one template.
Returns, for one template name, the mapping of each component position (header, body, footer, button) and placeholder index to a library variable, with the variable details. Use it to know which values to supply when sending that template through messages.send or broadcasts.create. Read-only. An unmapped template returns an empty list.
path Parameters
templateNameTemplate name from templates.list (template_name).
Template name from templates.list (template_name).
Read a template’s variable mappings › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead one template variable
Fetch a single library variable by id.
Returns one variable with its name, type, description, example value and usage count. Read-only. Answers 404 when the id does not belong to this workspace.
path Parameters
idVariable id from templateVariables.list.
Variable id from templateVariables.list.
Read one template variable › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successSave a template’s variable mappings
Replace the placeholder-to-variable mapping of one template.
Sets which library variable fills each placeholder of the named template. It REPLACES every existing mapping for that template, so send the complete list, and read the current one first with templateVariables.mappings. Sends nothing; later sends and renders of that template use the new mapping. Each position may appear once.
Save a template’s variable mappings › Request Body
templateNameTemplate name from templates.list (template_name).
The complete list of mappings for this template, at least one.
Save a template’s variable mappings › Responses
The API key is missing, malformed, expired, or its owner is inactive.
success