Class Hierarchy
BaseMessage
BaseMessage is the base class for all message types. Every message object — whether it’s a text message, media message, or custom message — extends this class.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| id | getId() | number | Unique message ID |
| conversationId | getConversationId() | string | ID of the conversation this message belongs to |
| parentMessageId | getParentMessageId() | number | ID of the parent message (for threaded messages) |
| muid | getMuid() | string | Client-generated unique message ID |
| sender | getSender() | User | Sender of the message |
| receiver | getReceiver() | User | Group | Receiver of the message |
| receiverId | getReceiverId() | string | UID/GUID of the receiver |
| type | getType() | string | Message type (e.g., "text", "image", "file", "custom") |
| receiverType | getReceiverType() | string | Receiver type ("user" or "group") |
| category | getCategory() | MessageCategory | Message category (e.g., "message", "action", "call", "custom") |
| sentAt | getSentAt() | number | Timestamp when the message was sent (epoch seconds) |
| deliveredAt | getDeliveredAt() | number | Timestamp when the message was delivered |
| readAt | getReadAt() | number | Timestamp when the message was read |
| deliveredToMeAt | getDeliveredToMeAt() | number | Timestamp when the message was delivered to the logged-in user |
| readByMeAt | getReadByMeAt() | number | Timestamp when the message was read by the logged-in user |
| editedAt | getEditedAt() | number | Timestamp when the message was edited |
| editedBy | getEditedBy() | string | UID of the user who edited the message |
| deletedAt | getDeletedAt() | number | Timestamp when the message was deleted |
| deletedBy | getDeletedBy() | string | UID of the user who deleted the message |
| replyCount | getReplyCount() | number | Number of replies to this message |
| unreadRepliesCount | getUnreadRepliesCount() | number | Number of unread replies |
| data | getData() | Object | Raw data payload of the message |
| metadata | getMetadata() | Object | Custom metadata attached to the message |
| rawMessage | getRawMessage() | Object | Raw JSON of the message as received from the server |
Conditional Properties
These properties may or may not be populated depending on the method or request configuration used to fetch the message.| Property | Getter | Return Type | Description |
|---|---|---|---|
| reactions | getReactions() | ReactionCount[] | Array of reaction counts on the message |
| mentionedUsers | getMentionedUsers() | User[] | Array of users mentioned in the message |
| hasMentionedMe | hasMentionedMe() | boolean | Whether the logged-in user was mentioned in the message |
| quotedMessageId | getQuotedMessageId() | number | ID of the quoted message (if this is a reply) |
| quotedMessage | getQuotedMessage() | BaseMessage | The quoted message object (if this is a reply) |
TextMessage
TextMessage extends BaseMessage and represents a text-based chat message.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| text | getText() | string | The text content of the message |
| metadata | getMetadata() | Object | Custom metadata attached to the message (includes extension data like data masking, link preview, etc.) |
| data | getData() | Object | Raw data payload including text, resource, metadata, moderation, and entities |
| moderationStatus | getModerationStatus() | ModerationStatus | Moderation status of the message. Returns "unmoderated" if not moderated. |
Conditional Properties
These properties may or may not be populated depending on the method or request configuration used to fetch the message.| Property | Getter | Return Type | Description |
|---|---|---|---|
| tags | getTags() | string[] | Tags associated with the message |
MediaMessage
MediaMessage extends BaseMessage and represents a message with media attachments such as images, videos, audio files, or documents.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| caption | getCaption() | string | Caption text for the media message |
| attachment | getAttachment() | Attachment | The primary attachment of the media message |
| attachments | getAttachments() | Attachment[] | All attachments of the media message |
| url | getURL() | string | URL of the media file |
| metadata | getMetadata() | Object | Custom metadata attached to the message |
| data | getData() | Object | Raw data payload of the message |
| moderationStatus | getModerationStatus() | ModerationStatus | Moderation status of the message. Returns "unmoderated" if not moderated. |
Conditional Properties
These properties may or may not be populated depending on the method or request configuration used to fetch the message.| Property | Getter | Return Type | Description |
|---|---|---|---|
| tags | getTags() | string[] | Tags associated with the message |
CustomMessage
CustomMessage extends BaseMessage and represents a developer-defined message with a custom data payload.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| customData | getCustomData() | Object | The custom data payload set by the developer |
| subType | getSubType() | string | Sub type of the custom message |
| conversationText | getConversationText() | string | Preview text displayed in the conversation list |
| updateConversation | willUpdateConversation() | boolean | Whether this message updates the conversation’s last message |
| sendNotification | willSendNotification() | boolean | Whether a push notification is sent for this message |
| metadata | getMetadata() | Object | Custom metadata attached to the message |
| data | getData() | Object | Raw data payload of the message |
Conditional Properties
These properties may or may not be populated depending on the method or request configuration used to fetch the message.| Property | Getter | Return Type | Description |
|---|---|---|---|
| tags | getTags() | string[] | Tags associated with the message |
Action
Action extends BaseMessage and represents a system-generated action message such as a member joining, leaving, or being banned from a group.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| action | getAction() | string | The action being performed (e.g., "joined", "left", "kicked", "banned") |
| message | getMessage() | string | The default human-readable action message |
| actionBy | getActionBy() | User | Group | BaseMessage | The entity that performed the action |
| actionOn | getActionOn() | User | Group | BaseMessage | The entity on which the action was performed |
| actionFor | getActionFor() | User | Group | BaseMessage | The entity for whom the action was performed |
| oldScope | getOldScope() | string | Previous scope of the member (for scope change actions) |
| newScope | getNewScope() | string | New scope of the member (for scope change actions) |
| rawData | getRawData() | Object | Raw JSON data of the action message |
| metadata | getMetadata() | Object | Custom metadata attached to the action message |
Call
Call extends BaseMessage and represents a voice or video call message.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| sessionId | getSessionId() | string | Unique session ID of the call |
| callInitiator | getCallInitiator() | User | The user who initiated the call |
| callReceiver | getCallReceiver() | User | Group | The user or group receiving the call |
| action | getAction() | string | The call action (e.g., "initiated", "ongoing", "ended", "cancelled", "rejected") |
| initiatedAt | getInitiatedAt() | number | Timestamp when the call was initiated |
| joinedAt | getJoinedAt() | number | Timestamp when the call was joined |
| rawData | getRawData() | Object | Raw JSON data of the call message |
| metadata | getMetadata() | Object | Custom metadata attached to the call message |
AIAssistantMessage
AIAssistantMessage extends BaseMessage and represents the full assistant reply persisted after an AI Agent run completes. It is received via the onAIAssistantMessageReceived callback of the MessageListener.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| assistantMessageData | getAssistantMessageData() | AIAssistantMessageData | The assistant message data containing runId, threadId, and text |
AIAssistantMessageData
| Property | Getter | Return Type | Description |
|---|---|---|---|
| runId | getRunId() | string | The run ID of the agent execution |
| threadId | getThreadId() | string | The thread ID of the conversation |
| text | getText() | string | The full text of the assistant’s reply |
AIToolResultMessage
AIToolResultMessage extends BaseMessage and represents the output of a tool call made during an AI Agent run. It is received via the onAIToolResultReceived callback of the MessageListener.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| toolResultMessageData | getToolResultMessageData() | AIToolResultMessageData | The tool result data containing runId, threadId, text, and toolCallId |
AIToolResultMessageData
| Property | Getter | Return Type | Description |
|---|---|---|---|
| runId | getRunId() | string | The run ID of the agent execution |
| threadId | getThreadId() | string | The thread ID of the conversation |
| text | getText() | string | The text output of the tool |
| toolCallId | getToolCallId() | string | The ID of the tool call this result belongs to |
AIToolArgumentMessage
AIToolArgumentMessage extends BaseMessage and represents the arguments passed to a tool during an AI Agent run. It is received via the onAIToolArgumentsReceived callback of the MessageListener.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| toolArgumentMessageData | getToolArgumentMessageData() | AIToolArgumentMessageData | The tool argument data containing runId, threadId, and toolCalls |
AIToolArgumentMessageData
| Property | Getter | Return Type | Description |
|---|---|---|---|
| runId | getRunId() | string | The run ID of the agent execution |
| threadId | getThreadId() | string | The thread ID of the conversation |
| toolCalls | getToolCalls() | AIToolCall[] | Array of tool calls with their arguments |
AIToolCall
| Property | Getter | Return Type | Description |
|---|---|---|---|
| id | getId() | string | Unique tool call ID |
| type | getType() | string | Type of the tool call |
| displayName | getDisplayName() | string | Display name of the tool |
| executionText | getExecutionText() | string | Execution text for the tool |
| function | getFunction() | AIToolCallFunction | The function details (name and arguments) |
AIToolCallFunction
| Property | Getter | Return Type | Description |
|---|---|---|---|
| name | getName() | string | Name of the function being called |
| arguments | getArguments() | string | JSON string of the arguments passed to the function |
AIAssistantBaseEvent
AIAssistantBaseEvent is the base class for all real-time streaming events from an AI Agent run. It is received via the onAIAssistantEventReceived callback of the AIAssistantListener.
The type field identifies the specific event (e.g., "run_started", "tool_call_started", "text_message_content", "run_finished").
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| type | getType() | string | The event type identifier |
| conversationId | getConversationId() | string | The conversation ID associated with the event |
| messageId | getMessageId() | string | The message ID associated with the event |
| parentMessageId | getParentMessageId() | string | The parent message ID (if in a thread) |
| data | getData() | object | Additional event-specific data |
| data.timestamp | getTimestamp() | number | Timestamp of the event |
| data.runId | getRunId() | string | The run ID of the agent execution |
| data.threadId | getThreadId() | string | The thread ID of the conversation |