> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/slack/create-channel.md).

# Create Channel

Creates a new public or private Slack channel with `conversations.create`, then invites all selected users to it with `conversations.invite`. The users come from the assets the previous node collected.

### Before you begin

* A Slack API token: either a user token (`xoxp-`) with the scopes `channels:write`, `groups:write`, `im:write`, `mpim:write`, `channels:write.invites` and `groups:write.invites`, or a bot token (`xoxb-`) with `channels:manage`, `groups:write`, `im:write`, `mpim:write`, `channels:write.invites` and `groups:write.invites`. Organization-level tokens (`xoxa-`) work only with a Team id. Enter it in **Slack API Token**.
* Asset type: **User** only (`allowed_asset_types` is `user`).
* Required column: `Specifics.slack.id`. Users whose Slack ID is empty are skipped without a message.
* Job defaults: Slack Domain, Slack API Token and the other fields can be saved as defaults for this job in [Action Center Settings](broken://pages/fa25776ab251a33bb2a7e69faf62f677f3b76280).

### Settings

| Setting         | Type     | Required | Default     | Description                                                                                                                             |
| --------------- | -------- | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Slack Domain    | Text     | No       | `slack.com` | The Slack domain the requests are sent to. Requests go to `https://<domain>/api/...`.                                                   |
| Slack API Token | Text     | Yes      | None        | User or bot token with the scopes listed under Before you begin. Not masked after saving.                                               |
| Channel Name    | Text     | Yes      | None        | Name of the new channel. Up to 80 characters, lowercase letters, numbers, hyphens and underscores only. The form rejects anything else. |
| Is private      | Checkbox | No       | Off         | Select to create a private channel. By default the channel is public.                                                                   |
| Team id         | Text     | No       | None        | Slack Team ID. Needed only with an organization-level token (`xoxa-`). The job sends it only when the token starts with `xoxa-`.        |

**Is private** and **Team id** are labels derived from the field names.

### How it works

* Creates the channel first. If Slack refuses, the job fails with `Slack channel creation failed: <code>`.
* Then collects the Slack IDs of the selected users and invites them all in one request with `force` set to true. Users that have no value in `Specifics.slack.id` are filtered out before the job runs.
* If no user has a Slack ID, the job fails with `No Slack user IDs found.` This check runs after the channel was created, so the empty channel stays in Slack.
* If the invite request fails, the job fails with `Slack invite users failed: <code>` and the channel stays too.
* Passes the same assets it received to the next node.

### Example

| Setting         | Value                  |
| --------------- | ---------------------- |
| Slack Domain    | `slack.com`            |
| Slack API Token | `YOUR_SLACK_API_TOKEN` |
| Channel Name    | `incident-response`    |
| Is private      | On                     |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/c53d026b9438b74e5c96c7a59bb6d75211026536">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save default values for this job.</td><td><a href="broken://pages/fa25776ab251a33bb2a7e69faf62f677f3b76280">Broken link</a></td></tr><tr><td><strong>Add Users to Channel</strong></td><td>Add users to an existing channel.</td><td><a href="broken://pages/4b971ea07e372bcb0ceb4ebf7e84410058a4a27d">Broken link</a></td></tr><tr><td><strong>Remove Users from Channel</strong></td><td>Remove users from a channel.</td><td><a href="broken://pages/cbb6ed2756dee6fb420801cb4975a9c5d7207ba6">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.3.0.
{% endhint %}
