---
title: "Create a vote"
method: POST
path: "/api/v2/votes"
tags: ["Votes (v2)"]
---

# Create a vote

`POST /api/v2/votes`

## Request

- Base URL: `https://www.endlesstravelplans.com`
- URL: `https://www.endlesstravelplans.com/api/v2/votes`
- Auth: HTTP bearer

Runs all three steps' rules, then opens the vote (the Share step) and answers its document with the share
link; `draft: true` keeps it as an unshared draft instead (the Settings step's autosave). The vote is filed
under the caller's trip as the Share step settles it: `tripExternalId` names one the caller may build on,
else the place and dates typed match one, else a new trip is made. A free account at its trip limit with
nothing matching gets the vote without a trip and `needs_trip_choice` with the candidates; `POST
/votes/{code}/trip` files it afterwards.

## Request body

- object
  - `step` 'basic' | 'options' | 'settings' | 'all'
  - `draft` boolean: Keep an unshared draft instead of opening.
  - `title` string, nullable, required: The question.
  - `typeId` integer, nullable, required: The vote type id.
  - `description` string, nullable: Must not be greater than 2000 characters.
  - `tripExternalId` string, nullable: The trip to file the vote under.
  - `tripDestination` string, nullable: Must not be greater than 255 characters.
  - `departureDate` string, nullable: Must be a valid date in the format <code>Y-m-d</code>.
  - `returnDate` string, nullable: Must be a valid date in the format <code>Y-m-d</code>.
  - `options` object[], required: The choices.
    - `title` string, nullable: Must not be greater than 255 characters.
    - `description` string, nullable: Must not be greater than 1000 characters.
    - `tags` string[]: Must not be greater than 50 characters.
  - `activePreset` integer, nullable
  - `anonymous` boolean
  - `allowMultipleOptions` boolean
  - `rankedChoiceVoting` boolean
  - `showLiveResults` boolean
  - `weightedVotingEnabled` boolean: Parents count double.
  - `voterRoles` object[]: The household (name and role parent or kid) on a weighted vote.
    - `name` string, nullable: Must not be greater than 255 characters.
    - `role` string, nullable: Must not be greater than 50 characters.
  - `gamification` boolean
  - `nameRequired` boolean
  - `votingDeadline` string, nullable: The last day ballots are taken (Y-m-d).
  - `consensusThresholdPercent` integer: Must be at least 0. Must not be greater than 100.

## Response `201`

- object
  - `code` string
  - `state` string
  - `title` string
  - `options` object[]
    - `id` integer
    - `title` string
    - `votes` integer
  - `share_url` string
  - `events` object[]
    - `name` string
    - `properties` object
      - `tool` string

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `422`
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`: server_error: Unhandled failure; quote `request_id` to support.

---

[API](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api.md) · [All operations](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/llms.txt) · [OpenAPI document](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/revisions/ae82ed3e4a8f?raw)
