Add a reaction
POST
/chat-rooms/:roomId/messages/:messageId/reactionsAdd an emoji reaction to a message. One user can add several different emojis. Sending the same emoji twice does not add a duplicate (idempotent). Only emojis from a fixed allow list are accepted.
| Auth | Login required |
|---|
Path parameters
roomIdstringrequiredChat room ID.
messageIdstringrequiredMessage ID.
Request body
emojistringrequiredThe emoji. Anything outside the allow list returns 400.
Response
| Field | Type | Description |
|---|---|---|
messageId | string | The message ID. |
reactions | object[] | Aggregated reactions (emoji / count / userIds). userIds is capped at 100 entries. |
Request
curl https://api.4s.link/chat-rooms/ROOM_ID/messages/MESSAGE_ID/reactions \-X POST \-H "Authorization: Bearer 4s_at_..." \-H "Content-Type: application/json" \-d '{"emoji": "👍"}'
Example response
{"messageId": "m1a2b3c4-...","reactions": [{ "emoji": "👍", "count": 2, "userIds": ["a1b2c3d4-...", "b2c3d4e5-..."] }]}