Create a WhatsApp message template. Note: Templates must be approved by Meta before use.
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",
"smsBody": "<string>",
"telegramBody": "<string>",
"instagramBody": "<string>",
"status": "draft",
"variables": [
"<string>"
],
"headerType": "<string>",
"headerContent": "<string>",
"footer": "<string>",
"buttons": [
{
"type": "quick_reply",
"text": "<string>",
"url": "<string>",
"phoneNumber": "<string>",
"otpType": "COPY_CODE",
"packageName": "<string>",
"signatureHash": "<string>"
}
],
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"whatsapp": {
"templateName": "<string>",
"namespace": "<string>",
"status": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Default template body. Used when no channel-specific body is set.
Channel-specific body for SMS. Falls back to body if not set.
Channel-specific body for Telegram. Falls back to body if not set.
Channel-specific body for Instagram. Falls back to body if not set.
WhatsApp template category.
UTILITY, MARKETING, AUTHENTICATION Type of header for the template.
text, image, video, document Header content (text string or media URL).
Footer text for the template.
60Template buttons (max 3).
3Show child attributes
Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates.
Code expiration time in minutes. Only for AUTHENTICATION templates.
1 <= x <= 90Template created.
Template name. For WhatsApp, must match the approved template name in Meta.
"order_confirmation"
Language code.
"en"
Default template body with variables: {{1}}, {{2}}, or named variables like {{contact.first_name}}. Used when no channel-specific body is set.
"Hi {{1}}, your order {{2}} has shipped."
WhatsApp template category.
UTILITY, MARKETING, AUTHENTICATION Channel-specific body for SMS messages. Falls back to body if not set.
Channel-specific body for Telegram messages. Falls back to body if not set.
Channel-specific body for Instagram messages. Falls back to body if not set.
draft, pending, approved, rejected List of variable names for documentation.
Type of header (text, image, video, document).
Header content (text or media URL).
Footer text for the template.
Template buttons.
Show child attributes
Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates.
Code expiration time in minutes. Only for AUTHENTICATION templates.
1 <= x <= 90WhatsApp-specific template information.
Show child attributes
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",
"smsBody": "<string>",
"telegramBody": "<string>",
"instagramBody": "<string>",
"status": "draft",
"variables": [
"<string>"
],
"headerType": "<string>",
"headerContent": "<string>",
"footer": "<string>",
"buttons": [
{
"type": "quick_reply",
"text": "<string>",
"url": "<string>",
"phoneNumber": "<string>",
"otpType": "COPY_CODE",
"packageName": "<string>",
"signatureHash": "<string>"
}
],
"addSecurityRecommendation": true,
"codeExpirationMinutes": 45,
"whatsapp": {
"templateName": "<string>",
"namespace": "<string>",
"status": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}