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 |
InteractiveMessage
InteractiveMessage extends BaseMessage and represents a message with interactive UI elements such as forms, cards, or buttons.
It inherits all properties from BaseMessage and adds the following.
Properties
| Property | Getter | Return Type | Description |
|---|---|---|---|
| interactiveData | getInteractiveData() | Object | The interactive element data (form fields, buttons, etc.) |
| interactionGoal | getInteractionGoal() | InteractionGoal | The goal that defines when the interaction is considered complete |
| interactions | getInteractions() | Interaction[] | Array of interactions that have occurred on this message |
| allowSenderInteraction | getIsSenderInteractionAllowed() | boolean | Whether the sender is allowed to interact with the 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 |