Channels

Prev Next

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 as roomId in requests; most channel endpoints also accept roomName instead.

  • t: The room type — always c for a public channel. Private groups are p, direct messages d.

  • u: The user who created the channel.

  • ro and default: Whether the channel is read-only and whether new users join it automatically.

Common workflows

Set up a channel and start the conversation

  1. Create the channel with a name and optional initial members.

  2. Add users to the channel.

  3. Post a message to the channel using its roomId.

Moderate a channel

  1. Add an owner or moderator to delegate control.

  2. Set the channel read-only or set an announcement to steer the conversation.

  3. Remove a user when needed.

Wind a channel down

  1. Archive the channel to freeze it while keeping its history, or convert it to a team if it has outgrown a single channel.

  2. Delete the channel to remove it permanently.

Conventions

  • Most endpoints accept either roomId or roomName. Using roomId is safer because channel names can change.

  • Creating channels requires the create-c permission; moderation actions require channel roles such as owner or moderator.

  • List endpoints such as Get Channel List support count, offset, sort, and query query parameters.

  • These endpoints manage public channels only. For private channels, use the Groups API.