POST
/
message
/
sendPoll
/
{instance}
curl --request POST \
  --url https://api.l2msg.com/whatsapp/message/sendPoll/{instance} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "number": "<string>",
  "name": "<string>",
  "selectableCount": 123,
  "values": [
    "Question 1"
  ],
  "delay": 123,
  "linkPreview": true,
  "mentionsEveryOne": true,
  "mentioned": [
    "{{remoteJID}}"
  ],
  "quoted": {
    "key": {
      "id": "<string>"
    },
    "message": {
      "conversation": "<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
header
required

Your authorization key header

Path Parameters

instance
string
required

Name of the instance

Body

application/json
number
string
required

{{remoteJid}}

name
string
required

Main text of the poll

selectableCount
number
required

Ex: 1

values
enum<string>[]
required

Values for question

Available options:
Question 1,
Question 2,
Question 3
delay
integer

Presence time in milliseconds before sending message

Shows a preview of the target website if there's a link within the message

mentionsEveryOne
boolean

Mentioned everyone when the message send

mentioned
enum<string>[]

Numbers to mention

Available options:
{{remoteJID}}
quoted
object

Response

201 - application/json
Created
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.