Poll object
The poll object contains nested structures designed to support future extensibility.Poll object structure
The question of the poll. Only
text is supported for the question.Each of the answers available in the poll.
The time when the poll ends. Marked as nullable to support non-expiring polls in the future, but all polls currently have an expiry.
Whether a user can select multiple answers.
The layout type of the poll.
The results of the poll. May be absent in certain responses where results are not fetched. Treat absence as “unknown results”, not “no results”. Optional field.
Poll create request object
Used when creating a poll. Similar to the poll object, but usesduration instead of expiry.
Poll create request structure
The question of the poll. Only
text is supported.Each of the answers available in the poll. Up to 10 answers.
Number of hours the poll should be open for, up to 32 days. Defaults to
24.Whether a user can select multiple answers. Defaults to
false.The layout type of the poll. Defaults to
DEFAULT (1).Layout type
| Type | ID | Description |
|---|---|---|
| DEFAULT | 1 | The default layout type |
Poll media object
A common object that backs both the poll question and answers. Allows extensible display options in the future.The text of the field. Always non-null for questions and answers in practice. Maximum 300 characters for questions, 55 for answers.
The emoji of the field. Optional; only applicable to answers (not the question). When creating an answer with an emoji, send either
id (custom emoji) or name (standard emoji) as the only field.Poll answer object
Theanswer_id labels each answer. It currently starts at 1 for the first answer and increments sequentially, though you should not depend on this behavior. There is a maximum of 10 answers per poll.
The ID of the answer. Only sent as part of responses from the API or Gateway.
The data of the answer.
Poll results object
Contains the number of votes for each answer.While a poll is in progress, results may not be perfectly accurate due to the intricacies of counting at scale. After a poll ends, a background job performs a final accurate tally. Results are finalized when
is_finalized is true.Whether the votes have been precisely counted.
The counts for each answer. If an answer has no votes, it will not appear in this list.
Poll answer count object structure
The
answer_id this count corresponds to.The number of votes for this answer.
Whether the current user voted for this answer.
Poll endpoints
To create a poll, see Create Message. After creation, the poll message cannot be edited.Apps are not allowed to vote on polls.
Get answer voters
GET /channels/{channel.id}/polls/{message.id}/answers/{answer_id}Query string params
Get users after this user ID.
Max number of users to return (1–100).
Response body
Users who voted for this answer.
End poll
POST /channels/{channel.id}/polls/{message.id}/expireMessage Update gateway event.