Send Whats91-specific free-form chat text messages inside the customer service window.
Chat Text
Summary
Send Whats91-specific free-form chat text messages inside the customer service window.
Prerequisites
- Authorization: Bearer w91_live_xxx
- Content-Type: application/json for JSON requests
Related documentation
Use POST /api/v2/chat for free-form text replies. If type is omitted and no media, buttons, or list payload is present, Whats91 treats the request as a text message.
/api/v2/chat| Parameter | Type | Required | Description |
|---|---|---|---|
senderId | string | Optional | Registered WhatsApp sender number. |
to | string | Required | Recipient phone number. Aliases: receiverId, receiver_id, receiver. |
text | string | Required | Message body text. Aliases: messageText, message_text, body, message. |
type | string | Optional | Optional. Defaults to text when omitted. |
curl -X POST "https://graph.whats91.com/api/v2/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"messageText": "Your support ticket has been updated."
}'{
"success": true,
"data": {
"messageId": "wamid.xxxxx",
"status": "sent",
"receiverId": "918888888888"
},
"metadata": {
"requestId": "request-uuid"
}
}If no text alias is supplied for a text request, Whats91 returns MISSING_TEXT.
SDK Examples
Use these examples as starting points for server-side implementations.
curl -X POST "https://graph.whats91.com/api/v2/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d 'curl -X POST "https://graph.whats91.com/api/v2/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"messageText": "Your support ticket has been updated."
}''const response = await fetch("https://graph.whats91.com/api/v2/chat", {
method: "POST",
headers: {
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify(curl -X POST "https://graph.whats91.com/api/v2/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"messageText": "Your support ticket has been updated."
}')
});
const data = await response.json();
console.log(data);$ch = curl_init("https://graph.whats91.com/api/v2/chat");
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/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"messageText": "Your support ticket has been updated."
}')
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
response = requests.request(
"POST",
"https://graph.whats91.com/api/v2/chat",
headers={
"Authorization": "Bearer w91_live_xxx",
"Content-Type": "application/json",
},
json=curl -X POST "https://graph.whats91.com/api/v2/chat" \
-H "Authorization: Bearer w91_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"senderId": "919999999999",
"to": "918888888888",
"messageText": "Your support ticket has been updated."
}'
)
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/chat");
request.Content = new StringContent(
"""curl -X POST \"https://graph.whats91.com/api/v2/chat\" \
-H \"Authorization: Bearer w91_live_xxx\" \
-H \"Content-Type: application/json\" \
-d '{
\"senderId\": \"919999999999\",
\"to\": \"918888888888\",
\"messageText\": \"Your support ticket has been updated.\"
}'""",
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.
Template Send
Send approved WhatsApp templates with Whats91-specific fields, aliases, media headers, and button parameters.
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.