> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Connect Slack to your AI agents as a user or as a bot
URL: https://metorial.com/docs/platform/integrations/slack

Publish Slack in a Metorial portal, choose whether agents act as each employee or as a bot, bring your own Slack app, pick scopes and block write tools.

---

To connect Slack, an admin shares the Slack integration in a portal and picks one of two OAuth methods. With the user method, each employee signs in and the agent posts, reads and searches as that person. With the bot method, the agent acts as your Slack app's bot user. You can run both through your own Slack app and block write tools to keep the connection read-only.

**What you'll learn**

* The difference between the user and bot methods
* How an admin publishes Slack and how an employee connects
* How to use your own Slack app, choose scopes and block write tools

**Before you start**

* A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
* A Slack workspace where people may install or authorize apps
* To use your own Slack app: permission to create an app for that workspace

## Sign-in methods

| Method                 | Type  | The agent acts as                                                                                |
| ---------------------- | ----- | ------------------------------------------------------------------------------------------------ |
| **Slack OAuth (User)** | OAuth | The employee who signed in. Messages come from them, and they see only the channels they are in. |
| **Slack OAuth (Bot)**  | OAuth | Your app's bot user. It sees the channels it was added to.                                       |
| **User Token**         | Token | A user, with a token that starts with `xoxp-`.                                                   |
| **Bot Token**          | Token | A bot, with a token that starts with `xoxb-`.                                                    |

For per-person access, choose **Slack OAuth (User)**. Message search needs it too, because the integration requests `search:read` only with the user method.

## Admin: publish Slack in a portal

### In the dashboard

#### 1. Open Shared Resources

Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

#### 2. Share a new integration

Select **Share a Resource**, then **New Integration**, and choose Slack. Under **Auth Method**, select **Slack OAuth (User)**. For how members connect, choose **Each person connects**.

To give everyone one shared bot instead, choose **Shared connection** and connect it once yourself with **Slack OAuth (Bot)**.

#### 3. Choose who gets it

Add the access groups that should see Slack.

### With the CLI

The CLI cannot create the per-user integration. Once it exists, list who has it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search slack
```

## Employee: connect your Slack account

### In the portal

#### 1. Open Slack in the catalog

Sign in to your portal and open Slack.

#### 2. Authenticate

Under **Quick setup**, select **Authenticate**. A Slack tab opens. Pick the workspace, review the permissions and allow them.

#### 3. Confirm

The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect**.

### With the CLI

```bash
metorial catalog search slack
metorial catalog get <catalog-item-id>
metorial setup <catalog-item-id> --auth-method <auth-method-id>
```

`metorial setup` uses an OAuth method by default. Pass `--auth-method` with the ID from `catalog get` to be sure you get the user method.

## Scopes

The user method can request these user scopes:

`chat:write`, `channels:read`, `channels:write`, `channels:history`, `groups:read`, `groups:history`, `groups:write`, `im:read`, `im:history`, `im:write`, `mpim:read`, `mpim:history`, `mpim:write`, `users:read`, `users:read.email`, `users.profile:read`, `users.profile:write`, `files:read`, `files:write`, `reactions:read`, `reactions:write`, `pins:read`, `pins:write`, `bookmarks:read`, `bookmarks:write`, `usergroups:read`, `usergroups:write`, `reminders:read`, `reminders:write`, `team:read`, `search:read`

The bot method uses the matching bot scopes, plus `chat:write.public`, `channels:manage`, `channels:join`, `commands` and `incoming-webhook`. It has no search, reminder or profile-write scopes.

You narrow the list in the **Scopes** picker when you create your own auth credentials. For a connection that only reads, keep the `:read` and `:history` scopes and reject the rest. Slack adds scopes on each new authorization and does not downgrade an existing token, so narrowing the list later does not shrink the access of people who already connected.

## Use your own Slack app

### 1. Start the credentials in Metorial

In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose Slack and copy the **Redirect URI**.

### 2. Create the app in Slack

On Slack's apps page, click **Create New App**, name it and select your workspace. Open **OAuth & Permissions** and scroll to **Scopes**. Add the scopes you want to request. Bot scopes go under **Bot Token Scopes** with **Add an OAuth Scope**. User scopes are added on the same page for the user token. Add the redirect URI from Metorial as a redirect URL for the app. Slack's steps are in [Creating an app from app settings](https://docs.slack.dev/app-management/quickstart-app-settings) and [Installing with OAuth](https://docs.slack.dev/authentication/installing-with-oauth).

### 3. Finish in Metorial

Copy the app's client ID and client secret from its settings in Slack. In Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, select the same scopes under **Scopes**, and select **Create**.

The scopes you select in Metorial must also be added to the app in Slack. A scope that is missing on the Slack side is not granted.

## Make the connection read-only

Open the integration's **Tool Filters** and set the write and destructive tool groups to **Reject**. Read tools such as `list_conversations`, `get_conversation_history` and `search_messages` stay available. Tools such as `send_message` and `manage_channel` are no longer offered to any agent. See [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list slack
metorial tools <integration-id>
metorial call <integration-id> get_team_info
```

`get_team_info` takes no input and returns the workspace you connected. It needs the `team:read` scope.

## Next steps

* [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials)
* [Per-user OAuth](https://metorial.com/docs/platform/guides/per-user-oauth)
* [Connect an app from the terminal](https://metorial.com/docs/platform/cli/connect-an-app)
* [Review connection logs](https://metorial.com/docs/platform/integrations/review-connection-logs)