---
title: "Set a voter's weight"
method: PATCH
path: "/api/v2/votes/{code}/ballots/{choiceId}/weight"
tags: ["Votes (v2)"]
---

# Set a voter's weight

`PATCH /api/v2/votes/{code}/ballots/{choiceId}/weight`

## Request

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

The organiser's weight switch on a weighted vote without roles: every ballot of that voter counts 2, or
back to 1 (`weight` sets it outright; left out, it toggles). `choiceId` is the voter's `id` under `voters`.

## Request body

- object
  - `weight` integer, nullable: 1 or 2; left out to toggle.

## Response `200`

- object
  - `code` string
  - `voters` object[]
    - `id` integer
    - `voter_name` string
    - `vote_weight` integer

## Other responses

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