WhatsApp Gateway
API referenceMessages

Vote on a poll message

Casts a vote on the poll message identified by `mid` (located by `chat`/`sender` in the body). `options` is the **complete** set of poll choices you want selected — it **replaces** your previous vote rather than adding to it. Send an empty array to clear your vote; for a single-choice poll send exactly one option. Returns **200** with a `SendResult`. ### Preconditions & errors - Requires the **`send`** capability. - **400 `validation_error`** — the target is not a poll or an option does not match the poll's choices. - **404 `not_found`** — the session or poll message does not exist or is not owned by your organization.

POST
/api/v1/sessions/{session}/messages/{mid}/vote

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The router accepts two kinds of token and tries each in turn: a frontend-minted login JWT (verified against the frontend JWKS; the person's org + role are read from it), or an api-key for a script/service (carrying a fixed set of gateway permissions). The bearerFormat: JWT label describes the person-login case.

In: header

Path Parameters

session*string

The WhatsApp session id casting the vote. Must be a connected session your organization owns.

mid*string

The WhatsApp message id (the per-message stable id assigned by WhatsApp) of the poll message being voted on.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

chat?string

The JID of the chat the poll lives in (e.g. "123...@s.whatsapp.net" or "123...@g.us").

options?array<string>|

The full set of poll option texts you want selected. This replaces your previous vote entirely — send every option you want marked, not just the new ones. Send an empty array to clear your vote. For single-choice polls supply exactly one option.

sender?string

The JID of the poll's creator/sender. Identifies the poll message together with mid.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/sessions/01HZX.../messages/3EB0C431C26A1916E07A/vote" \  -H "Content-Type: application/json" \  -d '{}'
{  "mode": "string",  "outboxId": "string",  "replayed": true,  "status": "string",  "timestamp": 0,  "waMessageId": "string"}
{  "error": {    "code": "not_found",    "details": {      "property1": null,      "property2": null    },    "message": "session not found"  }}