> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gurubase.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Record Vote

> Record a vote (upvote or downvote) on a question

Record a user's vote on a specific question. Multiple votes can be submitted for the same question, with each new vote overwriting the previous one. Downvotes can include optional feedback.

<Note>
  **Important:** Feedback (votes) can only be given for normal answers. Simple interactions and clarifications cannot receive votes. Attempting to vote on these question types will return a 400 error. You can check whether a question can receive feedback by checking the `can_receive_feedback` field returned by the [Ask Question](/api-reference/endpoints/ask-question) endpoint.
</Note>

## Path Parameters

<ParamField path="guru_type" type="string" required>
  The type/slug of the Guru
</ParamField>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication. You can obtain your API key from the [Gurubase dashboard](https://app.gurubase.io/api-keys).
</ParamField>

## Body Parameters

<ParamField body="content_slug" type="string" required>
  The slug identifier of the question to vote on
</ParamField>

<ParamField body="binge_id" type="string">
  Optional binge session identifier. Can be None
</ParamField>

<ParamField body="vote_type" type="string" required>
  The type of vote to record. Must be either "upvote" or "downvote"
</ParamField>

<ParamField body="feedback" type="string">
  Optional feedback text for downvotes. Maximum 200 characters
</ParamField>

## Response

<ResponseField name="vote" type="string">
  The recorded vote type ("upvote" or "downvote")
</ResponseField>

<ResponseField name="feedback" type="string">
  The feedback provided with the vote (if any)
</ResponseField>

<ResponseField name="msg" type="string">
  Error message or status message
</ResponseField>

<ResponseExample>
  ```json 200 Success - Vote Recorded theme={null}
  {
      "vote": "upvote",
      "feedback": null
  }
  ```

  ```json 200 Success - Downvote with Feedback theme={null}
  {
      "vote": "downvote",
      "feedback": "This answer was not helpful because..."
  }
  ```

  ```json 400 Invalid Parameters theme={null}
  {
      "msg": "Invalid parameters"
  }
  ```

  ```json 400 Feedback Too Long theme={null}
  {
      "msg": "Feedback must be 200 characters or less"
  }
  ```

  ```json 400 Feedback Not Allowed theme={null}
  {
      "msg": "Feedback can only be given for normal answers"
  }
  ```

  ```json 404 Question Not Found theme={null}
  {
      "msg": "Question not found"
  }
  ```
</ResponseExample>

## Notes

* Multiple votes can be submitted for the same question. Each new vote overwrites the previous vote.
* Feedback (votes) can only be given for normal answers. Simple interactions and clarifications cannot receive votes.
* Feedback is optional but limited to 200 characters
* The `binge_id` parameter can be null, empty string, or "None" and will be treated as null
* Only "upvote" and "downvote" are valid vote types
