Create a Poll
201 Created:
id (the poll ID) and the options[].id values — you need them to submit votes.
Vote on a Poll
id from the create response as the pollId path parameter, and one of the options[].id values as optionId.
201 Created:
{pollId, optionId, voter} combination is idempotent — re-submitting the same vote is a no-op.
Delete a Vote
id from the vote creation response as voteId.
Response — 204 No Content (empty body on success)
404 is returned if the vote is not found.
Request Fields
POST /v2/polls
| Field | Type | Required | Description |
|---|---|---|---|
topicId | string (UUID) | Yes | Topic to post the poll in. The bot must be a member. |
question | string | Yes | Poll question / title. Max 500 characters. |
options | string[] | Yes | Answer option texts. Min 2, max 10. Each option max 1000 characters. |
selectionType | "single" | "multiple" | Yes | Whether voters may choose one or multiple options. |
anonymous | boolean | No | If true, voter identities are hidden. Anonymous polls do not support voting via the API. |
POST /v2/polls//votes
| Field | Type | Required | Description |
|---|---|---|---|
optionId | string | Yes | The 6-character ID of the option to vote for. Use the id from the poll’s options array. |
Constraints
| Constraint | Behavior |
|---|---|
| Anonymous polls | Voting via the API is not supported (400 anonymous polls are not supported) |
| Closed polls | Votes are rejected (400 poll is closed) |
| Not a member | Bot must be a member of the topic (403) |
selectionType: "single" | Each voter can vote for one option |
selectionType: "multiple" | Each voter can vote for any number of options |
| Duplicate votes | Idempotent — same {pollId, optionId, voter} combination is a no-op |
Webhook Events
Zenzap fires webhook events when votes are cast or retracted on polls in topics your bot is a member of:| Event | Fired when |
|---|---|
poll_vote.created | A member votes on a poll |
poll_vote.deleted | A vote is retracted (by a user in the app or via DELETE /v2/polls/{pollId}/votes/{voteId}) |