POST

https://{server-url}

/
message
/
sendPoll
/
{instance}
curl --request POST \
  --url https://{server-url}/message/sendPoll/{instance} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "number": "<string>",
  "options": {
    "delay": 123,
    "presence": "composing"
  },
  "pollMessage": {
    "name": "<string>",
    "selectableCount": 2,
    "values": [
      "<string>"
    ]
  }
}'
{
  "key": {
    "remoteJid": "553198296801@s.whatsapp.net",
    "fromMe": true,
    "id": "BAE53EC8D8E1FD8A"
  },
  "message": {
    "messageContextInfo": {
      "messageSecret": "lX/+cLHHNfnTTKZi+88mrhoyi6KNuUzWjgfaB0bTfOY="
    },
    "pollCreationMessage": {
      "name": "Poll Name",
      "options": [
        {
          "optionName": "Option 1"
        },
        {
          "optionName": "Option 2"
        },
        {
          "optionName": "Option 3"
        }
      ],
      "selectableOptionsCount": 1
    }
  },
  "messageTimestamp": "1717781848",
  "status": "PENDING"
}

Authorizations

apikey
string
headerrequired

Your authorization key header

Path Parameters

instance
string
required

ID of the instance to connect

Body

application/json
number
string
required

Number to receive the message (with country code)

options
object
pollMessage
object
required

Response

201 - application/json
key
object

The key of the message, which identifies the message in the chat.

message
object

The message content, which may include various types of messages like text, images, poll creation, etc.

messageTimestamp
string

The timestamp of the message, represented as a string.

status
string

The status of the message, such as sent, received, or pending.