Skip to main content
Toggle Message Reaction
Toggles an emoji reaction on a message. If the current user has not yet reacted with this emoji, the reaction is added. If they already have, it is removed. The caller must be an active member. A deleted or removed message takes no new reaction, from anyone: adding one answers 404 chat/message-not-found, as editing it does. Taking back your own reaction still works. Its existing reactions stay, in its reactionCounts and in Fetch Reaction Users. In a space chat, the caller must also be an active member of the chat’s space and able to see it (visibility). Anyone else, including a pending, rejected or banned member and someone who left or was removed from the space, gets 403 chat/not-a-member, as a non-member does, even while they still hold a conversation membership. Deleting their own messages, leaving the conversation and muting it stay allowed: they need the conversation membership and sight of the space, not an active space membership. Reacting is refused while the caller is banned. Banned in the space itself: 403 chat/not-a-member (a ban ends the space membership and the chat membership). An active member of the space who is banned in a space above it: 403 chat/banned. In a direct conversation where one of the two users has blocked the other, reacting answers 403 chat/conversation-read-only. The conversation stays readable. The emoji must be exactly one grapheme cluster (a single visible character, including multi-codepoint emoji like 👨‍👩‍👧).

Path Parameters

string
required
The ID of the conversation.
string
required
The ID of the message to react to.

Body Parameters

string
required
The emoji to toggle. Must be exactly one grapheme cluster.
string
Service key only, and required with one: the user this request acts as. The member whose reaction is toggled; must be an active member. A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Response

Record<string, number>
Updated emoji reaction counts for this message (e.g. { "👍": 3, "❤️": 1 }).
string[]
The current user’s full set of reactions on this message after the toggle.
number
1 if a reaction was added, -1 if removed.

Error Responses

A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
A service key sent no actingUserId.
Also returned in a space chat to anyone who isn’t an active member of its space or can’t see it, including someone banned in the space itself.
A direct conversation between two users where one has blocked the other. It stays readable, but takes no reactions. The response doesn’t say why.
The caller is an active member of the chat’s space but is banned in a space above it. Banned in the space itself answers 403 chat/not-a-member instead.
No message has this ID in the conversation, or the message was deleted or removed and you haven’t reacted to it with this emoji (only taking a reaction back works there).