---
title: "Open a poll"
method: POST
path: "/groups/{groupId}/polls"
tags: ["Group features"]
---

# Open a poll

`POST /groups/{groupId}/polls`

## Request

- Base URL: `https://whatareyoudo.ing/api/v1`
- URL: `https://whatareyoudo.ing/api/v1/groups/{groupId}/polls`
- Auth: HTTP bearer

## Path parameters

- `groupId` string, uuid, required

## Request body

- CreateGroupPollRequest
  - `questions` object[], required
    - `prompt` string, required
    - `options` string[], required
  - `expiresAt` string, date-time
  - `anonymous` boolean

## Response `201`

Created

- object
  - `data` GroupPoll, required
    - `id` string, uuid, required
    - `groupId` string, uuid, required
    - `createdBy` string, uuid, required
    - `creator` DiaryMember, required
      - `id` string, uuid, required
      - `username` string, nullable, required
      - `displayName` string, nullable, required
      - `avatarUrl` string, nullable, required
    - `status` 'open' | 'closed', required
    - `createdAt` string, required
    - `closedAt` string, nullable, required
    - `expiresAt` string, nullable, required
    - `anonymous` boolean, required
    - `questions` GroupPollQuestion[], required
      - `id` string, uuid, required
      - `prompt` string, required
      - `options` GroupPollOption[], required
        - `id` string, uuid, required
        - `label` string, required
        - `voteCount` integer, required
        - `voters` DiaryMember[]
          - `id` string, uuid, required
          - `username` string, nullable, required
          - `displayName` string, nullable, required
          - `avatarUrl` string, nullable, required
      - `totalVotes` integer, required
      - `myOptionId` string, uuid, nullable, required
    - `decisionEntryId` string, uuid, nullable, required
    - `decisionCommitId` string, uuid, nullable, required
  - `meta` object, required
    - `requestId` string, required

## Other responses

- `403`: Not a member of this group
- `422`: expiresAt is already in the past

---

[API](https://skmtc.dev/whatareyoudo/apis/whatcha-api.md) · [All operations](https://skmtc.dev/whatareyoudo/apis/whatcha-api/llms.txt) · [OpenAPI document](https://skmtc.dev/whatareyoudo/apis/whatcha-api/revisions/48dd8a54abea?raw)
