Skip to main content
PATCH
/
v1
/
templates
/
{templateId}
Update Template
curl --request PATCH \
  --url https://api.zavu.dev/v1/templates/{templateId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "category": "<string>",
  "body": "<string>",
  "channels": [
    {}
  ],
  "variables": [
    {}
  ]
}'
{
  "id": "tpl_abc123",
  "name": "order_confirmation_v2",
  "category": "transactional",
  "body": "Hi {{name}}! Order #{{orderId}} confirmed. Estimated delivery: {{deliveryDate}}",
  "variables": ["name", "orderId", "deliveryDate"],
  "channels": ["sms", "whatsapp"],
  "createdAt": "2024-01-15T10:00:00.000Z",
  "updatedAt": "2024-01-16T14:30:00.000Z"
}
Update the properties of an existing message template.

Path Parameters

templateId
string
required
The template identifier (e.g., tpl_abc123)

Request

All fields are optional. Only provided fields will be updated.
name
string
New template name
category
string
Template category: transactional, marketing, or alert
body
string
New template content with {{variable}} placeholders
channels
array
Supported channels: ["sms", "whatsapp"]
variables
array
List of variable names

Response

{
  "id": "tpl_abc123",
  "name": "order_confirmation_v2",
  "category": "transactional",
  "body": "Hi {{name}}! Order #{{orderId}} confirmed. Estimated delivery: {{deliveryDate}}",
  "variables": ["name", "orderId", "deliveryDate"],
  "channels": ["sms", "whatsapp"],
  "createdAt": "2024-01-15T10:00:00.000Z",
  "updatedAt": "2024-01-16T14:30:00.000Z"
}

Example

curl -X PATCH https://api.zavu.dev/v1/templates/tpl_abc123 \
  -H "Authorization: Bearer zv_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Hi {{name}}! Order #{{orderId}} confirmed. Estimated delivery: {{deliveryDate}}"
  }'
Updating a template body will automatically re-extract variables. Existing messages using this template are not affected.