Skip to main content
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",
  "reply_to": null,
  "poll": {
    "name": "What is the best time for the meeting?",
    "options": [
      "Morning (9am)",
      "Afternoon (2pm)",
      "Evening (7pm)"
    ],
    "multipleAnswers": false
  },
  "session": "my-session"
}'
{
  "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

PropertyTypeRequiredDescription
sessionIdstring✅ YesAuthenticated session ID that will send the poll
jidstring✅ YesRecipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups
pollobject✅ YesObject containing the poll information
poll.namestring✅ YesPoll question or title
poll.optionsarray✅ YesArray of strings with the answer options (minimum 2 options)
poll.multipleAnswersboolean❌ NoDefines whether multiple answers are allowed (default: false)
{
  "success": true,
  "messageId": "3EB0XXXXXX"
}

Status Codes

  • 200 - Poll sent successfully
  • 400 - Invalid parameters
  • 401 - Unauthorized session
  • 404 - 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
    }
  }'

Authorizations

apikey
string
header
required

Your Wappfy API key (get it at dash.wappfy.com.br)

Body

application/json
chatId
string
required

Chat ID (WhatsApp JID)

Example:

"5511999999999@c.us"

poll
object
required

Object containing the poll information

session
string
required

Session name (instanceName)

Example:

"my-session"

reply_to
string

Message ID you want to reply to

Example:

null

I