OpenWA icon

OpenWA

Interact with OpenWA WhatsApp API Gateway

Actions164

Message → Vote Poll

AI-generated

Summary

Votes on an existing WhatsApp poll message by selecting one or more specified option texts, or clears a previous vote.

Inputs

  • sessionId (required) — The ID or name of the OpenWA session sending the poll vote.
  • chatId (required) — The recipient chat JID (e.g., 628123456789@c.us for personal or 120363021234567890@g.us for groups).
  • messageId (required) — The full serialized ID of the poll message to vote on.
  • pollVoteOptions — Up to 12 option texts to select, provided as a comma-separated list, JSON array string, or array expression. Must match poll option texts exactly. Supplying an empty value clears any previous vote.

Output shape

a single record

Returns the server response object for the poll vote operation. Selected options must match the original poll option texts. On OpenWA server 0.25.0+, requests with no matching options fail with a 400 POLL_OPTION_NOT_FOUND error; on Baileys engine, poll voting returns a 501 status code.

Examples

Example 1: Vote for a single option on a WhatsApp poll

Session ID: main-session, Chat ID: 628123456789@c.us, Message ID: true_628123456789@c.us_3EB01234, Selected Options: Pizza

Example 2: Vote for multiple options using a JSON array format

Session ID: main-session, Chat ID: 120363021234567890@g.us, Message ID: false_120363021234567890@g.us_3EB05678, Selected Options: ["Option A, extra", "Option B"]

Example 3: Clear an existing vote on a poll

Session ID: main-session, Chat ID: 628123456789@c.us, Message ID: true_628123456789@c.us_3EB01234, Selected Options: (empty)

Links

Discussion