---
title: "Create a poll"
method: POST
path: "/v2/polls"
tags: ["Polls"]
---

# Create a poll

`POST /v2/polls`

## Request

- Base URL: `https://api.zenzap.co`
- URL: `https://api.zenzap.co/v2/polls`
- Auth: one of:
  - HTTP bearer and API key in header `X-Signature`
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.zenzap.co/oauth/token` scopes: `poll:write`
- TypeScript: <https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/docs/v2/polls/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a poll in a topic. The bot must be a member of the topic.

Polls are sent as messages. Each option text is stored server-side with a
server-generated 6-character ID — use those IDs when submitting votes.

**Anonymous polls** (`anonymous: true`) do not support voting via the API.

## Headers

- `X-Signature` string
- `X-Timestamp` integer

## Request body

- PollCreateRequest
  - `topicId` string, uuid, required: ID of the topic to post the poll in. The bot must be a member.
  - `question` string, required: The poll question / title.
  - `options` string[], required: Poll answer options. Each item is the display text; IDs are generated server-side.
  - `selectionType` 'single' | 'multiple', required: Whether voters may select one or multiple options: - `single`: one choice allowed - `multiple`: any number of choices allowed
  - `anonymous` boolean: If `true`, voter identities are hidden. Anonymous polls do **not** support voting via the API.

## Response `201`

Poll created successfully. The `id` field is the poll ID — use it as `{pollId}` when calling `POST /v2/polls/{pollId}/votes`.

- PollCreateResponse
  - `id` string, uuid: The poll ID. Use this as the `pollId` path parameter when voting.
  - `topicId` string, uuid: ID of the topic the poll was posted in.
  - `question` string: The poll question.
  - `options` PollOption[]: Poll options with their server-generated IDs.
    - `id` string: Server-generated 6-character option ID. Use this as `optionId` when voting.
    - `text` string: Display text for this option.
  - `selectionType` 'single' | 'multiple'
  - `status` 'active' | 'closed': Current poll status.
  - `anonymous` boolean: Whether the poll is anonymous.
  - `createdAt` integer: Creation timestamp in milliseconds.

## Other responses

- `400`: Validation error
- `401`: Unauthorized - invalid or missing API token
- `403`: Bot is not a member of the topic
- `404`: Topic not found
- `500`: Internal server error

---

[API](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api.md) - [All operations](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zenzap/apis/zenzap-external-integration-api/revisions/37faae2c2036?raw)
