---
title: "Vote on a poll"
method: POST
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}"
tags: ["poll"]
---

# Vote on a poll

`POST /ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}`

## Path parameters

- `apiVersion` 'v1', required
- `token` string, required
- `pollId` integer, required

## Headers

- `x-nextcloud-federation` string
- `OCS-APIRequest` boolean, required

## Request body

- object
  - `optionIds` integer[] — IDs of the selected options

## Response `200`

Voted successfully

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` Poll, required
      - `actorDisplayName` string, required — Display name of the poll author
      - `actorId` string, required — Actor ID identifying the poll author
      - `actorType` 'users' | 'groups' | 'guests' | 'emails' | 'circles' | 'bridged' | 'bots' | 'federated_users' | 'phones', required
      - `id` integer, required — ID of the poll
      - `maxVotes` integer, required — Maximum amount of options a user can vote for, `0` means unlimited
      - `options` string[], required — The options participants can vote for
      - `question` string, required — The question of the poll
      - `resultMode` 0 | 1, required — Result mode of the poll (see [Constants - Poll mode](https://nextcloud-talk.readthedocs.io/en/latest/constants#poll-mode))
      - `status` 0 | 1 | 2, required — Status of the poll (see [Constants - Poll status](https://nextcloud-talk.readthedocs.io/en/latest/constants#poll-status))
      - `details` PollVote[] — Detailed list who voted for which option (only available for public closed polls)
        - `actorDisplayName` string, required — The display name of the participant that voted
        - `actorId` string, required — The actor id of the participant that voted
        - `actorType` string, required — The actor type of the participant that voted (see [Constants - Attendee types](https://nextcloud-talk.readthedocs.io/en/latest/constants#attendee-types))
        - `optionId` integer, required — The option that was voted for
      - `numVoters` integer — The number of unique voters that voted (only available when the actor voted on public poll or the poll is closed unless for the creator and moderators)
      - `votedSelf` integer[] — Array of option ids the participant voted for
      - `votes` object — Map with `'option-' + optionId` => number of votes (only available when the actor voted on public poll or the poll is closed)

## Other responses

- `400` — Voting is not possible
- `404` — Poll not found

---

[API](https://skmtc.dev/nextcloud/apis/spreed-full.md) · [All operations](https://skmtc.dev/nextcloud/apis/spreed-full/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/spreed-full/revisions/41d6458d6d6e/schema)
