Send approved WhatsApp templates with Whats91-specific fields, aliases, media headers, and button parameters.
Template Send
Summary
Send approved WhatsApp templates with Whats91-specific fields, aliases, media headers, and button parameters.
Prerequisites
- Authorization: Bearer w91_live_xxx
- Content-Type: application/json for JSON requests
Related documentation
Use POST /api/v2/send to send an approved WhatsApp template by name. Whats91 resolves the sender, applies billing and blacklist checks, logs reports, and forwards the request to Meta.
Required and Optional Fields
/api/v2/send| Parameter | Type | Required | Description |
|---|---|---|---|
senderId | string | Optional | Registered WhatsApp sender number. Required when the token cannot resolve a default sender. |
to | string | Required | Recipient phone number. Aliases: receiverId, receiver_id, receiver. |
templateName | string | Required | Approved template name. Alias: template_name. |
parameters | array | Optional | Template body variable values in order. |
buttonParameters | array | Optional | Button variable values. Alias: button_parameters. |
mediaUrl | string | Optional | Public media URL for templates with media headers. Aliases: media_url, mediaurl. |
mediaFile | file | Optional | Multipart media upload for template headers. Aliases: media_file, uploadFile, upload_file. |
curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"templateName": "payment_reminder",
"parameters": ["Devendar", "INV-1001"],
"buttonParameters": ["pay_INV-1001"],
"mediaUrl": "https://example.com/invoice.pdf"
}'{
"success": true,
"data": {
"messageId": "wamid.xxxxx",
"status": "sent",
"senderId": "919999999999",
"phoneNumberId": "1234567890",
"receiverId": "918888888888"
},
"metadata": {
"apiVersion": "v2",
"requestId": "request-uuid"
}
}Multipart Media Header
curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-F "senderId=919999999999" \
-F "to=918888888888" \
-F "templateName=delivery_receipt" \
-F "parameters[]=Devendar" \
-F "parameters[]=ORD-4431" \
-F "mediaFile=@receipt.pdf"Carousel templates are not supported on POST /api/v2/send. A carousel template returns CAROUSEL_TEMPLATE_NOT_SUPPORTED_IN_V2_SEND.
SDK Examples
Use these examples as starting points for server-side implementations.
curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d 'curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"templateName": "payment_reminder",
"parameters": ["Devendar", "INV-1001"],
"buttonParameters": ["pay_INV-1001"],
"mediaUrl": "https://example.com/invoice.pdf"
}''const response = await fetch("https://graph.whats91.com/api/v2/send", {
method: "POST",
headers: {
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify(curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"templateName": "payment_reminder",
"parameters": ["Devendar", "INV-1001"],
"buttonParameters": ["pay_INV-1001"],
"mediaUrl": "https://example.com/invoice.pdf"
}')
});
const data = await response.json();
console.log(data);$ch = curl_init("https://graph.whats91.com/api/v2/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer w91_live_xxx",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode(curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"templateName": "payment_reminder",
"parameters": ["Devendar", "INV-1001"],
"buttonParameters": ["pay_INV-1001"],
"mediaUrl": "https://example.com/invoice.pdf"
}')
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
response = requests.request(
"POST",
"https://graph.whats91.com/api/v2/send",
headers={
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json",
},
json=curl -X POST "https://graph.whats91.com/api/v2/send" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"templateName": "payment_reminder",
"parameters": ["Devendar", "INV-1001"],
"buttonParameters": ["pay_INV-1001"],
"mediaUrl": "https://example.com/invoice.pdf"
}'
)
print(response.json())using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer w91_live_xxx");
var request = new HttpRequestMessage(HttpMethod.Post, "https://graph.whats91.com/api/v2/send");
request.Content = new StringContent(
"""curl -X POST \"https://graph.whats91.com/api/v2/send\" \
-H \"Authorization: Bearer w91_live_xxx\" \
-H \"Content-Type: application/json\" \
-d '{
\"senderId\": \"919999999999\",
\"to\": \"918888888888\",
\"templateName\": \"payment_reminder\",
\"parameters\": [\"Devendar\", \"INV-1001\"],
\"buttonParameters\": [\"pay_INV-1001\"],
\"mediaUrl\": \"https://example.com/invoice.pdf\"
}'""",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());Related APIs
Messaging
Understand the Whats91-specific message sending endpoints for templates, chat messages, media, buttons, and lists.
Chat Text
Send Whats91-specific free-form chat text messages inside the customer service window.
Chat Media
Send image, video, audio, and document chat messages through Whats91-specific media fields.
Chat Interactive
Send Whats91-specific quick reply button and list messages through the chat endpoint.