---
title: "Cast Vote"
method: PUT
path: "/apps/{app_id}/notes/{note_id}/vote"
---

# Cast Vote

`PUT /apps/{app_id}/notes/{note_id}/vote`

## Request

- Base URL: `https://api.xhostd.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xhostd.com/apps/{app_id}/notes/{note_id}/vote`
- Auth: none declared

Set or clear the caller's vote on one internal note.

``value`` is ``-1``, ``0`` or ``+1``. A repeat call with any value
lands on the same one row, so the route is idempotent: the upsert
uses the ``uq_note_votes_note_voter`` constraint, on the
``dialect_insert`` shape of :mod:`xhostd.metrics.resource_rollup`.
``0`` deletes the caller's vote row. The route journals nothing. A
note of another app, and an external note, both read 404.

## Path parameters

- `app_id` string, uuid, required
- `note_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- CastVoteRequest
  - `value` -1 | 0 | 1, required

## Response `200`

Successful Response

- VoteSummary
  - `up` integer, required
  - `down` integer, required
  - `member_count` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xhostd/apis/xhostd-public.md) · [All operations](https://skmtc.dev/xhostd/apis/xhostd-public/llms.txt) · [OpenAPI document](https://skmtc.dev/xhostd/apis/xhostd-public/revisions/bf439c4d1789?raw)
