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

# Create a poll

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

## Path parameters

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

## Headers

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

## Request body

- object
  - `question` string, required — Question of the poll
  - `options` string[], required — Options of the poll
  - `resultMode` 0 | 1, required — Mode how the results will be shown
  - `maxVotes` integer, required — Number of maximum votes per voter
  - `draft` boolean — Whether the poll should be saved as a draft (only allowed for moderators and with `talk-polls-drafts` capability)
  - `threadId` integer — Thread id which this poll should be posted into (also requires `threads` capability)

## Response `200`

Draft created successfully

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` PollDraft, 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))

## Other responses

- `201` — Poll created successfully
- `400` — Creating poll is not possible

---

[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)
