MessageTemplate

MessageTemplate is a resource that represents a template for a message that can be sent to a candidate. It can be used in the initial message of a FlowRun. Or as a standalone message. MessageTemplates are a proxy of WhatsApp templates.

This means it is a requirement to have a WhatsApp Business Account/number connected to the platform to create these messages. However, the MessageTemplate can be used to send messages to any channel, not just WhatsApp.

Currently it is not possible to update a MessageTemplate after it has been created.

Endpoints

  • GET /message-templates - Retrieve a list of all MessageTemplates.

  • GET /message-templates/{id} - Retrieve a specific MessageTemplate by ID.

  • POST /message-templates - Create a new MessageTemplate.

  • DELETE /message-templates/{id} - Delete a specific MessageTemplate by ID.

Attributes

Field
Type
Description

name

String

The name of the message template. This is displayed in the message payload.

components

Array

language

String

The language of the message template. This is used by Meta while validating the message template.

category

String

The category of the message template. This can be Marketing, Utility or Authorization.

status

String

The status of the message template.

preview

String

The preview text of the message template.

createdAt

DateTime

The timestamp when the message template was created.

updatedAt

DateTime

The timestamp when the message template was last updated.

Components

Field
Type
Description

text

String

The text content of the component.

type

String

The type of the component. Can be HEADER, BODY, or FOOTER.

format

String

The format of the component, only required for the header.

example

JSON object

The example usage of the component. Only required when using variables.

See Components for more information on the components.

We only support text format for the components at this moment

At this time the header and footer components are not supported in the web preview, but they will work on other channels.

Example POST body

Validation errors

Validation is done by The WhatsApp servers at Meta, we will pass the validation errors back to you in the response.

Example validation error response

OpenAPI

Create a MessageTemplate

post
Authorizations
AuthorizationstringRequired

Bearer

Body
Responses
post
/message-templates

Retrieve a single message_template

get
Authorizations
AuthorizationstringRequired

Bearer

Path parameters
idstringRequired
Responses
200

message_template found

application/vnd.api+json
get
/message-templates/{id}

Retrieve all MessageTemplates

get
Authorizations
AuthorizationstringRequired

Bearer

Responses
200

message_templates found

application/vnd.api+json
get
/message-templates

Destroy a Candidate

delete
Authorizations
AuthorizationstringRequired

Bearer

Path parameters
idstringRequired
Responses
delete
/candidates/{id}

No content

Destroy a MessageTemplate

delete
Authorizations
AuthorizationstringRequired

Bearer

Path parameters
idstringRequired
Responses
delete
/message-templates/{id}

No content

Last updated