Per gli agenti AI: markdown di questa pagina — /docs-content-en/polls.md indice della documentazione — /llms.txt
Gli articoli della documentazione sono attualmente disponibili solo in inglese.
Polls
Feed polls cannot be created through the API: the Bitrix24 REST API does not officially support creating a Feed poll. Existing polls can be read and managed. Chat polls can be created through the API.
Access
All operations require the vote scope. Creating a poll in a personal chat (dialogId is a user ID or me) also requires im; vote alone is sufficient for chatN. The current user must have the corresponding Bitrix24 permissions. Chat polls are managed by the message author; Feed polls require post management rights.
| Key | Read | Write |
|---|---|---|
| KeyOrdinary read-only key | ReadAll four GET operations | WriteDenied |
| KeyCowork key with read-only access to the Bitrix24 account | ReadDenied | WriteDenied |
| KeyCompany key | ReadDenied | WriteDenied |
All four GET operations read the poll and subscribe the user to Bitrix24 events, so these operations are unavailable to a Cowork key that forbids writes to the Bitrix24 account. Poll methods are also unavailable through batch requests.
Operations
| Method and path | Description |
|---|---|
Method and pathPOST /v1/chats/:dialogId/polls |
DescriptionCreate a chat poll |
Method and pathGET /v1/polls/:pollId |
DescriptionGet a poll |
Method and pathGET /v1/polls |
DescriptionFind polls by posts or messages |
Method and pathGET /v1/polls/:pollId/results |
DescriptionPoll results |
Method and pathGET /v1/polls/:pollId/answers/:answerId/voters |
DescriptionList voters for an answer |
Method and pathPOST /v1/polls/:pollId/vote |
DescriptionVote or revote |
Method and pathDELETE /v1/polls/:pollId/vote |
DescriptionRecall a vote |
Method and pathPOST /v1/polls/:pollId/stop |
DescriptionStop a poll |
Method and pathPOST /v1/polls/:pollId/resume |
DescriptionResume a poll |
Finding a poll
In the post list (GET /v1/posts), select entries with hasPoll: true. Then pass the post IDs to GET /v1/polls?postIds=42.
In chat messages (GET /v1/chats/:dialogId/messages), a poll has data.messages[].params.componentId = "VoteMessage". The value of params.componentParams.id is the Bitrix24 poll number, voteId. To find its attachment, pass the message ID, rather than voteId, to GET /v1/polls?messageIds=42.
In the returned object, id is the attachment ID (pollId in API paths). It differs from voteId, the post ID and the message ID. If the attachment connector is not recognized, source may be omitted.
Poll object
| Field | Type | Description |
|---|---|---|
Fieldid |
Typenumber | DescriptionAttachment ID used as pollId |
FieldvoteId |
Typenumber | DescriptionBitrix24 poll number |
Fieldsource |
Typeobject | DescriptionOptional: {type: "post", postId} or {type: "chatMessage", messageId} |
Fieldstatus |
Typestring | Descriptionactive or finished |
Fieldanonymous |
Typeboolean | DescriptionWhether the poll is anonymous |
FieldallowRevote |
Typeboolean | DescriptionWhether revoting is allowed |
FieldresultsHidden |
Typeboolean | DescriptionBitrix24 hidden-results flag |
FieldresultsVisible |
Typeboolean | DescriptionWhether results are visible to the current user under Bitrix24 rules |
FieldvotersCount |
Typenumber | null | DescriptionParticipant counter |
Fieldquestions |
Typearray | DescriptionActive questions and answers only, in Bitrix24 sort order |
Fieldquestions[].id |
Typenumber | DescriptionQuestion ID |
Fieldquestions[].text |
Typestring | DescriptionQuestion text |
Fieldquestions[].multipleChoice |
Typeboolean | DescriptionWhether multiple answers can be selected |
Fieldquestions[].required |
Typeboolean | DescriptionWhether an answer is required |
Fieldquestions[].votesCount |
Typenumber | null | DescriptionQuestion vote counter |
Fieldquestions[].answers |
Typearray | DescriptionAnswer choices |
Fieldquestions[].answers[].id |
Typenumber | DescriptionAnswer ID for voting and voter lists |
Fieldquestions[].answers[].text |
Typestring | DescriptionAnswer text |
Fieldquestions[].answers[].votesCount |
Typenumber | null | DescriptionAnswer vote counter |
Fieldquestions[].answers[].percent |
Typenumber | null | DescriptionPercentage supplied by Bitrix24 |
FieldmyVote.voted |
Typeboolean | DescriptionWhether the current user has voted |
FieldmyVote.answerIds |
Typenumber[] | DescriptionAnswers selected by the current user |
Fieldpermissions.canVote |
Typeboolean | DescriptionWhether voting is permitted |
Fieldpermissions.canRevote |
Typeboolean | DescriptionWhether revoting is permitted |
Fieldpermissions.canManage |
Typeboolean | DescriptionWhether management is permitted |
Results and anonymity
Results are hidden when resultsHidden: true, or while the poll is active and the user can vote but has not voted. The exception is the poll author when Bitrix24 reports authorship (chat polls on Bitrix24 versions that support reporting authorship); post or message management rights do not reveal results. The author of a Feed poll sees hidden results in the Bitrix24 interface. Missing permission data hides results; a finished poll without hidden results remains visible. When resultsVisible: false, votersCount, questions[].votesCount, questions[].answers[].votesCount and percent are null, and answers have voters: [] and votersComplete: false in every API response containing a poll object.
In an anonymous poll, nobody can see voter identities, including the author and administrators: counters are available when resultsVisible: true. In results, voters is always empty and votersComplete is false. Results for a non-anonymous poll include a limited voter preview for each answer; use the separate operation for the full list. Counters are not cached.
The API does not return an Excel report or result links. Export the report in the Bitrix24 interface.
Handling writes
The creation idempotencyKey must be a UUID. On supported Bitrix24 versions, repeating the same key with the same body returns the existing poll. Use a new key for a new poll. Bitrix24 does not compare bodies: keep the question, answers and settings unchanged on a retry. If omitted, the server generates a new UUID for each request. Duplicate protection depends on the Bitrix24 version.
The platform never automatically replays writes. After 502 POLL_CREATE_OUTCOME_UNKNOWN, inspect the chat first: the message may already exist. After other 502 …_OUTCOME_UNKNOWN errors, read the poll and decide whether another write is needed. Do not immediately create a new key after an unknown outcome.
When revoting in the Feed, if someone edits the poll during the vote, Bitrix24 may erase the previous vote, just as in the interface. Check myVote after an error.
Deletion
There is no separate poll deletion operation. Delete its containing post or message using the existing route.