Skip to main content
WhatsApp templates are pre-approved message formats that allow you to initiate conversations with users outside the 24-hour messaging window. This guide covers how to create, submit, and manage templates.

Overview

Templates are required for:
  • Starting new conversations with users
  • Re-engaging users after the 24-hour window expires
  • Sending transactional notifications (order updates, appointments, etc.)

Template Structure

A WhatsApp template consists of:
ComponentRequiredDescription
NameYesUnique identifier (lowercase, underscores only)
LanguageYesLanguage code (e.g., en, es, pt)
CategoryYesUTILITY, MARKETING, or AUTHENTICATION
BodyYesMain message content with variables
HeaderNoText, image, video, or document
FooterNoShort footer text
ButtonsNoQuick reply or URL buttons (max 3)

Creating a Template

Via Dashboard

  1. Navigate to Senders in your dashboard
  2. Select the sender you want to create templates for
  3. Go to the Templates tab
  4. Click Create Template
  5. Fill in the template details and submit

Via API

import Zavudev from '@zavudev/sdk';

const zavu = new Zavudev({
  apiKey: process.env["ZAVUDEV_API_KEY"],
});

const template = await zavu.templates.create({
  name: 'order_confirmation',
  language: 'en',
  body: 'Hi {{1}}, your order {{2}} has been confirmed and will ship within 24 hours.',
  category: 'UTILITY',
  variables: ['customer_name', 'order_id'],
});

console.log('Template ID:', template.id);
console.log('Status:', template.whatsappStatus); // "draft"

Template Variables

Use numbered placeholders for dynamic content:
Hi {{1}}, your order {{2}} is ready for pickup at {{3}}.
When sending a message, provide the variable values:
await zavu.messages.send({
  to: '+14155551234',
  messageType: 'template',
  content: {
    templateId: 'tmpl_abc123',
    templateVariables: {
      '1': 'John',
      '2': 'ORD-12345',
      '3': '123 Main St'
    }
  }
});

Template Categories

UTILITY

For transactional messages with specific, agreed-upon information. Examples:
  • Order confirmations
  • Shipping updates
  • Appointment reminders
  • Account notifications
Cost: Lower messaging rates

MARKETING

For promotional content and offers. Examples:
  • Sales announcements
  • Product recommendations
  • Newsletter content
  • Promotional offers
Cost: Higher messaging rates

AUTHENTICATION

For one-time passwords and verification codes. Examples:
  • Login verification
  • Two-factor authentication
  • Account verification
Cost: Lowest messaging rates

Adding Headers

Add a header to make your template more engaging:
const template = await zavu.templates.create({
  name: 'shipping_update',
  language: 'en',
  body: 'Your package {{1}} is on its way!',
  category: 'UTILITY',
  headerType: 'text',
  headerContent: 'Shipping Update',
});

Header Types

TypeDescription
textPlain text header
imageImage header (provide URL)
videoVideo header (provide URL)
documentPDF or document header

Adding Buttons

Templates can include up to 3 buttons:
const template = await zavu.templates.create({
  name: 'order_tracking',
  language: 'en',
  body: 'Your order {{1}} has shipped!',
  category: 'UTILITY',
  buttons: [
    {
      type: 'url',
      text: 'Track Order',
      url: 'https://example.com/track/{{1}}'
    },
    {
      type: 'quick_reply',
      text: 'Contact Support'
    }
  ]
});

Button Types

TypeDescription
quick_replySends predefined response
urlOpens a URL (can include variables)
phoneInitiates a phone call

Best Practices

Keep it concise

Templates have character limits. Body text should be under 1024 characters.

Use clear variables

Name your variables descriptively in the documentation for easier maintenance.

Choose the right category

Incorrect categorization may lead to rejection or higher costs.

Test before production

Always test templates with your own number first.

Naming Conventions

Template names must:
  • Be unique within your account
  • Use only lowercase letters, numbers, and underscores
  • Not exceed 512 characters
  • Not start with a number
Good examples:
  • order_confirmation_v2
  • appointment_reminder
  • shipping_update_en
Bad examples:
  • Order Confirmation (spaces not allowed)
  • 2fa_code (starts with number)
  • ORDER_CONFIRMATION (uppercase not allowed)

Next Steps