---
title: "Upsert vote"
method: PUT
path: "/ai/votes"
tags: ["AI - Votes"]
---

# Upsert vote

`PUT /ai/votes`

Create or update a vote

## Request body

- object — Request body schema.
  - `chatUuid` string, uuid, required — Chat identifier.
  - `messageUuid` string, uuid, required — Message identifier.
  - `isUpvoted` boolean, required — Whether the message is upvoted.

## Response `200`

Successful response

- object
  - `vote` object, required — Vote details.
    - `workspaceUuid` string, required
    - `userUuid` string, required
    - `chatUuid` string, required
    - `messageUuid` string, required
    - `isUpvoted` boolean, required
    - `updatedAt` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/revisions/1d5a19e01d83/schema)
