Whats91
Developers

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

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

POST/api/v2/send
ParameterTypeRequiredDescription
senderIdstringOptionalRegistered WhatsApp sender number. Required when the token cannot resolve a default sender.
tostringRequiredRecipient phone number. Aliases: receiverId, receiver_id, receiver.
templateNamestringRequiredApproved template name. Alias: template_name.
parametersarrayOptionalTemplate body variable values in order.
buttonParametersarrayOptionalButton variable values. Alias: button_parameters.
mediaUrlstringOptionalPublic media URL for templates with media headers. Aliases: media_url, mediaurl.
mediaFilefileOptionalMultipart media upload for template headers. Aliases: media_file, uploadFile, upload_file.
curl
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"
  }'
200 OK
{
  "success": true,
  "data": {
    "messageId": "wamid.xxxxx",
    "status": "sent",
    "senderId": "919999999999",
    "phoneNumberId": "1234567890",
    "receiverId": "918888888888"
  },
  "metadata": {
    "apiVersion": "v2",
    "requestId": "request-uuid"
  }
}

Multipart Media Header

curl - multipart/form-data
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
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"
  }''
Node.js
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);
PHP
$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;
Python
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())
C#
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