Skip to main content
PATCH
Update a message template
Update a message template. This is a partial update: a field you omit keeps its stored value. channels, variants and countries are replaced as a whole when you send them. Only a template still in draft can be updated. Once it is submitted, a change is refused with template_not_editable, because a template under review or already registered with providers cannot change underneath that process.

Fixing a language WhatsApp rejected

On an approved template whose channels include whatsapp, WhatsApp reviews every language on its own, and can reject one. The whatsapp object of that variant then shows rejected with a rejection_reason. You can fix it without creating a new template. Send all the variants, with a new text only for the rejected ones, and variable_examples if needed. The new text must use the same variables as before. The template stays approved:
  • The new text applies at once, on every channel, SMS included.
  • The rejected languages are sent back to WhatsApp for review. Their whatsapp.status moves to pending, then to approved or rejected.
Any other change to an approved template is refused with template_not_editable. To change the wording of an approved language, create a new template and delete the old one.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

template_id
string
required

The identifier of the template.

Body

application/json

A partial update. Every field is optional, and a field you omit keeps its stored value.

name
string

The name of the template.

Example:

"Acme Receipts"

type
enum<string>

What the template is used for.

Available options:
transactional,
marketing
channels
enum<string>[]

The channels the template should be delivered over. Replaces the stored channels.

Available options:
sms,
rcs,
whatsapp,
viber,
zalo,
telegram
variants
object[]

The wording of the message, one entry per locale. Replaces the stored variants.

default_locale
string

The locale used when the recipient's own locale has no variant.

Example:

"en"

countries
object[]

The countries the template should work in. Replaces the stored countries.

variable_examples
object

One sample value per {{variable}} of the variants. WhatsApp requires a sample for every variable to review the template, so set them on a template whose channels include whatsapp. Every key must be a variable used in the variants. Replaces the stored examples; when omitted, the examples of variables you removed are dropped.

Example:

Response

OK

id
string
required

The identifier of the template, to pass as template_id when sending a message.

Example:

"template_01k8ap1btqf5r9fq2c8ax5fhc9"

type
enum<string>
required

What the template is used for. Possible values are:

  • transactional - A message triggered by an action of the recipient.
  • marketing - A promotional message, subject to marketing rules.
Available options:
transactional,
marketing
name
string
required

The name of the template.

Example:

"Acme Receipts"

status
enum<string>
required

Where the template stands in the approval flow. Possible values are:

  • draft - Yours to edit. Nothing is sent with it yet.
  • pending - Submitted, and waiting on our review and on the per-country registrations.
  • ready - Approved and usable in every country you asked for.
  • rejected - Refused. Contact support for the reason.
Available options:
draft,
pending,
ready,
rejected
channels
enum<string>[]
required

The channels the template can be delivered over.

Available options:
sms,
rcs,
whatsapp,
viber,
zalo,
telegram
variables
string[]
required

The placeholder names found in the variants, to fill in when sending.

Example:
variants
object[]
required

The wording of the message, one entry per locale.

default_locale
string
required

The locale used when the recipient's own locale has no variant.

Example:

"en"

countries
object[]
required

The countries the template works in, with the monthly volume recorded for each.

region_statuses
object
required

The readiness of the template per country, keyed by ISO 3166-1 alpha-2 country code.

created_at
string<date-time>
required

The date and time when the template was created.

Example:

"2024-01-01T12:00:00Z"