---
title: "Name the winner"
method: POST
path: "/api/v2/votes/{code}/winner"
tags: ["Votes (v2)"]
---

# Name the winner

`POST /api/v2/votes/{code}/winner`

## Request

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

After a tie on a closed vote, the organiser picks the winner from the tied options.

## Request body

- object
  - `optionId` integer, required: One of the tied options.

## Response `200`

- object
  - `code` string
  - `state` string
  - `outcome` object
    - `closed` boolean
    - `winner` object
      - `id` integer
      - `title` string
      - `points` integer
    - `tie_broken` boolean

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `409`: not a leader
- `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`: 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)
