Send a pre-approved WhatsApp template message to any user, regardless of the 24-hour service window. Template messages are the primary way to initiate conversations with customers.
Sends a pre-approved template message to a recipient. Templates can include dynamic variables in the header, body, and buttons. This is the only message type that can be sent outside the 24-hour customer service window.
✓
No 24-Hour Restriction: Template messages are the only message type that can be sent outside the 24-hour customer service window. Templates must be pre-approved by Meta before use. You can manage templates from your dashboard or via the Templates API.
Parameters
Parameter
Type
Description
token required
string
Your API authentication token.
phone required
string
Recipient phone number with country code. E.g., +919876543210.
template_name required
string
The exact name of the approved template as registered with Meta. Case-sensitive.
template_language required
string
Language code of the template. Common values: en, en_US, hi, es, pt_BR.
components optional
array
Array of component objects to fill template variables. Required if your template contains dynamic placeholders (1, 2, etc.).
Component Format
The components array allows you to pass dynamic values into your template's header, body, and button placeholders. Each component targets a specific section of the template.
Body Variables
Replace 1, 2, etc. in the template body with dynamic text values.
{
"status": "error",
"message": "Template 'my_template' not found or not approved."
}
Error - Missing Variables 400
{
"status": "error",
"message": "Template requires 3 body parameters but 1 was provided."
}
Error - Authentication 401
{
"status": "error",
"message": "Invalid API token."
}
Notes
⚠
Template Approval Required: All templates must be submitted to and approved by Meta before they can be used. Approval typically takes a few minutes to 24 hours. You can check template status in your dashboard or via the Templates API.
ℹ
Variable Order Matters: The parameters in the components array are positional. The first parameter replaces 1, the second replaces 2, and so on. Ensure parameters are passed in the correct order.
ℹ
Header Media: For templates with media headers, the image URL must be publicly accessible. Supported formats: JPEG and PNG. Maximum file size: 5 MB. The URL must use HTTPS.
✗
Rate Limiting: WhatsApp applies per-template rate limits. If a template is flagged for low quality or high block rates, Meta may pause or disable it. Monitor template quality ratings in your dashboard.