---
title: "Change a vote"
method: PUT
path: "/api/v2/votes/{code}"
tags: ["Votes (v2)"]
---

# Change a vote

`PUT /api/v2/votes/{code}`

## Request

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

The same body as create, on the caller's own vote while it may still be edited: an unshared draft, or an
open vote with no ballot yet. Fields left out keep their stored values. An open vote stays open. A closed
vote or one with ballots answers 409.

## Request body

- object
  - `step` 'basic' | 'options' | 'settings' | 'all'
  - `draft` boolean
  - `title` string, nullable: Must not be greater than 255 characters.
  - `typeId` integer, nullable
  - `description` string, nullable: Must not be greater than 2000 characters.
  - `tripExternalId` string, nullable: Must not be greater than 64 characters.
  - `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[]: Must not have more than 21 items.
    - `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
  - `voterRoles` object[]: Must not have more than 40 items.
    - `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: Must be a valid date in the format <code>Y-m-d</code>.
  - `consensusThresholdPercent` integer: Must be at least 0. Must not be greater than 100.

## Response `200`

- object
  - `code` string
  - `state` string
  - `title` string

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `409`: not editable
- `422`: validation_failed: The request body failed validation; field messages are in `errors`.
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`

---

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