Messaging
Send poll
Send a poll message with multiple choice options
POST
/
message
/
sendPoll
/
:instanceName
Send poll
curl --request POST \
--url https://api.example.com/message/sendPoll/:instanceName \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"name": "<string>",
"selectableCount": 123,
"values": [
{}
],
"delay": 123
}
'import requests
url = "https://api.example.com/message/sendPoll/:instanceName"
payload = {
"number": "<string>",
"name": "<string>",
"selectableCount": 123,
"values": [{}],
"delay": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
number: '<string>',
name: '<string>',
selectableCount: 123,
values: [{}],
delay: 123
})
};
fetch('https://api.example.com/message/sendPoll/:instanceName', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/message/sendPoll/:instanceName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '<string>',
'name' => '<string>',
'selectableCount' => 123,
'values' => [
[
]
],
'delay' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/message/sendPoll/:instanceName"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/message/sendPoll/:instanceName")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/message/sendPoll/:instanceName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}"
response = http.request(request)
puts response.read_body{
"key": {
"remoteJid": "<string>",
"fromMe": true,
"id": "<string>"
},
"message": {}
}Request
Send a poll (voting) message to a WhatsApp number.string
required
Name of the instance
Body parameters
string
required
Recipient’s WhatsApp number with country code (e.g., “5511999999999”)
string
required
Poll question or title
number
required
Maximum number of options that can be selected (1 for single choice, >1 for multiple choice)
array
required
Array of poll options (strings)
number
Delay in milliseconds before sending
Response
object
object
Poll message details
Example request
curl -X POST https://your-api.com/message/sendPoll/my-instance \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "5511999999999",
"name": "What is your favorite color?",
"selectableCount": 1,
"values": [
"Red",
"Blue",
"Green",
"Yellow"
]
}'
const response = await fetch('https://your-api.com/message/sendPoll/my-instance', {
method: 'POST',
headers: {
'apikey': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
number: '5511999999999',
name: 'What is your favorite color?',
selectableCount: 1,
values: ['Red', 'Blue', 'Green', 'Yellow']
})
});
const data = await response.json();
console.log(data);
Notes
- Set
selectableCountto 1 for single-choice polls - Set
selectableCountto a number greater than 1 for multiple-choice polls - Maximum number of poll options is 12
- Poll results are visible to all participants
Polls are only supported on WhatsApp versions that support the poll feature. Older clients may not be able to vote.
⌘I
Send poll
curl --request POST \
--url https://api.example.com/message/sendPoll/:instanceName \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"name": "<string>",
"selectableCount": 123,
"values": [
{}
],
"delay": 123
}
'import requests
url = "https://api.example.com/message/sendPoll/:instanceName"
payload = {
"number": "<string>",
"name": "<string>",
"selectableCount": 123,
"values": [{}],
"delay": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
number: '<string>',
name: '<string>',
selectableCount: 123,
values: [{}],
delay: 123
})
};
fetch('https://api.example.com/message/sendPoll/:instanceName', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/message/sendPoll/:instanceName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'number' => '<string>',
'name' => '<string>',
'selectableCount' => 123,
'values' => [
[
]
],
'delay' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/message/sendPoll/:instanceName"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/message/sendPoll/:instanceName")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/message/sendPoll/:instanceName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"number\": \"<string>\",\n \"name\": \"<string>\",\n \"selectableCount\": 123,\n \"values\": [\n {}\n ],\n \"delay\": 123\n}"
response = http.request(request)
puts response.read_body{
"key": {
"remoteJid": "<string>",
"fromMe": true,
"id": "<string>"
},
"message": {}
}