# Enviar enquete

`POST /send/poll`

Pasta: **Enviar Mensagem**

## Autenticação

```http
token: {{token}}
```

## Descrição

# Enviar enquete

Cria e envia uma enquete (poll) com pergunta e opções. Para votar em uma enquete existente use `/message/poll-vote` (outro grupo).

## Endpoint

```http
POST {{baseUrl}}/send/poll
```

## Autenticação

Envie o token da instância no header:

```http
token: {{token}}
```

## Corpo da requisição

| Campo | Tipo | Obrigatório | Descrição |
| --- | --- | --- | --- |
| number | string | Sim* | Destinatário |
| chatid | string | Sim* | Alternativa a number |
| name | string | Sim | Pergunta da enquete |
| options | string[] | Sim | Opções (mínimo 2) |
| selectableCount | int | Não | Quantas opções o usuário pode marcar (0 ou omitido = 1) |

## Exemplo de Requisição

```bash
curl -X POST "{{baseUrl}}/send/poll" \
  -H "token: {{token}}" \
  -H "Content-Type: application/json" \
  -d '{"number": "{{remoteJid}}", "name": "Qual horário prefere?", "options": ["Manhã", "Tarde", "Noite"], "selectableCount": 1}'
```

## Resposta de Sucesso

```json
{
  "success": true,
  "message": {
    "id": "3EB0A1B2C3D4E5F6",
    "timestamp": "2026-07-17T12:34:56Z",
    "sender": "5511888888888@s.whatsapp.net"
  }
}
```

## Erros comuns

- `name is required`
- `at least 2 options are required`
- Instância desconectada

## Corpo (exemplo)

```json
{
  "number": "{{remoteJid}}",
  "name": "Qual horário prefere?",
  "options": [
    "Manhã",
    "Tarde",
    "Noite"
  ],
  "selectableCount": 1
}
```

## cURL

```bash
curl -X POST "{{baseUrl}}/send/poll" \
  -H "token: {{token}}" \
  -H "Content-Type: application/json" \
  -d '{
  "number": "{{remoteJid}}",
  "name": "Qual horário prefere?",
  "options": [
    "Manhã",
    "Tarde",
    "Noite"
  ],
  "selectableCount": 1
}'
```

---

[Índice da pasta](./index.md) · [Índice geral](../index.md) · [UI](https://gozap.dev/docs?op=enviar-mensagem/enviar-enquete)
