> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdatePoll

# Package: richContent

# Namespace: RicosPolls

# Method link: https://dev.wix.com/docs/api-reference/assets/rich-content/polls-v1/update-poll.md

## Permission Scopes:
Manage Ricos Polls: SCOPE.DC-RICOS.MANAGE-POLLS

## Introduction

Updates a poll.

Site visitors, site members and Wix users can call this method, but only the poll's creator can update the poll. A site visitor stays the poll's creator only for as long as their visitor identity lasts. Each time the poll is updated, `revision` increments by 1. Specify the current `revision` to prevent unintended overwrites.

`options` replaces the full list of options. Options that aren't included are removed together with their votes, the order of the array is the display order, and an option without an `id`, or with an `id` that isn't in the poll, is added as a new option. The text and image of an option that already received votes can't be changed (`POLL_OPTION_HAS_VOTES`). Adding, removing and reordering options is allowed at any time.

---

## REST API

### Schema

```
 Method: updatePoll
 Description: Updates a poll.  Site visitors, site members and Wix users can call this method, but only the poll's creator can update the poll. A site visitor stays the poll's creator only for as long as their visitor identity lasts. Each time the poll is updated, `revision` increments by 1. Specify the current `revision` to prevent unintended overwrites.  `options` replaces the full list of options. Options that aren't included are removed together with their votes, the order of the array is the display order, and an option without an `id`, or with an `id` that isn't in the poll, is added as a new option. The text and image of an option that already received votes can't be changed (`POLL_OPTION_HAS_VOTES`). Adding, removing and reordering options is allowed at any time.
 URL: https://www.wixapis.com/ricos/v1/polls/{poll.id}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  poll, poll.id, poll.revision
 Method parameters: 
   param name: poll | type: Poll | description: A poll is a question with a set of options that site visitors, site members and Wix users can vote on. Polls are embedded in Ricos, Wix's rich content format used by Wix Blog, Wix Forum, Wix Comments and other apps. A poll node in the rich content references the poll by its GUID, in `pollData.poll.id`.  A poll is displayed on the site only when the rich content that contains it includes a poll node with the poll's GUID. Deleting the content doesn't delete its polls, and deleting a poll doesn't remove its node from the content. | required: true 
        - name: id | type: string | description: Poll GUID. | required: true | read-only: true | validation: format GUID
        - name: revision | type: string | description: Revision number, which increments by 1 each time the poll is updated. To prevent conflicting changes, the existing revision must be specified when updating a poll.  Ignored when creating a poll. | required: true | read-only: true | validation: format int64
        - name: question | type: string | description: Poll question.  Optional. A poll without a question has no `question`, for example a poll that only has images. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
        - name: image | type: Image | description: Poll image.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
           - name: id | type: string | description: Wix Media image GUID.  | validation: maxLength 100
           - name: url | type: string | description: Image URL.  | validation: format WEB_URL
        - name: options | type: array<PollOption> | description: Options that voters can choose from. The order of the array is the order in which options are displayed.  When updating a poll, `options` replaces the full list. Options that aren't included are removed together with their votes. See `PollOption` for details.  | validation: minItems 1, maxItems 50
           - name: id | type: string | description: Option GUID. Generated when the option is added to the poll. Ignored when creating a poll.  When updating a poll, specify the GUID of an existing option to keep it. An option without an GUID is added as a new option. An GUID that isn't in the poll is treated as a new option, and the option gets a new GUID.  Options that aren't included in the updated `options` array are removed together with their votes.  | validation: format GUID
           - name: text | type: string | description: Option text. Can't be changed after the option receives votes (`POLL_OPTION_HAS_VOTES`).  Optional. An option without text has no `text`, for example an option that only has an image. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
           - name: image | type: Image | description: Option image. Can't be changed after the option receives votes.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
        - name: settings | type: PollSettings | description: Poll settings.  
           - name: multipleVotes | type: boolean | description: Whether a voter can vote for more than one option.  Default: `false`  
           - name: votingAccess | type: VotingAccess | description: Who can vote.  Default: `PUBLIC`  
                 - enum:
                 -     PUBLIC: Anyone can vote: site members, site visitors who aren't logged in, and Wix users. Wix users vote with their own identity.
                 -     MEMBERS: Only site members and Wix users can vote. Site visitors who aren't logged in get the `MEMBERS_ONLY_VOTING` error and must log in as site members to vote.
           - name: resultsVisibility | type: ResultsVisibility | description: Who can see the results. When the caller isn't allowed to see them, `results` is omitted from the response without an error. Whether the caller voted is still returned in `currentVoterOptionIds`.  Default: `PUBLIC`  
                 - enum:
                 -     PUBLIC: Everyone can see the results, including site visitors who aren't logged in.
                 -     VOTERS: Only callers who voted, and the poll's creator, can see the results. Wix users who aren't the creator see the results after they vote.
                 -     CREATOR: Only the poll's creator can see the results. Other callers, including other Wix users, don't see them.
           - name: showVoteCounts | type: boolean | description: Whether vote counts are shown in the results. When `false`, counts are omitted and voters are also hidden, but `percentage` is still returned.  Default: `true`  
           - name: showVoters | type: boolean | description: Whether the members who voted for each option are shown. Voters are shown only when `showVoteCounts` is also `true`.  Default: `true`  
 Return type: UpdatePollResponse
  - name: poll | type: Poll | description: Updated poll.  
     - name: id | type: string | description: Poll GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the poll is updated. To prevent conflicting changes, the existing revision must be specified when updating a poll.  Ignored when creating a poll.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the poll was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the poll was last updated.  Not returned for polls that weren't updated since they were created.  | read-only: true | validation: format date-time
     - name: question | type: string | description: Poll question.  Optional. A poll without a question has no `question`, for example a poll that only has images. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
     - name: image | type: Image | description: Poll image.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
        - name: id | type: string | description: Wix Media image GUID.  | validation: maxLength 100
        - name: url | type: string | description: Image URL.  | validation: format WEB_URL
        - name: height | type: integer | description: Original image height in pixels.  | read-only: true 
        - name: width | type: integer | description: Original image width in pixels.  | read-only: true 
     - name: createdBy | type: IdentificationData | description: Identity of the poll's creator: a site member, a Wix user or a site visitor who isn't logged in. Only the creator can update or delete the poll.  | read-only: true 
        - ONE-OF: 
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor who isn't logged in.  | validation: format GUID
           - name: memberId | type: string | description: GUID of a site member.  | validation: format GUID
           - name: wixUserId | type: string | description: GUID of a Wix user, such as the site owner or a contributor.  | validation: format GUID
           - name: appId | type: string | description: GUID of an app.  | validation: format GUID
     - name: options | type: array<PollOption> | description: Options that voters can choose from. The order of the array is the order in which options are displayed.  When updating a poll, `options` replaces the full list. Options that aren't included are removed together with their votes. See `PollOption` for details.  | validation: minItems 1, maxItems 50
        - name: id | type: string | description: Option GUID. Generated when the option is added to the poll. Ignored when creating a poll.  When updating a poll, specify the GUID of an existing option to keep it. An option without an GUID is added as a new option. An GUID that isn't in the poll is treated as a new option, and the option gets a new GUID.  Options that aren't included in the updated `options` array are removed together with their votes.  | validation: format GUID
        - name: text | type: string | description: Option text. Can't be changed after the option receives votes (`POLL_OPTION_HAS_VOTES`).  Optional. An option without text has no `text`, for example an option that only has an image. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
        - name: image | type: Image | description: Option image. Can't be changed after the option receives votes.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
     - name: settings | type: PollSettings | description: Poll settings.  
        - name: multipleVotes | type: boolean | description: Whether a voter can vote for more than one option.  Default: `false`  
        - name: votingAccess | type: VotingAccess | description: Who can vote.  Default: `PUBLIC`  
             - enum:
             -     PUBLIC: Anyone can vote: site members, site visitors who aren't logged in, and Wix users. Wix users vote with their own identity.
             -     MEMBERS: Only site members and Wix users can vote. Site visitors who aren't logged in get the `MEMBERS_ONLY_VOTING` error and must log in as site members to vote.
        - name: resultsVisibility | type: ResultsVisibility | description: Who can see the results. When the caller isn't allowed to see them, `results` is omitted from the response without an error. Whether the caller voted is still returned in `currentVoterOptionIds`.  Default: `PUBLIC`  
             - enum:
             -     PUBLIC: Everyone can see the results, including site visitors who aren't logged in.
             -     VOTERS: Only callers who voted, and the poll's creator, can see the results. Wix users who aren't the creator see the results after they vote.
             -     CREATOR: Only the poll's creator can see the results. Other callers, including other Wix users, don't see them.
        - name: showVoteCounts | type: boolean | description: Whether vote counts are shown in the results. When `false`, counts are omitted and voters are also hidden, but `percentage` is still returned.  Default: `true`  
        - name: showVoters | type: boolean | description: Whether the members who voted for each option are shown. Voters are shown only when `showVoteCounts` is also `true`.  Default: `true`  
     - name: results | type: PollResults | description: Voting results.  Returned only when `RESULTS` is specified in `fields`, and only when the caller is allowed to see results. See `settings.resultsVisibility`.  | read-only: true 
        - name: voteCount | type: integer | description: Total number of votes cast for all options. This is the number of votes, not voters: when `settings.multipleVotes` is `true`, a voter who chose several options is counted once per option.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
        - name: anonymousVoteCount | type: integer | description: Number of votes cast by site visitors who weren't logged in. Included in `voteCount`.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
        - name: optionResults | type: array<PollOptionResults> | description: Results for each option.  | validation: maxItems 50
           - name: optionId | type: string | description: Option GUID.  | validation: format GUID
           - name: voteCount | type: integer | description: Number of votes for the option.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
           - name: anonymousVoteCount | type: integer | description: Number of votes for the option cast by site visitors who weren't logged in. Included in `voteCount`.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
           - name: percentage | type: integer | description: Percentage of `results.voteCount` cast for the option, rounded to the nearest integer. Because of rounding, and because a voter can choose several options when `settings.multipleVotes` is `true`, the percentages of all options don't always add up to 100.  Returned even when `settings.showVoteCounts` is `false`, so that relative results can be displayed without counts.  | validation: minimum 0, maximum 100, format int32
           - name: latestVoters | type: array<IdentificationData> | description: Identities of up to 5 site members or Wix users who voted for the option most recently. To retrieve all voters, call List Voters. To get member names and photos, call Query Members.  Not returned when `settings.showVoters` or `settings.showVoteCounts` is `false`.  | validation: maxItems 5
     - name: currentVoterOptionIds | type: array<string> | description: IDs of the options the caller voted for. Empty if the caller didn't vote.  Returned only when `CURRENT_VOTER_VOTES` is specified in `fields`, regardless of `settings.resultsVisibility`.  | read-only: true | validation: maxItems 50, format GUID

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: NOT_POLL_CREATOR | Description: Only the poll's creator can update the poll.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: POLL_OPTION_HAS_VOTES | Description: The text or image of an option that already received votes can't be changed. Adding, removing and reordering options is allowed.


```

### Examples

### Update Poll
Updates a poll. Keeps the existing options by their IDs and adds a third option. Only the poll's creator can update the poll.

```curl
curl -X PATCH \
  'https://www.wixapis.com/ricos/v1/polls/bee2255e-17c6-47a2-89a9-718e3317befb' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "poll": {
      "id": "bee2255e-17c6-47a2-89a9-718e3317befb",
      "revision": "1",
      "options": [
        { "id": "d3ed0db9-62c9-4a4e-8af3-33c556c5039c", "text": "Performance tuning" },
        { "id": "b36ac043-287c-4085-8713-d2118ed3c115", "text": "Accessibility" },
        { "text": "Internationalization" }
      ]
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.richContent.ricosPolls.updatePoll(_id, poll)
 Description: Updates a poll.  Site visitors, site members and Wix users can call this method, but only the poll's creator can update the poll. A site visitor stays the poll's creator only for as long as their visitor identity lasts. Each time the poll is updated, `revision` increments by 1. Specify the current `revision` to prevent unintended overwrites.  `options` replaces the full list of options. Options that aren't included are removed together with their votes, the order of the array is the display order, and an option without an `id`, or with an `id` that isn't in the poll, is added as a new option. The text and image of an option that already received votes can't be changed (`POLL_OPTION_HAS_VOTES`). Adding, removing and reordering options is allowed at any time.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  poll, _id, poll.revision
 Method parameters: 
   param name: _id | type: string | description: Poll GUID. | required: true | validation: format GUID
   param name: poll | type: UpdatePoll | description: A poll is a question with a set of options that site visitors, site members and Wix users can vote on. Polls are embedded in Ricos, Wix's rich content format used by Wix Blog, Wix Forum, Wix Comments and other apps. A poll node in the rich content references the poll by its GUID, in `pollData.poll.id`.  A poll is displayed on the site only when the rich content that contains it includes a poll node with the poll's GUID. Deleting the content doesn't delete its polls, and deleting a poll doesn't remove its node from the content. | required: true 
        - name: revision | type: string | description: Revision number, which increments by 1 each time the poll is updated. To prevent conflicting changes, the existing revision must be specified when updating a poll.  Ignored when creating a poll. | required: true | read-only: true | validation: format int64
        - name: question | type: string | description: Poll question.  Optional. A poll without a question has no `question`, for example a poll that only has images. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
        - name: image | type: string | description: Poll image.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
        - name: options | type: array<PollOption> | description: Options that voters can choose from. The order of the array is the order in which options are displayed.  When updating a poll, `options` replaces the full list. Options that aren't included are removed together with their votes. See `PollOption` for details.  | validation: minItems 1, maxItems 50
           - name: _id | type: string | description: Option GUID. Generated when the option is added to the poll. Ignored when creating a poll.  When updating a poll, specify the GUID of an existing option to keep it. An option without an GUID is added as a new option. An GUID that isn't in the poll is treated as a new option, and the option gets a new GUID.  Options that aren't included in the updated `options` array are removed together with their votes.  | validation: format GUID
           - name: text | type: string | description: Option text. Can't be changed after the option receives votes (`POLL_OPTION_HAS_VOTES`).  Optional. An option without text has no `text`, for example an option that only has an image. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
           - name: image | type: string | description: Option image. Can't be changed after the option receives votes.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
        - name: settings | type: PollSettings | description: Poll settings.  
           - name: multipleVotes | type: boolean | description: Whether a voter can vote for more than one option.  Default: `false`  
           - name: votingAccess | type: VotingAccess | description: Who can vote.  Default: `PUBLIC`  
                 - enum:
                 -     PUBLIC: Anyone can vote: site members, site visitors who aren't logged in, and Wix users. Wix users vote with their own identity.
                 -     MEMBERS: Only site members and Wix users can vote. Site visitors who aren't logged in get the `MEMBERS_ONLY_VOTING` error and must log in as site members to vote.
           - name: resultsVisibility | type: ResultsVisibility | description: Who can see the results. When the caller isn't allowed to see them, `results` is omitted from the response without an error. Whether the caller voted is still returned in `currentVoterOptionIds`.  Default: `PUBLIC`  
                 - enum:
                 -     PUBLIC: Everyone can see the results, including site visitors who aren't logged in.
                 -     VOTERS: Only callers who voted, and the poll's creator, can see the results. Wix users who aren't the creator see the results after they vote.
                 -     CREATOR: Only the poll's creator can see the results. Other callers, including other Wix users, don't see them.
           - name: showVoteCounts | type: boolean | description: Whether vote counts are shown in the results. When `false`, counts are omitted and voters are also hidden, but `percentage` is still returned.  Default: `true`  
           - name: showVoters | type: boolean | description: Whether the members who voted for each option are shown. Voters are shown only when `showVoteCounts` is also `true`.  Default: `true`  
 Return type: PROMISE<Poll>
  - name: _id | type: string | description: Poll GUID.  | read-only: true | validation: format GUID
  - name: revision | type: string | description: Revision number, which increments by 1 each time the poll is updated. To prevent conflicting changes, the existing revision must be specified when updating a poll.  Ignored when creating a poll.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the poll was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the poll was last updated.  Not returned for polls that weren't updated since they were created.  | read-only: true 
  - name: question | type: string | description: Poll question.  Optional. A poll without a question has no `question`, for example a poll that only has images. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
  - name: image | type: string | description: Poll image.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
  - name: createdBy | type: IdentificationData | description: Identity of the poll's creator: a site member, a Wix user or a site visitor who isn't logged in. Only the creator can update or delete the poll.  | read-only: true 
     - ONE-OF: 
        - name: anonymousVisitorId | type: string | description: GUID of a site visitor who isn't logged in.  | validation: format GUID
        - name: memberId | type: string | description: GUID of a site member.  | validation: format GUID
        - name: wixUserId | type: string | description: GUID of a Wix user, such as the site owner or a contributor.  | validation: format GUID
        - name: appId | type: string | description: GUID of an app.  | validation: format GUID
  - name: options | type: array<PollOption> | description: Options that voters can choose from. The order of the array is the order in which options are displayed.  When updating a poll, `options` replaces the full list. Options that aren't included are removed together with their votes. See `PollOption` for details.  | validation: minItems 1, maxItems 50
     - name: _id | type: string | description: Option GUID. Generated when the option is added to the poll. Ignored when creating a poll.  When updating a poll, specify the GUID of an existing option to keep it. An option without an GUID is added as a new option. An GUID that isn't in the poll is treated as a new option, and the option gets a new GUID.  Options that aren't included in the updated `options` array are removed together with their votes.  | validation: format GUID
     - name: text | type: string | description: Option text. Can't be changed after the option receives votes (`POLL_OPTION_HAS_VOTES`).  Optional. An option without text has no `text`, for example an option that only has an image. When the field is set, it can't be empty.  | validation: minLength 1, maxLength 500
     - name: image | type: string | description: Option image. Can't be changed after the option receives votes.  To set the image, send its `url`: a Wix Media URL (`static.wixstatic.com`) of an image in the site's Media Manager. `id` is derived from the URL. `height` and `width` aren't populated and are always `0`.  
  - name: settings | type: PollSettings | description: Poll settings.  
     - name: multipleVotes | type: boolean | description: Whether a voter can vote for more than one option.  Default: `false`  
     - name: votingAccess | type: VotingAccess | description: Who can vote.  Default: `PUBLIC`  
         - enum:
         -     PUBLIC: Anyone can vote: site members, site visitors who aren't logged in, and Wix users. Wix users vote with their own identity.
         -     MEMBERS: Only site members and Wix users can vote. Site visitors who aren't logged in get the `MEMBERS_ONLY_VOTING` error and must log in as site members to vote.
     - name: resultsVisibility | type: ResultsVisibility | description: Who can see the results. When the caller isn't allowed to see them, `results` is omitted from the response without an error. Whether the caller voted is still returned in `currentVoterOptionIds`.  Default: `PUBLIC`  
         - enum:
         -     PUBLIC: Everyone can see the results, including site visitors who aren't logged in.
         -     VOTERS: Only callers who voted, and the poll's creator, can see the results. Wix users who aren't the creator see the results after they vote.
         -     CREATOR: Only the poll's creator can see the results. Other callers, including other Wix users, don't see them.
     - name: showVoteCounts | type: boolean | description: Whether vote counts are shown in the results. When `false`, counts are omitted and voters are also hidden, but `percentage` is still returned.  Default: `true`  
     - name: showVoters | type: boolean | description: Whether the members who voted for each option are shown. Voters are shown only when `showVoteCounts` is also `true`.  Default: `true`  
  - name: results | type: PollResults | description: Voting results.  Returned only when `RESULTS` is specified in `fields`, and only when the caller is allowed to see results. See `settings.resultsVisibility`.  | read-only: true 
     - name: voteCount | type: integer | description: Total number of votes cast for all options. This is the number of votes, not voters: when `settings.multipleVotes` is `true`, a voter who chose several options is counted once per option.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
     - name: anonymousVoteCount | type: integer | description: Number of votes cast by site visitors who weren't logged in. Included in `voteCount`.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
     - name: optionResults | type: array<PollOptionResults> | description: Results for each option.  | validation: maxItems 50
        - name: optionId | type: string | description: Option GUID.  | validation: format GUID
        - name: voteCount | type: integer | description: Number of votes for the option.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
        - name: anonymousVoteCount | type: integer | description: Number of votes for the option cast by site visitors who weren't logged in. Included in `voteCount`.  Not returned when `settings.showVoteCounts` is `false`.  | validation: minimum 0, format int32
        - name: percentage | type: integer | description: Percentage of `results.voteCount` cast for the option, rounded to the nearest integer. Because of rounding, and because a voter can choose several options when `settings.multipleVotes` is `true`, the percentages of all options don't always add up to 100.  Returned even when `settings.showVoteCounts` is `false`, so that relative results can be displayed without counts.  | validation: minimum 0, maximum 100, format int32
        - name: latestVoters | type: array<IdentificationData> | description: Identities of up to 5 site members or Wix users who voted for the option most recently. To retrieve all voters, call List Voters. To get member names and photos, call Query Members.  Not returned when `settings.showVoters` or `settings.showVoteCounts` is `false`.  | validation: maxItems 5
  - name: currentVoterOptionIds | type: array<string> | description: IDs of the options the caller voted for. Empty if the caller didn't vote.  Returned only when `CURRENT_VOTER_VOTES` is specified in `fields`, regardless of `settings.resultsVisibility`.  | read-only: true | validation: maxItems 50, format GUID

 Possible Errors:
   HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: NOT_POLL_CREATOR | Description: Only the poll's creator can update the poll.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: POLL_OPTION_HAS_VOTES | Description: The text or image of an option that already received votes can't be changed. Adding, removing and reordering options is allowed.


```

### Examples

### Update a poll
Keeps the existing options by their IDs and adds a third option. Only the poll's creator can update the poll.

```javascript
import { ricosPolls } from "@wix/rich-content";

async function updatePoll() {
  const response = await ricosPolls.updatePoll(
    "bee2255e-17c6-47a2-89a9-718e3317befb",
    {
      revision: "1",
      options: [
        { _id: "d3ed0db9-62c9-4a4e-8af3-33c556c5039c", text: "Performance tuning" },
        { _id: "b36ac043-287c-4085-8713-d2118ed3c115", text: "Accessibility" },
        { text: "Internationalization" },
      ],
    },
  );
}

/* Promise resolves to:
 * {
 *   "_id": "bee2255e-17c6-47a2-89a9-718e3317befb",
 *   "revision": "2",
 *   "_createdDate": "2026-11-11T11:02:03.649Z",
 *   "_updatedDate": "2026-11-11T14:20:41.118Z",
 *   "question": "Which topic should we cover next?",
 *   "options": [
 *     { "_id": "d3ed0db9-62c9-4a4e-8af3-33c556c5039c", "text": "Performance tuning" },
 *     { "_id": "b36ac043-287c-4085-8713-d2118ed3c115", "text": "Accessibility" },
 *     { "_id": "e41f6c7a-0d2b-4e93-a5c8-7b19d3f2a860", "text": "Internationalization" }
 *   ]
 * }
 */

```

### updatePoll (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { ricosPolls } from '@wix/rich-content';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { ricosPolls },
  // Include the auth strategy and host as relevant
});


async function updatePoll(_id,poll) {
  const response = await myWixClient.ricosPolls.updatePoll(_id,poll);
};
```

---