Send a poll with options
curl --request POST \
--url https://{host}/api/sendPoll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"poll": {
"name": "What is the best time for the meeting?",
"options": [
"Morning (9am)",
"Afternoon (2pm)",
"Evening (7pm)"
],
"multipleAnswers": false
},
"session": "my-session",
"reply_to": null
}
'import requests
url = "https://{host}/api/sendPoll"
payload = {
"chatId": "5511999999999@c.us",
"poll": {
"name": "What is the best time for the meeting?",
"options": ["Morning (9am)", "Afternoon (2pm)", "Evening (7pm)"],
"multipleAnswers": False
},
"session": "my-session",
"reply_to": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
poll: {
name: 'What is the best time for the meeting?',
options: ['Morning (9am)', 'Afternoon (2pm)', 'Evening (7pm)'],
multipleAnswers: false
},
session: 'my-session',
reply_to: null
})
};
fetch('https://{host}/api/sendPoll', 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://{host}/api/sendPoll",
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([
'chatId' => '5511999999999@c.us',
'poll' => [
'name' => 'What is the best time for the meeting?',
'options' => [
'Morning (9am)',
'Afternoon (2pm)',
'Evening (7pm)'
],
'multipleAnswers' => false
],
'session' => 'my-session',
'reply_to' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sendPoll"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sendPoll")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendPoll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Messaging
Send Poll
Send poll (poll) to a contact or group
POST
/
api
/
sendPoll
Send a poll with options
curl --request POST \
--url https://{host}/api/sendPoll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"chatId": "5511999999999@c.us",
"poll": {
"name": "What is the best time for the meeting?",
"options": [
"Morning (9am)",
"Afternoon (2pm)",
"Evening (7pm)"
],
"multipleAnswers": false
},
"session": "my-session",
"reply_to": null
}
'import requests
url = "https://{host}/api/sendPoll"
payload = {
"chatId": "5511999999999@c.us",
"poll": {
"name": "What is the best time for the meeting?",
"options": ["Morning (9am)", "Afternoon (2pm)", "Evening (7pm)"],
"multipleAnswers": False
},
"session": "my-session",
"reply_to": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
poll: {
name: 'What is the best time for the meeting?',
options: ['Morning (9am)', 'Afternoon (2pm)', 'Evening (7pm)'],
multipleAnswers: false
},
session: 'my-session',
reply_to: null
})
};
fetch('https://{host}/api/sendPoll', 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://{host}/api/sendPoll",
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([
'chatId' => '5511999999999@c.us',
'poll' => [
'name' => 'What is the best time for the meeting?',
'options' => [
'Morning (9am)',
'Afternoon (2pm)',
'Evening (7pm)'
],
'multipleAnswers' => false
],
'session' => 'my-session',
'reply_to' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sendPoll"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sendPoll")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sendPoll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"poll\": {\n \"name\": \"What is the best time for the meeting?\",\n \"options\": [\n \"Morning (9am)\",\n \"Afternoon (2pm)\",\n \"Evening (7pm)\"\n ],\n \"multipleAnswers\": false\n },\n \"session\": \"my-session\",\n \"reply_to\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Description
This endpoint allows you to send a poll (survey) to individual contacts or groups on WhatsApp. You can create polls with multiple options and configure whether to allow multiple answers or just one answer.Body
{
"sessionId": "my-session",
"jid": "5511999999999@s.whatsapp.net",
"poll": {
"name": "What's your favorite color?",
"options": [
"Option 1",
"Option 2"
],
"multipleAnswers": true
}
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
sessionId | string | ✅ Yes | Authenticated session ID that will send the poll |
jid | string | ✅ Yes | Recipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups |
poll | object | ✅ Yes | Object containing the poll information |
poll.name | string | ✅ Yes | Poll question or title |
poll.options | array | ✅ Yes | Array of strings with the answer options (minimum 2 options) |
poll.multipleAnswers | boolean | ❌ No | Defines whether multiple answers are allowed (default: false) |
{
"success": true,
"messageId": "3EB0XXXXXX"
}
Status Codes
200- Poll sent successfully400- Invalid parameters401- Unauthorized session404- Session not found
Usage Example
curl -X POST https://api.wappfy.com.br/api/sendPoll \
-H "Content-Type: application/json" \
-d '{
"sessionId": "my-session",
"jid": "120363XXXXX@g.us",
"poll": {
"name": "What's the best time for the meeting?",
"options": ["Morning (9am)", "Afternoon (2pm)", "Evening (7pm)"],
"multipleAnswers": false
}
}'
const response = await fetch('https://api.wappfy.com.br/api/sendPoll', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
sessionId: 'my-session',
jid: '120363XXXXX@g.us',
poll: {
name: 'What\'s the best time for the meeting?',
options: ['Morning (9am)', 'Afternoon (2pm)', 'Evening (7pm)'],
multipleAnswers: false
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.wappfy.com.br/api/sendPoll',
json={
'sessionId': 'my-session',
'jid': '120363XXXXX@g.us',
'poll': {
'name': 'What\'s the best time for the meeting?',
'options': ['Morning (9am)', 'Afternoon (2pm)', 'Evening (7pm)'],
'multipleAnswers': False
}
}
)
data = response.json()
print(data)
Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Body
application/json
Response
201 - undefined
⌘I
