Channel entity
The Channel object represents a single chat room where users can send and receive messages.
Properties
The Channel interface has the following properties:
1interface Channel {
2 val chat: Chat
3 val id: String
4 val name: String?
5 val custom: Map<String, Any?>?
6 val description: String?
7 val updated: String?
8 val status: String?
9 val type: ChannelType?
10
11 ...
12}
| Parameter | Description |
|---|---|
chatType: Chat | Reference to the main Chat object. |
idType: String | Unique identifier for the channel. Verify the channel ID with our validator. |
nameType: String | Display name or title of the channel. |
customType: Map<String, Any?> | Any custom properties or metadata associated with the channel in the form of a map of key-value pairs. App Context filtering language doesn’t support filtering by custom properties. |
descriptionType: String | Brief description or summary of the channel's purpose or content. |
updatedType: String | Timestamp for the last time the channel was updated or modified. |
statusType: String | Current status of the channel, like online, offline, or archived. |
typeType: ChannelType | One of the available channel types:
|
API limits
To learn about the maximum length of parameters used to set channel metadata, refer to REST API docs.
Methods
The Channel object exposes the following methods.
connect()createMessageDraftdelete()deleteFile()forwardMessage()getFiles()getHistory()getMessage()getMessageReportsHistory()getMembers()getPinnedMessage()getTyping()getUserRestrictions()getUsersRestrictions()invite()inviteMultiple()isPresent()join()leave()pinMessage()registerForPush()sendText()setRestrictions()startTyping()stopTyping()streamPresence()streamReadReceipts()streamMessageReportsstreamUpdates()streamUpdatesOn()update()unpinMessage()unregisterFromPush()whoIsPresent()
Use case
For example, you can use the Channel object methods to:
- Let users send messages.
- Create and manage a 1:1, group, or public channel (chat).
- Invite others to join the channel.
- Configure a typing indicator to track when someone in the room is writing a message.
- Register the channel for mobile push notifications, not to miss a single message.