Channel object
Channel
is an object that refers to a single chat room.
Properties
The Channel
object has the following properties:
class Channel {
id: string,
name?: string,
custom?: ObjectCustom,
description?: string,
updated?: string,
status?: string,
type?: ChannelType
}
Parameter | Type | Description |
---|---|---|
id | string | Unique identifier for the channel. Verify the channel ID with our validator. |
name | string or undefined | Display name or title of the channel. |
custom | ObjectCustom or undefined | Any custom properties or metadata associated with the channel in the form of a JSON. Values must be scalar only; arrays or objects are not supported. App Context filtering language doesn’t support filtering by custom properties. |
description | string or undefined | Brief description or summary of the channel's purpose or content. |
updated | string or undefined | Timestamp for the last time the channel was updated or modified. |
status | string or undefined | Current status of the channel, like online , offline , or archived . |
type | ChannelType or undefined | 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
You can call the following methods on the Channel
object.
Click on each method for more details.
connect()
createMessageDraft()
createMessageDraftV2()
delete()
deleteFile()
forwardMessage()
getFiles()
getHistory()
getMessage()
getMessageReportsHistory
getMembers()
getPinnedMessage()
getTyping()
getUserRestrictions()
getUsersRestrictions()
getUserSuggestions()
invite()
inviteMultiple()
isPresent()
join()
leave()
pinMessage()
registerForPush()
sendText()
setRestrictions()
startTyping()
stopTyping()
streamPresence()
streamReadReceipts()
streamMessageReports
streamUpdates()
- (static)
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.