---
title: "File the vote under a trip, or move the trip to the winner"
method: POST
path: "/api/v2/votes/{code}/trip"
tags: ["Votes (v2)"]
---

# File the vote under a trip, or move the trip to the winner

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

## Request

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

`tripExternalId` files the organiser's vote under one of their trips (the Share step's "Add to trip" after
a trip choice). `switch: true` instead moves the trip's destination to the winning option of a closed vote
(the results page's "Switch trip to winner").

## Request body

- object
  - `tripExternalId` string, nullable: The trip to file the vote under.
  - `switch` boolean: Move the trip to the winning option instead.

## Response `200`

- object
  - `code` string
  - `trip` object
    - `external_id` string

## Other responses

- `401`: unauthenticated: No valid bearer token was sent.
- `404`
- `409`: no winner to switch to
- `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)
