> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Upvote Comment

> Upvote a comment on behalf of the authenticated user

Upvotes a comment on behalf of the authenticated user. Adds the user's ID to the comment's `upvotes` array. Removes the user from `downvotes` if previously downvoted. Increases the reputation of the comment author and sends a notification.

## Path Parameters

<ParamField path="commentId" type="string" required>
  The ID of the comment to upvote
</ParamField>

## Response

Returns the updated comment with the new upvote.

<ResponseField name="id" type="string">
  Unique comment identifier
</ResponseField>

<ResponseField name="entityId" type="string">
  ID of the entity this comment belongs to
</ResponseField>

<ResponseField name="upvotes" type="array">
  Array of user IDs who upvoted (includes the current user)
</ResponseField>

<ResponseField name="downvotes" type="array">
  Array of user IDs who downvoted
</ResponseField>

<ResponseField name="content" type="string">
  Comment content
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Missing Comment ID - 400 Bad Request">
    ```json theme={null}
    {
      "error": "Missing required data",
      "code": "comment/missing-data"
    }
    ```
  </Accordion>

  <Accordion title="Not Found - 404 Not Found">
    ```json theme={null}
    {
      "error": "Comment not found",
      "code": "comment/not-found"
    }
    ```
  </Accordion>

  <Accordion title="Already Upvoted - 409 Conflict">
    ```json theme={null}
    {
      "error": "User has already upvoted this comment",
      "code": "comment/already-upvoted"
    }
    ```
  </Accordion>

  <Accordion title="Server Error - 500 Internal Server Error">
    ```json theme={null}
    {
      "error": "Internal server error.",
      "code": "comment/server-error",
      "details": "[error message]"
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Notes

* If the user already upvoted the comment, a `409 Conflict` error is returned.
* Reputation is awarded to the comment's author.
* A notification is triggered to inform the comment's author of the upvote.
* The user's ID is removed from `downvotes` if previously present.
