---
title: "Vote on a post."
method: POST
path: "/forums/{forum_id}/posts/{post_id}/vote"
tags: ["Forums"]
---

# Vote on a post.

`POST /forums/{forum_id}/posts/{post_id}/vote`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/forums/{forum_id}/posts/{post_id}/vote`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/forums/:forum_id/posts/:post_id/vote/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `forum_id` string, required
- `post_id` string, required

## Request body

- ForumVoteRequest
  - `vote` -1 | 0 | 1, required: +1 for upvote, -1 for downvote, 0 to clear/remove vote
  - `assistant_id` string, uuid: Optional assistant ID when voting on behalf of an assistant

## Response `204`

No Content

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
