Templates
Templates are pre-approved message formats that allow you to send structured messages, especially important for WhatsApp which requires template approval for business-initiated conversations.Why Templates?
Templates solve two key problems:- WhatsApp Compliance: Meta requires businesses to use approved templates when initiating conversations outside the 24-hour window
- Consistency: Ensure your transactional messages follow a consistent format
Template Structure
A template consists of:Fields
| Field | Description |
|---|---|
name | Unique identifier (lowercase, underscores) |
language | Language code (e.g., “en”, “es”, “pt”) |
body | Message text with variable placeholders |
category | WhatsApp category (see below) |
variables | List of variable names for documentation |
status | Approval status |
Template Variables
Templates support dynamic content through variables. Two formats are supported:Numbered Variables (WhatsApp Native)
Use{{1}}, {{2}}, {{3}} for WhatsApp compatibility:
Named Variables
Use{{name}} for better readability:
Named variables are automatically converted to numbered format when sending via WhatsApp.
WhatsApp Categories
WhatsApp requires every template to be categorized:| Category | Use Case | Examples |
|---|---|---|
| UTILITY | Transactional messages | Order confirmations, shipping updates, appointment reminders |
| MARKETING | Promotional content | Sales, offers, newsletters |
| AUTHENTICATION | Verification codes | OTPs, login codes, 2FA |
WhatsApp Approval Workflow
WhatsApp templates must be approved by Meta before use:Template Statuses
| Status | Description |
|---|---|
draft | Created but not submitted |
pending | Submitted, awaiting Meta review |
approved | Ready to use |
rejected | Rejected by Meta (see reason) |
Creating Templates
Via API
Response
Rich Template Components
WhatsApp templates can include rich components:Header
Add a header with text, image, video, or document:Footer
Add a footer text:Buttons
Add interactive buttons:Sending Template Messages
To send a template message, specify the template ID and variables:Multi-Channel Templates
Templates can be configured for multiple channels:Multi-channel templates must use the same variables across all channels for consistency.
Managing Templates
List Templates
Get Template
Delete Template
Best Practices
Keep It Short
WhatsApp has character limits. Keep your templates concise and actionable.
Use UTILITY Category
For transactional messages, always use UTILITY to improve approval chances.
Test Before Launch
Create templates early in development. Approval can take 24-48 hours.
Handle Rejections
If rejected, review Meta’s guidelines, fix the issue, and resubmit.
Common Rejection Reasons
| Reason | Solution |
|---|---|
| Promotional content in UTILITY | Change category to MARKETING or remove promotional language |
| Missing variable examples | Provide clear example values for each variable |
| Inappropriate content | Review WhatsApp commerce policy |
| Poor grammar/spelling | Proofread and fix language errors |