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

# Poll votes

> Returns the aggregated votes and the per-voter breakdown of a poll

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** yes

## Description

Returns the votes for a poll sent by the instance. The response includes:

* **Aggregated** by option (`votes[]`), option name and total.
* **Detail** vote by vote (`voteDetails[]`), who voted, on which option, when.

<Info>
  `optionHash` is the `SHA256(optionName)` in uppercase, used by WhatsApp to anonymize votes in the protocol. Useful to correlate raw votes with their options.
</Info>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://ryzeapi.cloud/api/chat/poll/$Instance_Name?messageId=3EB08FCF27E532F1B0F5" \
    -H "token: $Token_Instance"
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/chat/poll/${process.env.Instance_Name}?messageId=3EB08FCF27E532F1B0F5`, {
    method: "GET",
    headers: {
      "token": process.env.Token_Instance
    }
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.get(
      f"https://ryzeapi.cloud/api/chat/poll/{os.environ['Instance_Name']}?messageId=3EB08FCF27E532F1B0F5",
      headers={"token": os.environ["Token_Instance"]}
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
  )

  func main() {
      req, _ := http.NewRequest("GET", "https://ryzeapi.cloud/api/chat/poll/"+os.Getenv("Instance_Name")+"?messageId=3EB08FCF27E532F1B0F5", nil)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The envelope brings `messageId` of the poll and the `data` object (`PollResult`) with the question in `name`, the aggregated count per option in `votes`, and the detailed vote list in `voteDetails`. Use `votes[].optionVoteCount` for per-option totals and `voteDetails` when you need to know who voted for what.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Poll votes retrieved successfully",
  "messageId": "3EB08FCF27E532F1B0F5",
  "data": {
    "messageId": "3EB08FCF27E532F1B0F5",
    "name": "Which flavor?",
    "votes": [
      { "optionName": "Chocolate", "optionVoteCount": 5 },
      { "optionName": "Vanilla", "optionVoteCount": 3 }
    ],
    "voteDetails": [
      {
        "optionHash": "A1B2C3D4E5F6...",
        "optionName": "Chocolate",
        "senderJid": "5511999999999",
        "voteMessageId": "msg_abc",
        "createdAt": "2026-04-28T10:00:00Z"
      }
    ]
  }
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Query params

<ParamField query="messageId" type="string" required>
  ID of the poll message.
</ParamField>

## Headers

| Name    | Required                 | Example        | Description                    |
| ------- | ------------------------ | -------------- | ------------------------------ |
| `token` | yes (or `Authorization`) | `a1b2c3d4-...` | TokenAccount or TokenInstance. |

## Error responses

| HTTP | `error.message`                         | When it happens                            |
| ---- | --------------------------------------- | ------------------------------------------ |
| 400  | `Instance name is required`             | ,                                          |
| 400  | `messageId query parameter is required` | ,                                          |
| 401  | `Invalid token`                         | ,                                          |
| 404  | `Instance not found`                    | ,                                          |
| 404  | `Poll not found`                        | `messageId` does not correspond to a poll. |

```json Error 404 theme={null}
{
  "success": false,
  "error": { "message": "Poll not found" }
}
```

## Related

<CardGroup cols={2}>
  <Card title="Send poll" href="/en/api/messages/poll">
    Create a poll.
  </Card>

  <Card title="Find message" href="/en/api/chat/find-message">
    Retrieve the original poll.
  </Card>
</CardGroup>
