> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wappfy.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Poll

> Send poll (poll) to a contact or group

## 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

```json theme={null}
{
  "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`)                                                           |

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "messageId": "3EB0XXXXXX"
  }
  ```
</ResponseExample>

## Status Codes

* `200` - Poll sent successfully
* `400` - Invalid parameters
* `401` - Unauthorized session
* `404` - Session not found

## Usage Example

<CodeGroup>
  ```bash cURL theme={null}
  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
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  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);
  ```

  ```python Python theme={null}
  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)
  ```
</CodeGroup>


## OpenAPI

````yaml viewer-en.json post /api/sendPoll
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Customizable Server
    variables:
      host:
        default: api.wappfy.com.br
        description: Server URL (e.g., api.wappfy.com.br or your-server.com)
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: Control WhatsApp sessions (accounts)
  - name: 🔑 Auth
    description: Authentication
  - name: 🆔 Profile
    description: Your profile information
  - name: 🖼️ Screenshot
    description: Get WhatsApp screenshot and display QR code
  - name: 📤 Chatting
    description: Conversation methods
  - name: 📢 Channels
    description: Channels (newsletters) methods
  - name: 🟢 Status
    description: Status (aka stories) methods
  - name: 💬 Chats
    description: Conversations methods
  - name: 👤 Contacts
    description: |-
      Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      E.g: `12312312310` OR `12312312310@c.us`<br>
  - name: 👥 Groups
    description: Groups methods.<br>
  - name: ✅ Presence
    description: Presence information
  - name: 📅 Events
    description: Event Message
  - name: 🏷️ Labels
    description: Labels - available only for WhatsApp Business accounts
  - name: 🔍 Observability
    description: Other methods
  - name: 🗄️ Storage
    description: Storage methods
externalDocs:
  description: Wappfy - WhatsApp API
  url: https://docs.wappfy.com.br/
paths:
  /api/sendPoll:
    post:
      tags:
        - 📤 Chatting
      summary: Send a poll with options
      description: You can use it as a replacement for buttons or list
      operationId: ChattingController_sendPoll
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessagePollRequest'
      responses:
        '201':
          description: ''
      security:
        - api_key: []
components:
  schemas:
    MessagePollRequest:
      type: object
      properties:
        chatId:
          type: string
          description: Chat ID (WhatsApp JID)
          example: 5511999999999@c.us
        reply_to:
          type: string
          description: Message ID you want to reply to
          example: null
        poll:
          $ref: '#/components/schemas/MessagePoll'
          description: Object containing the poll information
        session:
          type: string
          example: my-session
          description: Session name (instanceName)
      required:
        - chatId
        - poll
        - session
    MessagePoll:
      type: object
      properties:
        name:
          type: string
          description: Poll question or title
          example: What is the best time for the meeting?
        options:
          description: Array of response options
          example:
            - Morning (9am)
            - Afternoon (2pm)
            - Evening (7pm)
          type: array
          items:
            type: string
        multipleAnswers:
          type: object
          description: Allow multiple answers
          default: false
      required:
        - name
        - options
        - multipleAnswers
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````