HomeUser GuidesAPI Reference
Get Started
HomeAPI Reference
Authentication
Branches
Contact Groups
Contacts
Conversations
Error HandlingInvoices
Messages
Orders
Rate LimitingSDKs & Code ExamplesTemplatesTicketsAPI VersioningWABA NumbersWebhooks
User GuideAPI ReferenceMessagesSend Template Message

Send Template Message

Send approved WhatsApp templates with dynamic parameters

Reading time: 1 minute

Send Template Message

Send approved WhatsApp templates with dynamic parameters.

POST{{base_url}}/w/message/template

Content-Type: multipart/form-data

Query Parameters

ParameterTypeRequiredDescription
phone_number_idstringYesPhone number ID of the sender

Request Body (form-data)

ParameterTypeRequiredDescription
template_idintegerYesTemplate ID
phonestringYesRecipient phone number
header_typestringYesHeader type: TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION
header_valuestringNoHeader value (URL for media, text for text)
header_mediafileNoMedia file for header
body_paramsJSONNoMessage text parameters (JSON string)
button_paramsJSONNoButton parameters (JSON string)

Parameter Types:

WhatsApp supports two types of parameters:

  1. NAMED: Parameters with specific names {name: "offer_code", value: "SUMMER25"}
  2. POSITIONAL: Parameters by order ["Mohammed", "2025-06-30"]

Example 1: Named Parameters (NAMED)

Example 1: Named Parametersbash
curl -X POST "{{base_url}}/w/message/template?phone_number_id=123456" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-F "template_id=2" \
-F "phone=96650000000" \
-F "header_type=IMAGE" \
-F "header_value=https://example.com/offer-banner.jpg" \
-F "body_params=[{\"name\": \"offer_code\", \"value\": \"SUMMER25\"}, {\"name\": \"expiry_date\", \"value\": \"2025-06-30\"}]" \
-F "button_params=[{\"index\": 0, \"name\": \"offer_id\", \"value\": \"12345\"}]"

Example 2: Positional Parameters (POSITIONAL)

Example 2: Positional Parametersbash
curl -X POST "{{base_url}}/w/message/template?phone_number_id=123456" \
-H "Accept: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-F "template_id=11" \
-F "phone=96650000000" \
-F "header_type=TEXT" \
-F "header_value=Hello {{1}}" \
-F "body_params=[\"Ahmed Mohammed\", \"12345\", \"150 SAR\"]"

Related

← Back to Messages
View Guide
View