Retrieve a messaging template
Read one messaging template with its content, the values a send needs, and its WhatsApp approval on each account.
/v1/messaging/templates/{templateId}Authorization
Bearer token
- Authorizationrequiredheader
Send your API key as
Bearer YOUR_API_KEY.
Path parameters
templateIdrequiredstringThe template ID, starting with
mtp_, shown on the template's page in the dashboard under Details, or returned by List messaging templates.
Response
Example identifiers below are illustrative.
data is the template object.
The template object
idstringTemplate ID, starting with
mtp_. Send it intemplate.idwith Send a message.namestringLowercase letters, numbers, and underscores, such as
order_confirmation.languagestringThe language code, such as
en,fr,ar, oren_US. Each name and language pair is its own template.categorystringWhatsApp can recategorize a template on an account; see the approval's
category.One of
"marketing""utility""authentication"content_typestringSee Content types.
One of
"text""media""quick_reply""call_to_action""card""authentication""carousel"statusstringOnly submitted templates can be sent. See Drafts and submitted templates.
One of
"draft""submitted""archived"sourcestringnexiomfor a template created in Nexiom Connect,libraryfor one started from the library, orwhatsapp_syncfor one found in WhatsApp Manager.library_keystring or nullThe library entry it was started from, such as
order_confirmation.contentobjectWhat the template says. See Content.
variablesobjectWhat a send of the template must give. See Variables.
channelsstring[]The channels its content fits:
whatsappfor every type, plussmsfortexttemplates. Sending by SMS isn't available yet.channel_statusobjectWhere it can be sent now. See Channel status.
unsupported_reasonstring or nullWhy a template synced from WhatsApp Manager can't be sent from Nexiom Connect, such as a location header.
duplicated_from_idstring or nullThe template this one was duplicated from.
submitted_atstring or nullWhen it was submitted, and its content frozen.
archived_atstring or nullWhen it was archived.
created_atstringWhen it was created.
updated_atstringWhen it last changed.
Timestamps are ISO 8601 strings in UTC.
Content
The parts a template uses depend on its content_type; the others are null or empty.
content.headerobject or nullA text header (
typetext, withtextandexample) or a media header (typeimage,video, ordocument, withexample_file_id).content.bodyobject or nullThe message:
text, with numbered variables such as{{1}}, andexamples, an example value by variable number.nullforauthentication.content.footerstring or nullA short line without variables.
content.buttonsarrayThe buttons, in order. See Buttons.
content.authenticationobject or nullFor
authenticationonly: the options of the verification code message. See Verification code options.content.cardsarrayFor
carouselonly: 2 to 10 cards, each with aheader(typeimageorvideo, withexample_file_id), abodywithtextandexamples, andbuttons.
| Type | Uses |
|---|---|
text | body, and optionally a text header and a footer. |
media | A media header, body, and optionally a footer. |
quick_reply | body, buttons of type quick_reply, and optionally a header and a footer. |
call_to_action | body, buttons of type url, phone_number, and copy_code, and optionally a header and a footer. |
card | body, any mix of buttons, and optionally a header and a footer. |
authentication | authentication only. WhatsApp writes the text. |
carousel | body and cards. |
Examples are what WhatsApp reviewed. They are never sent. Templates synced from WhatsApp Manager have no examples and an empty example_file_id, since WhatsApp doesn't return them.
Buttons
typestringOne of
"quick_reply""url""phone_number""copy_code"textstringThe button label, up to 25 characters. Copy-code buttons have none: WhatsApp labels them.
urlstringFor
url: the link. A link ending with{{1}}takes its ending with each send.examplestring or nullFor
urlending with{{1}}: a full example link. Forcopy_code: an example code.phone_numberstringFor
phone_number: the number called, in E.164 format.
Verification code options
add_security_recommendationbooleanAdds "For your security, do not share this code." to the message.
code_expiration_minutesnumber or nullAdds "This code expires in N minutes." to the footer, from 1 to 90.
otp_typestringHow the customer uses the code.
One of
"copy_code""one_tap""zero_tap"button_textstring or nullThe copy-code button label, up to 25 characters.
nulluses WhatsApp's translated label.autofill_textstring or nullFor
one_tapandzero_tap: the autofill button label, up to 25 characters.supported_appsarrayFor
one_tapandzero_tap: 1 to 5 Android apps that receive the code, each with apackage_nameand an 11-charactersignature_hash.zero_tap_terms_acceptedbooleantrueforzero_tap: WhatsApp's zero-tap terms were accepted.message_send_ttl_secondsnumber or nullAn undelivered code is dropped after this many seconds, from 30 to 900.
nulluses WhatsApp's default.
See Verification code templates.
Variables
What Send a message must give for this template, worked out from its content.
variables.headerstring[]Header variable keys, such as
["1"]. Give each intemplate.variables.header.variables.bodystring[]Body variable keys, such as
["1", "2"]. Give each intemplate.variables.body.variables.header_mediastring or nullimage,video, ordocumentwhen each send needstemplate.header_media.variables.buttonsarrayThe buttons that take a value, each with its
index, itstype(url,copy_code, orquick_reply), and whether it isrequired.variables.codebooleantruefor a verification code template: each send needstemplate.code.variables.cardsarrayFor a carousel, one entry per card: its
index, itsheader_media(imageorvideo), itsbodyvariable keys, and itsbuttons. Each send needstemplate.cards.
Channel status
channel_status.whatsapp.readybooleantruewhen the template is submitted and approved on at least one WhatsApp account, so it can be sent from that account's number.channel_status.whatsapp.approvalsarrayOne approval per WhatsApp account the template was submitted to or synced from.
channel_status.sms.readybooleantruewhen the template is submitted and its content fits SMS. Sending by SMS isn't available yet.
WhatsApp approvals
WhatsApp reviews a template separately on each WhatsApp account it is submitted to. A template can be sent from a number only when its approval on that number's account is approved.
whatsapp_template_idstringThe approval ID, starting with
wat_. A send can name it intemplate.idinstead of themtp_ID.account_idstringThe WhatsApp account in Nexiom Connect, starting with
wac_.waba_idstringThe WhatsApp Business Account ID in Meta.
statusstringactive, orarchivedonce the template was deleted in WhatsApp. An archived approval can't be sent.approval_statusstringSee Review and approval.
One of
"pending""approved""rejected""paused""disabled"categorystringThe category WhatsApp holds for the template on this account. WhatsApp can change it.
rejection_reasonstring or nullWhatsApp's reason, for a rejected template.
unsupported_reasonstring or nullWhy this account's template can't be sent from Nexiom Connect.
matches_contentbooleanfalsewhen the template was changed in WhatsApp Manager and no longer matches its content here. Messages then send WhatsApp's version. Alwaystruefor verification code templates and templates synced from WhatsApp Manager, which follow WhatsApp's wording.submitted_atstring or nullWhen it was submitted to this account.
last_synced_atstring or nullWhen it was last read from WhatsApp.