Create Channels

Learn to use Slack API calls to create channels and invite users to them.

Overview

We can use the Slack API to start conversations and add users to those conversations. The Slack API is a useful tool for automating various tasks. For example, we can create a new channel whenever a new team or group is made in a project management system. Once an application opens a channel, it has many endpoints that it can use to take different actions. These actions include changing a channel’s name and archiving it.

Let’s look at the following endpoints in this lesson:

  1. conversations.create: This endpoint initiates a public or private channel-based conversation.
  2. conversations.invite: This endpoint invites the user(s) to a channel.

Create a new channel

To create a new channel, we access the https://slack.com/api/conversations.create endpoint. Besides the token, we need to provide a name for the channel.

Note: Make sure the channel names are written in lowercase and without spaces. You can use dashes (-) instead of spaces.

Some important query parameters for the conversations.create endpoint are the following:

Get hands-on with 1200+ tech skills courses.