> ## Documentation Index
> Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

Deploy your agent to Slack workspaces using your own Slack app.

### Prerequisites

* A Slack workspace with admin access

* A [Slack app](https://api.slack.com/apps) that is created in your workspace

* Slack API credentials:
  * Client ID
  * Client Secret
  * Signing Secret
  * Bot User OAuth Token for each team or workspace
  * Slack Team ID (starts with the letter 'T')

    * Locate your team ID in the URL of the `Workflow Steps` tab in your Slack app settings

    <img src="https://mintcdn.com/ibm-2e3153bf/DhB0a-ThtdAQzfOZ/assets/channels/slack_team_id.png?fit=max&auto=format&n=DhB0a-ThtdAQzfOZ&q=85&s=198f099e98e4bbceb9878dc7698ef099" alt="Slack Team ID" width="1280" height="721" data-path="assets/channels/slack_team_id.png" />

* Slack Bot Token Scopes:
  * app\_mentions:read
  * chat:write
  * im:history
  * im:write
  * users.profile:read

* Subscribed to following Bot Events:
  * message.im
  * app\_mention

### Create a Slack channel

**Using YAML:**

```yaml YAML theme={null}
name: "Slack Support Bot"
description: "Support agent in Slack"
channel: "byo_slack"
spec_version: "v1"
kind: "channel"
client_id: "1234567890.1234567890"
client_secret: "your_client_secret_here"
signing_secret: "your_signing_secret_here"
teams:
  - id: "T01234567"
    bot_access_token: "xoxb-your-bot-token-here"
```

**Using Python:**

```python Python theme={null}
from ibm_watsonx_orchestrate.agent_builder.channels import SlackChannel, SlackTeam

slack = SlackChannel(
    name="Slack Support Bot",
    description="Support agent in Slack",
    client_id="1234567890.1234567890",
    client_secret="your_client_secret_here",
    signing_secret="your_signing_secret_here",
    teams=[
        SlackTeam(
            id="T01234567",
            bot_access_token="xoxb-your-bot-token-here"
        )
    ]
)
```

### Configuration requirements

| Field                      | Required | Format                     | Description                |
| -------------------------- | -------- | -------------------------- | -------------------------- |
| `client_id`                | Yes      | String                     | Slack API client ID        |
| `client_secret`            | Yes      | String                     | Slack API client secret    |
| `signing_secret`           | Yes      | String                     | Slack API signing secret   |
| `teams`                    | Yes      | Array of SlackTeam objects | Slack teams or workspaces  |
| `teams[].id`               | Yes      | String                     | Slack team or workspace ID |
| `teams[].bot_access_token` | Yes      | String                     | Bot user OAuth token       |
