Message Reactions

Per-user emoji reactions on messages — toggling is create/delete of the caller’s own row; reads flow inline in the message payload.

Service: messages.message_reactions

A reaction is a per-user row on a message: (message_id, user_id, reaction). Because each row belongs to its reacting user, reactions are written through this endpoint — never through the message document. Reads need no scope here: every message payload already carries its reactions inline (message_reaction).

A reaction is immutable — changing it is deleteOneById + create. Toggling off is a delete of the caller’s own row.

All methods use the JSON-RPC 2.0 protocol over WebSocket. See Enbox API for transport details, error codes, query operators, and encryption model.

Fields

Field Type Required Description
id string Primary key. Read-only, auto-generated
message_id string Parent message id. The caller must participate in its chat
user_id string The reacting user. Read-only — always the caller (server-filled on create; no impersonation)
username string Reacting user’s login (server JOIN on accounts_user). Read-only, computed
reaction string Reaction kind — one of heart · thumbsup · thumbsdown · laugh · emphasize · question
created_at string ISO 8601 creation timestamp. Read-only

Filterable: message_id · user_id

create

Add the caller’s reaction to a message. The service verifies the caller participates in the message’s chat; user_id is filled from the auth context.

WebSocket

Request

{
  "jsonrpc": "2.0",
  "method": "messages.message_reactions.create",
  "params": {
    "document": {
      "message_id": "220240326265143296",
      "reaction": "heart"
    }
  },
  "id": 1
}

Response

The created reaction row:

{
  "jsonrpc": "2.0",
  "result": {
    "id": "220240330000000001",
    "message_id": "220240326265143296",
    "user_id": "214782287248621568",
    "username": "bob",
    "reaction": "heart",
    "created_at": "2026-08-31T08:01:44Z"
  },
  "id": 1
}

deleteOneById

Remove the caller’s own reaction row (write scope: user_id == caller). Deleting someone else’s reaction returns NotFound.

WebSocket

Request

{
  "jsonrpc": "2.0",
  "method": "messages.message_reactions.deleteOneById",
  "params": { "id": "220240330000000001" },
  "id": 2
}

Response

The deleted row’s final state.