Skip to main content
A 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

PropertyTypeDescription
idstringUnique message identifier (UUID).
localIdstring | undefinedLocally-generated UUID echoed by the server. Never stored in the database. Used for optimistic deduplication — matching a temporary local entry to the confirmed server response.
projectIdstringThe project this message belongs to.
conversationIdstringID of the conversation this message is in.
userIdstring | nullID of the user who sent the message. null if the sender’s account has since been deleted.
userUser | nullThe sender’s user profile. null when userId is null (account deleted).
contentstring | nullText content of the message. null for GIF-only or file-only messages.
gifGifData | nullGIF attachment data. null if no GIF was attached.
mentionsMention[]Array of @mentions embedded in the message.
filesFile[] | undefinedFile attachments. Only populated when the hook is called with includeFiles: true. Omitted by default to keep payloads small.
metadataRecord<string, any>Custom key-value data. Limited to 10 KB.
parentMessageIdstring | nullID of the parent message if this is a thread reply. Thread replies are excluded from the main conversation stream.
parentMessageChatMessage | null | undefinedThe parent message for thread replies.
quotedMessageIdstring | nullID of a message being quoted. The message remains in the main stream but renders an inline preview of the quoted content.
quotedMessageChatMessage | null | undefinedThe quoted message, populated one level deep.
threadReplyCountnumberNumber of replies in this message’s thread. Incremented on reply creation; never decremented.
reactionCountsRecord<string, number>Emoji reaction counts, keyed by emoji. Computed server-side (e.g. { "👍": 3, "❤️": 1 }).
userReactionsstring[]Emojis the requesting user has reacted with on this message.
editedAtDate | nullTimestamp when the message was last edited. null if never edited.
userDeletedAtDate | nullTimestamp when the sender deleted the message. Deleted messages are soft-deleted — the row is kept as a [Message deleted] placeholder with content cleared.
moderationStatus"approved" | "removed" | nullModeration status. "removed" messages are excluded from default queries.
moderatedAtDate | nullTimestamp when moderation action was taken.
moderatedByIdstring | nullID of the moderator (user or client).
moderatedByType"client" | "user" | nullWhether the moderator was a client (dashboard/API key) or a user.
moderationReasonstring | nullOptional reason recorded with the moderation action.
createdAtDateTimestamp when the message was sent.
updatedAtDateTimestamp of the last update to this record.

Client-only Fields

These fields are never sent by the server. They exist only in the SDK’s local state.
PropertyTypeDescription
sendFailedboolean | undefinedSet to true by the SDK when a send request fails. Used to render a failed-send indicator on the optimistic message entry.

Nested Types

GifData

The gif field uses this shape when a GIF is attached:
PropertyTypeDescription
idstringGIF provider ID.
urlstringLanding page URL for the GIF.
gifUrlstringDirect URL to the animated GIF.
gifPreviewUrlstringURL to a static preview image.
altTextstring | undefinedAccessibility description.
aspectRationumberWidth / height ratio for layout purposes.

Mention

Each entry in the mentions array is one of: UserMention
PropertyTypeDescription
type"user"Discriminant.
idstringReplyke user ID.
foreignIdstring | null | undefinedYour app’s user ID, if set.
usernamestringThe @username at time of mention.
SpaceMention
PropertyTypeDescription
type"space"Discriminant.
idstringSpace ID.
slugstringThe space’s slug at time of mention.

Soft Deletion

When a user deletes their own message, the row is retained as a placeholder. userDeletedAt is set and the content, GIF, mentions, and metadata are cleared by the server. This preserves thread structure — a deleted parent message still anchors its thread replies.
Moderator-removed messages (moderationStatus: "removed") are excluded from all default API responses. They are not returned to clients.