> 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

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/assets/rich-content/polls-v1/introduction.md

## Article Content:

# About the Ricos Polls API

Ricos is Wix's rich content format. Wix Blog, Wix Forum, Wix Comments, and other apps use it to store formatted content, such as text, images, and polls. The Ricos Polls API manages the polls that are embedded in Ricos rich content, and the votes cast on them.

With the Ricos Polls API, you can:

+ Create, retrieve, update, and delete polls.
+ Retrieve a poll together with its voting results.
+ Cast and remove the caller's votes.
+ List the site members who voted for a poll option.

The main client of the Ricos Polls API is the Ricos poll plugin. When a Wix user adds a poll to rich content, the plugin displays it, creates the poll when the content is published, and lets visitors vote, all through this API. In most cases, you don't need to call the API yourself, because the plugin in the Ricos editor and viewer does it for you.

You can also call the API without the plugin, for example to create or display polls in your own UI. In that case, you're responsible for connecting each poll to its `POLL` node in the Ricos document. For details about the node and the properties it needs, see the [Ricos Document reference](https://dev.wix.com/docs/ricos/api-reference/ricos-document.md#plugin-poll).

## Poll lifecycle

A poll is displayed on a site only when rich content references it. In the rich content, a poll is a node of type `POLL`, and the poll's ID is in the node's `pollData.poll.id` field. To find a poll in a Ricos document, look for nodes of type `POLL`, and specify `pollData.poll.id` in [Get Poll](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/get-poll.md).

+ The Ricos editor's poll plugin creates a poll when content that contains the poll is published, and stores the poll ID in the poll node.
+ A poll that you create with [Create Poll](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/create-poll.md) isn't displayed anywhere until you add a poll node with its ID to the rich content. A node without a poll ID, or with the ID of a poll that doesn't exist, can't load a poll.
+ Deleting content doesn't delete its polls.
+ Deleting a poll with [Delete Poll](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/delete-poll.md) doesn't remove the poll node from the content, and the poll widget can't load the deleted poll.
+ When a site is duplicated, its polls are copied with the same IDs, without votes. `createdBy` of the copied polls is the new site owner.

For more information about rich content and its nodes, see the [Rich Content](https://dev.wix.com/docs/api-reference/assets/rich-content.md) documentation.

## Results and voters

The poll's `settings` control what the poll widget shows to site visitors:

+ `resultsVisibility` controls who sees `results`. When the caller isn't allowed to see the results, `results` is omitted from the response without an error.
+ `showVoteCounts` controls whether vote counts are returned. `percentage` is returned either way.
+ `showVoters` controls whether voters are listed. Voters are listed only when `showVoteCounts` is also `true`.
+ `votingAccess` controls who can vote. If it's `MEMBERS`, site visitors who aren't logged in must log in as site members to vote.

| `resultsVisibility` value | Who sees the results |
| ------------------------- | -------------------- |
| `PUBLIC` | Everyone. |
| `VOTERS` | Callers who voted, and the poll's creator. |
| `CREATOR` | Only the poll's creator. |

A Wix user who isn't the poll's creator sees results only when the visibility is `PUBLIC`, or `VOTERS` after voting.

To retrieve the voting results, specify `RESULTS` in `fields`. To find out which options the caller voted for, specify `CURRENT_VOTER_VOTES` in `fields`. `currentVoterOptionIds` is returned regardless of `resultsVisibility`. Cast Vote and Remove Vote return it, together with the updated `results`, instead of the full poll.

Votes of site visitors who weren't logged in are counted, but their identities aren't listed. Wix users vote with their own identity, and their votes are listed with their member or Wix user ID.

## Before you begin

It's important to note the following points before starting to code:

+ Apps and Wix back-office users can't call any method. Site visitors, site members, and Wix users can call all methods.
+ Only the poll's creator can update or delete the poll. A site visitor stays the poll's creator only for as long as their visitor identity lasts, so a visitor who logs out or clears cookies can no longer update or delete the poll. To remove a poll that someone else created, delete the content that contains it.
+ A `POLL` node is displayed only when the `poll` plugin is enabled in the Ricos editor and viewer that render the content.
+ To set a poll or option image, send the image's Wix Media `url` (`static.wixstatic.com`) from the site's Media Manager.
+ The text and image of an option that already received votes can't be changed. You can still add, remove, and reorder options. Removing an option also removes its votes.

## Use cases

+ [Show a poll from rich content and let visitors vote](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/sample-flows.md#show-a-poll-from-rich-content-and-let-visitors-vote)
+ [Create a poll and add it to a Ricos document](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/sample-flows.md#create-a-poll-and-add-it-to-a-ricos-document)
+ [Show who voted for an option](https://dev.wix.com/docs/api-reference/assets/rich-content/polls/sample-flows.md#show-who-voted-for-an-option)

## Terminology

+ Ricos: Wix's rich content format.
+ Poll: A question with a set of options to vote on.
+ Option: One of the answers that voters can choose.
+ Voter: A site member, a Wix user, or a site visitor who voted in a poll.

