---
title: "Replace anonymousId and clear boardUserId, retaining the vote"
method: PATCH
path: "/posts/{postId}/votes/{voteId}"
---

# Replace anonymousId and clear boardUserId, retaining the vote

`PATCH /posts/{postId}/votes/{voteId}`

## Request

- Base URL: `https://app.voteship.app/api/v1`
- URL: `https://app.voteship.app/api/v1/posts/{postId}/votes/{voteId}`
- Auth: HTTP bearer

## Path parameters

- `postId` string, required
- `voteId` string, required

## Request body

- object
  - `anonymousId` string, required

## Response `200`

Replace anonymousId and clear boardUserId, retaining the vote

- object
  - `data` Vote
    - `id` string
    - `boardUserId` string, nullable
    - `anonymousId` string, nullable
    - `createdAt` string, date-time
    - `boardUserName` string, nullable
    - `boardUserEmail` string, nullable

## Other responses

- `400`: Validation error
- `401`: Secret API key required
- `404`: Entity not found in this project
- `409`: Anonymous ID already voted on this post

---

[API](https://skmtc.dev/voteship/apis/voteship-api.md) · [All operations](https://skmtc.dev/voteship/apis/voteship-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voteship/apis/voteship-api/revisions/51ab9e650f82?raw)
