---
title: "Vote on a poll"
method: POST
path: "/v2/polls/{pollId}/votes"
tags: ["Polls"]
---

# Vote on a poll

`POST /v2/polls/{pollId}/votes`

## Request

- Base URL: `https://api.zenzap.co`
- URL: `https://api.zenzap.co/v2/polls/{pollId}/votes`
- Auth: one of:
  - HTTP bearer and API key in header `X-Signature`
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.zenzap.co/oauth/token` scopes: `poll:write`
- TypeScript: <https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/docs/v2/polls/:pollId/votes/post.ts> (a function with typed inputs; its response is checked against the schema)

Submit a vote on a poll on behalf of the bot. The bot must be a member of the topic the poll was posted in.

Use the `id` values from the `options` array in the `POST /v2/polls` response as the `optionId`.

**Constraints:**
- Anonymous polls do not support voting via the API
- Votes cannot be cast on closed or expired polls
- Each `{pollId, optionId, voter}` combination is idempotent — re-submitting the same vote is a no-op

## Path parameters

- `pollId` string, uuid, required

## Headers

- `X-Signature` string
- `X-Timestamp` integer

## Request body

- PollVoteCreateRequest
  - `optionId` string, required: The ID of the option to vote for. Use the `id` values from the `options` array in the create poll response.

## Response `201`

Vote recorded successfully

- PollVoteCreateResponse
  - `id` string: Unique vote ID (composite of attachmentId, optionId, and voter profile ID).
  - `attachmentId` string, uuid: The poll's attachment ID.
  - `optionId` string: The option that was voted for.
  - `createdAt` integer: Vote creation timestamp in milliseconds.

## Other responses

- `400`: Validation error
- `401`: Unauthorized - invalid or missing API token
- `403`: Bot is not a member of the topic
- `404`: Poll not found
- `500`: Internal server error

---

[API](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api.md) - [All operations](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/revisions/37faae2c2036?raw)
