Skip to main content
POST
/
v1
/
templates
Create template
curl --request POST \
  --url https://api.zavu.dev/v1/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "order_confirmation",
  "language": "en",
  "body": "Hi {{1}}, your order {{2}} has been confirmed and will ship within 24 hours.",
  "whatsappCategory": "UTILITY",
  "variables": [
    "customer_name",
    "order_id"
  ]
}
'
{
  "id": "<string>",
  "name": "order_confirmation",
  "language": "en",
  "body": "Hi {{1}}, your order {{2}} has shipped.",
  "category": "UTILITY",
  "status": "draft",
  "variables": [
    "<string>"
  ],
  "headerType": "<string>",
  "headerContent": "<string>",
  "footer": "<string>",
  "buttons": [
    {
      "type": "<string>",
      "text": "<string>",
      "url": "<string>",
      "phoneNumber": "<string>"
    }
  ],
  "whatsapp": {
    "templateName": "<string>",
    "namespace": "<string>",
    "status": "<string>"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required
language
string
default:en
required
body
string
required
whatsappCategory
enum<string>

WhatsApp template category.

Available options:
UTILITY,
MARKETING,
AUTHENTICATION
variables
string[]

Response

Template created.

id
string
required
name
string
required

Template name (must match WhatsApp template name).

Example:

"order_confirmation"

language
string
required

Language code.

Example:

"en"

body
string
required

Template body with variables: {{1}}, {{2}}, etc.

Example:

"Hi {{1}}, your order {{2}} has shipped."

category
enum<string>
required

WhatsApp template category.

Available options:
UTILITY,
MARKETING,
AUTHENTICATION
status
enum<string>
default:draft
Available options:
draft,
pending,
approved,
rejected
variables
string[]

List of variable names for documentation.

headerType
string

Type of header (text, image, video, document).

headerContent
string

Header content (text or media URL).

Footer text for the template.

buttons
object[]

Template buttons.

whatsapp
object

WhatsApp-specific template information.

createdAt
string<date-time>
updatedAt
string<date-time>