ChatMessage represents a single message in a conversation. Messages support text content, GIF attachments, file attachments, @mentions, emoji reactions, threading (replies to a parent message), and quoting.
Properties
Moderation fields
moderationStatus is returned to everyone. The other three moderation fields are returned only to some requesters, on every message response; everyone else gets null. The requester is the signed-in user, or the user a service key names in actingUserId (the key then gets exactly that user’s view):
Direct and group conversations have no space, so in them only project-role admins and moderators and the message’s sender qualify. A group conversation’s admins don’t qualify through that role.
Real-time events never carry these three fields, whoever receives them: the
message:created payload leaves them out (on the message and on its quotedMessage), and the other message events don’t include them. A message the React SDK adds from message:created has them null; a message it already holds keeps what it had. Moderators fetch the message to read them. See Real-time Features.
Client-only Fields
These fields are never sent by the server. They exist only in the SDK’s local state.Nested Types
GifData
Thegif field uses this shape when a GIF is attached:
All six fields are required when a GIF is attached.
Mention
Each entry in thementions array is one of:
UserMention
SpaceMention
Deleted and removed messages
A message its author deleted, or that a moderator removed, stays in the conversation as a placeholder: it keeps its place in the list, a deleted or removed parent still anchors the thread replies it already has, and a message quoting it still carries it asquotedMessage. Every read returns it this way (list, fetch, the quotedMessage of a message that quotes it, and a conversation’s lastMessage in the conversation list).
On a placeholder,
content, gif and metadata are null, and mentions is [], as is files when the response carries it. Everything else is kept: id, conversationId, parentMessageId, quotedMessageId, threadReplyCount, reactionCounts, timestamps and the moderation fields (shown as Moderation fields describes).
A deleted message keeps its sender, so the conversation can show who deleted it. A removed one hides its sender, so a removal doesn’t publicly mark the person; its author still sees it in full, with its moderationStatus.
Deleting a message clears its content, GIF, mentions and metadata, and deletes its files from storage. Removing one clears nothing, so its author can still read it. Deleting a user turns each of their messages into a deleted message, read back as the same placeholder, and sets their userId to null.
A removed message’s grants summary (with include=grants) is zero for everyone, its author included, as on Fetch Many Reputation Grants.
Neither can be quoted in a new message (400 chat/invalid-quote), take a new thread reply (400 chat/invalid-parent) or take a new reputation grant (404 reputation-grant/target-not-found).
Neither can be edited: Edit Message answers 404 chat/message-not-found, as for a missing message. Neither takes a new reaction either (Toggle Reaction answers the same 404), though anyone can take back their own; both keep their reactionCounts, and Fetch Reaction Users still lists who reacted. To show nothing for them, skip messages with userDeletedAt set or moderationStatus: "removed" when rendering.
Related
- Conversation — the conversation this message belongs to
- ConversationMember — membership records that track read state
- File — file attachments linked to a message
- ReputationGrant — grants that can be attached to a message, and the live
message:grantbroadcast

