Send Meta-compatible payloads with the sender chosen from the URL path rather than the request body.
Explicit Sender Route
Summary
Send Meta-compatible payloads with the sender chosen from the URL path rather than the request body.
Prerequisites
- Authorization: Bearer w91_live_xxx
- Content-Type: application/json for JSON requests
Related documentation
This route behaves exactly like POST /api/v3/messages, except the sender comes from the URL path. It is the closest match to Meta Cloud API URL structure and the most explicit way to choose a sender, which makes it the best target when repointing an existing Cloud API client at Whats91.
/api/v3/{phoneNumberId}/messagesSend a Meta-compatible payload from an explicit sender.
| Parameter | Type | Required | Description |
|---|---|---|---|
phoneNumberId | string | Required | Meta WhatsApp Business phone-number ID of the sender. |
messaging_product | string | Required | Always whatsapp. |
to | string | Required | Recipient WhatsApp number in international format. |
type | string | Required | text, image, video, audio, document, sticker, location, contacts, template, interactive, or reaction. |
curl -X POST "https://graph.whats91.com/api/v3/1234567890/messages" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "918888888888",
"type": "text",
"text": { "body": "Hello" }
}'{
"messaging_product": "whatsapp",
"contacts": [{ "input": "918888888888", "wa_id": "918888888888" }],
"messages": [{ "id": "wamid.xxxxx" }]
}- Content-Type must be application/json. Multipart is not accepted on Meta-compatible routes.
- Responses and errors use Meta shapes, not the Whats91 envelope.
- A number-scoped token can only address its bound sender; another phoneNumberId is rejected.
- The X-Whats91-Request-Id header is still returned for correlation.
Tip
Prefer this route over POST /api/v3/messages when your system already tracks Meta phone number IDs. It removes any ambiguity about which sender a message goes out from.
SDK Examples
Use these examples as starting points for server-side implementations.
curl -X POST "https://graph.whats91.com/api/v3/{phoneNumberId}/messages" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "918888888888",
"type": "text",
"text": {
"body": "Hello"
}
}'const response = await fetch("https://graph.whats91.com/api/v3/{phoneNumberId}/messages", {
method: "POST",
headers: {
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "918888888888",
"type": "text",
"text": {
"body": "Hello"
}
})
});
const data = await response.json();
console.log(data);$ch = curl_init("https://graph.whats91.com/api/v3/{phoneNumberId}/messages");
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([
"messaging_product" => "whatsapp",
"recipient_type" => "individual",
"to" => "918888888888",
"type" => "text",
"text" => [
"body" => "Hello"
]
])
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
response = requests.request(
"POST",
"https://graph.whats91.com/api/v3/{phoneNumberId}/messages",
headers={
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json",
},
json={
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "918888888888",
"type": "text",
"text": {
"body": "Hello"
}
}
)
print(response.json())using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer w91_live_xxx");
var request = new HttpRequestMessage(HttpMethod.Post, "https://graph.whats91.com/api/v3/{phoneNumberId}/messages");
request.Content = new StringContent(
"""
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "918888888888",
"type": "text",
"text": {
"body": "Hello"
}
}
""",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());Related APIs
Messaging Meta-Compatibility
Understand the Meta-compatible JSON message sending endpoints exposed through Whats91.
Text
Send Meta-compatible text messages through the Whats91 public API.
Template
Send Meta-compatible template messages with language and components objects.
Media
Send Meta-compatible image, video, audio, document, and sticker message payloads.