> For the complete documentation index, see [llms.txt](https://aibotkit.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aibotkit.gitbook.io/documentation/channels-and-integrations/slack.md).

# Slack

Bring your AI Bot Kit chatbot into Slack. Invite the bot to any channel, and your team can ask it questions trained on your knowledge base — same answers as the website widget.

## What you need

* Workspace admin access in Slack (or permission to install apps)
* A Slack **bot token** (`xoxb-...`) and the **signing secret** for the app
* A paid plan (Basic, Essential, or Business)

## Create the Slack app

1. Go to [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → **From scratch**.
2. Name the app (e.g., "AI BotKit Assistant") and pick your workspace.
3. Under **OAuth & Permissions**, add these bot scopes:
   * `chat:write`
   * `channels:history`
   * `im:history`
   * `groups:history`
4. Install the app to the workspace and copy the **Bot User OAuth Token** (`xoxb-...`).
5. Under **Basic Information** → **App Credentials**, copy the **Signing Secret**.
6. Under **Event Subscriptions**, set the request URL to `https://app.aibotkit.io/api/slack/callback` and subscribe to:
   * `app_mention`
   * `message.channels`
   * `message.im`

## Connect to AI Bot Kit

1. Open your chatbot → **INTEGRATIONS** → **Slack**.
2. Paste the **Bot Token** and **Signing Secret**.
3. Click **Connect Slack**.
4. After connecting, you'll see exact steps to configure Event Subscriptions in Slack and activate the bot.
5. Invite the bot to a channel: `/invite @your-bot-name`.
6. Mention it: `@your-bot-name what's our refund policy?` — the chatbot replies in-thread.

When connected, you'll see:

* **Feature bullets:**
  * **Secure webhooks** -- HMAC-verified event delivery
  * **Instant replies** -- Your bot responds in real time
  * **Any Slack workspace** -- Works in any workspace you have access to

## What happens behind the scenes

* Slack POSTs every event to `/api/slack/callback`. The handler verifies the HMAC-SHA256 request signature using your Signing Secret.
* The session ID is `slack_<user-id>` — each user gets their own conversation thread.
* Replies post back as the bot user via `chat.postMessage`.
* The bot only responds to direct mentions and DMs by default — it won't interject in unrelated chatter.

## Tips

* **Don't paste tokens in plain text in Slack** while setting up. Tokens are encrypted in our database, but anyone reading your Slack channel could grab them.
* **Use a private app.** Don't list the app in the public Slack App Directory unless you intend to share the bot with other workspaces.
* **One token per chatbot.** Reusing the same bot token across chatbots will be detected and blocked unless you confirm a transfer.

## Frequently Asked

**Can the bot DM users proactively?**\
Not currently — it only replies to incoming messages.

**Does it support slash commands?**\
Not yet. Slash commands are on the roadmap; for now, mention the bot with `@bot question…`.

**Can I disconnect?**\
Yes — clearing credentials in the Integrations card stops delivery. Uninstall the Slack app on Slack's side too if you want a clean removal.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://aibotkit.gitbook.io/documentation/channels-and-integrations/slack.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
