API EndpointsCommentsRemove Comment Downvote

Remove Downvote from Comment

Endpoint

URL: /:projectId/comments/:commentId/remove-downvote

Method: PATCH

Authentication Required: Yes


Description

Removes a previously added downvote from a comment by the authenticated user.

  • Subtracts the user’s ID from the downvotes array.
  • Increases the reputation of the comment’s author.

Request

Path Parameters

ParameterTypeRequiredDescription
commentIdstringYesThe ID of the comment to un-downvote.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authenticated users.

Response

Success Response (200 OK)

Returns the updated comment:

{
  "id": "comment-123",
  "entityId": "entity-456",
  "upvotes": [],
  "downvotes": [],
  "content": "Appreciate this perspective.",
  ...
}

Error Responses

Missing Comment ID (400 Bad Request)

{
  "error": "Missing required data",
  "code": "comment/missing-data"
}

Not Found (404 Not Found)

{
  "error": "Comment not found",
  "code": "comment/not-found"
}

Not Downvoted (409 Conflict)

{
  "error": "User hasn't downvoted this comment",
  "code": "comment/not-downvoted"
}

Server Error (500 Internal Server Error)

{
  "error": "Internal server error.",
  "code": "comment/server-error",
  "details": "[error message]"
}

Notes

  • The authenticated user must have previously downvoted the comment.
  • A successful request removes the user’s ID from downvotes.
  • The comment author’s reputation is increased.
  • A 409 Conflict is returned if the user hasn’t downvoted the comment.