The Channels API endpoints are used to manage public channels.
Create and manage the status of public channels—archive, unarchive, encrypt, set announcements, and more.
Add and remove members in public channels.
Update members’ roles in public channels.
View information such as members, integrations, messages, and files.
Refer to the Channels user guide for details.
The channel object
Channel endpoints return a channel object. A trimmed example from Get Channel Information:
{
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "testing",
"t": "c",
"msgs": 0,
"usersCount": 2,
"u": { "_id": "HKKPmF8rZh45GMHWH", "username": "marcos.defendi" },
"broadcast": false,
"encrypted": false,
"ro": false,
"default": false,
"ts": "2020-05-21T13:14:07.070Z"
},
"success": true
}Fields you use most often:
_id: The room ID. Pass it asroomIdin requests; most channel endpoints also acceptroomNameinstead.t: The room type — alwayscfor a public channel. Private groups arep, direct messagesd.u: The user who created the channel.roanddefault: Whether the channel is read-only and whether new users join it automatically.
Common workflows
Set up a channel and start the conversation
Create the channel with a name and optional initial members.
Add users to the channel.
Post a message to the channel using its
roomId.
Moderate a channel
Add an owner or moderator to delegate control.
Set the channel read-only or set an announcement to steer the conversation.
Remove a user when needed.
Wind a channel down
Archive the channel to freeze it while keeping its history, or convert it to a team if it has outgrown a single channel.
Delete the channel to remove it permanently.
Conventions
Most endpoints accept either
roomIdorroomName. UsingroomIdis safer because channel names can change.Creating channels requires the
create-cpermission; moderation actions require channel roles such as owner or moderator.List endpoints such as Get Channel List support
count,offset,sort, andqueryquery parameters.These endpoints manage public channels only. For private channels, use the Groups API.