Skip to main content

Channel Management

Once a channel is created and initialized, you can manage its members, permissions, notifications, and lifecycle. The available operations differ depending on the channel type.


Team Channel

Team channels support multiple members with a role-based permission system. Each member has one of the following channel_role values:

RoleDescription
ownerChannel creator. Full control over the channel.
moderModerator. Can manage members and channel settings.
memberRegular member. Can send messages and add others.
pendingInvited but has not yet accepted. Cannot perform actions.

Mute / Unmute Notifications

Any member can mute or unmute channel notifications for themselves.

// Mute for 60 minutes (pass duration in minutes, or null for indefinite)
await channel.muteNotification(60);

// Unmute
await channel.unMuteNotification();

Add Members

All roles except pending can add new members to the channel.

await channel.addMembers(['user_2', 'user_3']);

Remove Members

owner and moder can remove users with the member or pending role from the channel.

// Remove another member (owner/moder only)
await channel.removeMembers(['user_2']);

Any member (including moder) can also use this method to leave the channel themselves by passing their own user ID. A member cannot remove other members — only themselves.

// Leave the channel
await channel.removeMembers(['my_own_user_id']);

Note: If the owner wants to leave, they should use channel.delete() instead — an owner leaving will delete the entire channel.

Ban & Unban

Only owner and moder can ban or unban members in the channel. An owner or moder cannot ban/unban each other — this action only applies to the member role.

// Ban members (prevents sending messages)
await channel.banMembers(['user_bad']);

// Unban members
await channel.unbanMembers(['user_bad']);

Moderators

Only the owner can promote a member to moder, or demote a moder back to member.

// Promote to moderator
await channel.addModerators(['user_2']);

// Demote back to member
await channel.demoteModerators(['user_2']);

Update Channel

Only owner and moder can update channel metadata (name, description, image, etc.).

await channel.update({
name: 'Renamed Channel',
description: 'Updated description',
image: 'https://example.com/new-image.png',
});

Reserved fields (config, cid, created_by, id, type, etc.) are automatically stripped before the request.

Update Capabilities

Only owner and moder can update channel capabilities. The updated capabilities affect the member role only — owner and moder retain full permissions regardless.

The following capabilities can be granted or revoked for members:

CapabilityDescription
create-callStart an audio/video call in the channel.
join-callJoin an ongoing call.
send-messageSend text messages in the channel.
send-linksInclude URLs/links in messages.
update-own-messageEdit their own previously sent messages.
delete-own-messageDelete their own messages.
quote-messageQuote (reply inline to) another message.
send-replySend thread replies to a message.
search-messagesSearch through channel message history.
pin-messagePin or unpin messages in the channel.
send-reactionAdd emoji reactions to messages.
delete-own-reactionRemove their own reactions from messages.
send-typing-eventsBroadcast typing indicators to other members.
upload-fileUpload files, images, and videos as attachments.
create-pollCreate polls in the channel.
vote-pollVote on polls created in the channel.
// Grant only specific capabilities to members
await channel.updateCapabilities([
'send-message',
'send-reaction',
'upload-file',
'send-reply',
]);

// Grant all capabilities
await channel.updateCapabilities([
'create-call', 'join-call', 'send-message', 'send-links',
'update-own-message', 'delete-own-message', 'quote-message',
'send-reply', 'search-messages', 'pin-message', 'send-reaction',
'delete-own-reaction', 'send-typing-events', 'upload-file',
'create-poll', 'vote-poll',
]);

Slow Mode (Message Cooldown)

Only owner and moder can enable slow mode. When enabled, member users must wait for the cooldown period before sending another message, preventing spam.

Value (ms)Duration
0Off
1000010 seconds
3000030 seconds
600001 minute
3000005 minutes
90000015 minutes
36000001 hour
// Enable slow mode with 30-second cooldown
await channel.setSlowMode(30000);

// Disable slow mode
await channel.setSlowMode(0);

Delete Channel

Only the owner can permanently delete the channel.

await channel.delete();

Warning: This action is irreversible. All messages, members, and metadata will be permanently removed.


Messaging Channel

Messaging channels are direct conversations (1-on-1 or group). The available management operations are:

Mute / Unmute Notifications

Any participant can mute or unmute notifications for themselves.

// Mute for 60 minutes (pass duration in minutes, or null for indefinite)
await channel.muteNotification(60);

// Unmute
await channel.unMuteNotification();

Block / Unblock User

Block or unblock the other user in a direct messaging channel.

await channel.blockUser();
await channel.unblockUser();

Accept / Reject / Skip Invite

When invited to a direct messaging channel, the invited user initially has a pending role. They must respond to the invite before they can send messages.

  • Accept: Joins the channel as a full member.
  • Reject: Declines the invitation and closes the channel for the user.
  • Skip: Silently ignores the invitation, allowing the user to bypass the channel without formally rejecting it (useful for clearing pending queues).
// Accept the invitation
await channel.acceptInvite();

// Reject the invitation
await channel.rejectInvite();

// Skip the invitation
await channel.skipInvite();

Truncate Channel

Remove all messages from the channel while keeping the channel itself intact.

await channel.truncate();