Skip to main content

Examples

The step-by-step guide below uses fictitious data. Replace {workspace}, {template}, and the token with your own values.
Creating and deleting require the token to belong to a user who is an owner of the workspace.

1. Validate the Name

  • 204 No Content: the name is available.
  • 422: the name already exists. Choose another one.

2. Create the Template

The data is sent as FormData. The components fields use bracket notation.
Response (200 OK):
The name was normalized to aviso_de_pedido. Save the id, which is the {template} of the next routes. To create a template with an image in the header, send the file in the components[0][example][header_handle][0] field (and declare components[0][type]=HEADER and components[0][format]=IMAGE):

3. Track the Approval

List the approved templates (status=2):
Or retrieve a specific template:
Instead of polling repeatedly, configure a webhook in the workspace and wait for the message_template_status_update event.

4. Delete the Template

Response: 204 No Content. After deletion, the template no longer appears in the list, but it can still be retrieved through the show route with the DELETED status.

Learn More