Skip to main content
Add Comment Reaction
Adds a reaction of the specified type to a comment. If the user already has a reaction on this comment, it is replaced with the new type. The comment’s reactionCounts map is updated accordingly. Sending the reaction the user already has changes nothing: the response is the same 200 with the comment, counts stay as they are, and no notification is sent. Authentication required.

Path Parameters

string
required
The UUID of the comment to react to.

Body Parameters

string
required
The type of reaction to add. One of: upvote, downvote, like, love, wow, sad, angry, funny.
string
The user the reaction is attributed to. Service or master key only, and required with one — a key has no user of its own, so leaving it out returns 400 comment/missing-user-id. A user token always reacts as itself: naming a different user returns 403 comment/unauthorized.A userId that doesn’t match a user returns 404 comment/user-not-found.

Blocks

When the moderation bundle is installed:
  • If the reacting user blocked the comment’s author, the reaction is allowed — the block is their own choice. The author gets no reaction notification for it; if the reaction completes a milestone, the milestone notification is still sent, with the reacting user left out of its lastThreeUsers.
  • If the comment’s author blocked the reacting user (or both blocked each other), the request returns 404 comment/not-found. These comments are marked isUnavailable in threads.
  • If the author of the comment’s entity blocked the reacting user, the request returns 404 comment/not-found — for every comment on that entity, the reacting user’s own included.
A refused reaction looks exactly like a missing comment and changes nothing.

Deleted and removed comments

A comment its author deleted can’t be reacted to: the request returns 403 comment/deleted and changes nothing. This applies to everyone, including the comment’s author, and covers changing an existing reaction to another type too. Reacting to a moderator-removed comment returns 404 comment/not-found — for everyone, including the removed comment’s author. The 403 is only returned for a comment the reacting user can see. A deleted comment that a block hides from them (see Blocks) returns 404 comment/not-found, like any other. Reactions already on a deleted or removed comment can still be taken off with Remove Comment Reaction.

Response

Returns the updated Comment object with the new reactionCounts map, shaped for the reacting user (with isAuthorBlocked and isUnavailable flags), the same way Fetch Comment returns it.

Error Responses

Returned when commentId isn’t a valid UUID.
Returned when reactionType is missing or isn’t one of the eight types, or when userId isn’t a valid UUID.
Returned when a request authenticated with a user token sends a userId other than that user’s own ID.
Returned when a service or master key sends no userId.
Returned when a service or master key names a userId that doesn’t exist.
Returned when the comment doesn’t exist, when a moderator removed it, or when a block refuses the reaction (see Blocks).
Returned when the comment was deleted by its author (see Deleted and removed comments).