> ## Documentation Index
> Fetch the complete documentation index at: https://agnt.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack connector

> Let users chat with your agents directly in Slack.

Slack is the first **first-party connector** in agntdata. Connect your Slack workspace once from **Connections → Slack**. agntdata installs a bot that can:

* Receive DMs and `@mentions` and route them to a default deployed agent (or per-channel routing rules).
* Stream agent replies back into the same thread, updating the message as new tokens arrive.
* Post escalation prompts into a designated channel so on-call humans can answer.

Once connected, deployed agents can opt into Slack tools (`slack_post_message`, `slack_conversation_history`, `slack_conversation_replies`) from the **Connections** tab of the agent's tool picker. The Builder surfaces them under `type: "connector"` in `list_workspace_integrations`, with a `connected` flag and a `setup_path` pointing back at this page.

Slack threads create [agent sessions](/agents/sessions) — one session per thread, reused for every reply. See [Triggers](/agents/triggers) for the full set of ways an agent can be woken up.

## Setup

Install the Slack app from **Connections → Slack → Connect Slack**. The button kicks off Slack's OAuth flow via the generic OAuth surface; on approval Slack redirects back to `/webhooks/inbound/oauth/slack/callback`, which exchanges the code for a bot token and stores it encrypted in `oauth_installs` (with Slack-specific routing defaults under `metadata`).

The Slack app itself is provisioned from a manifest checked into the repo at `docs/setup/slack-app-manifest.yaml` — paste it into [api.slack.com/apps → Create New App → From a manifest](https://api.slack.com/apps) to reproduce the exact scopes, slash commands, and event subscriptions agntdata expects.

### Bot scopes

Grouped by capability so it's easy to reason about least-privilege.

**Chat with an agent**

* `app_mentions:read`, `chat:write`, `chat:write.public`, `commands`
* `im:history`, `im:read`, `im:write`
* `mpim:history`, `mpim:read`, `mpim:write`
* `channels:history`, `groups:history`

**Create and manage Slack channels (agent tool)**

* `channels:read`, `channels:manage`, `channels:join`
* `groups:read`, `groups:write`

**Resolve teammates when inviting**

* `team:read`, `users:read`, `users:read.email`

The same list lives in `SLACK_BOT_SCOPES` in `apps/api/src/services/oauth/providers/slack.ts`. Keep the manifest, the constant, and this page in sync — adding a scope later forces every install to be re-authorized.

## Channel-management tools

Once an install is connected, agents can ask the platform to spin up a Slack channel, invite teammates, and converse with them inline. The connector exposes:

* `slack_post_message`, `slack_conversation_history`, `slack_conversation_replies` — chat primitives.
* (Coming soon) `slack_create_channel`, `slack_invite_to_channel`, `slack_set_channel_topic` — built on top of `conversations.create`, `conversations.invite`, and `conversations.setTopic`. Scopes are already granted by the manifest above so no reinstall will be needed when these ship.

## Routing inbound messages

For every Slack DM or mention, the router:

1. Looks up which agent answers in this channel via the `chat_platform_connections` routing table.
2. Resolves (or creates) an `agent_sessions` row keyed off the conversation id — one session per thread, reused for every reply.
3. Sends the user message to Anthropic against the resolved agent.
4. Streams the response back, calling `chat.update` to replace the placeholder message in real time.

The Builder's `list_slack_channel_routes`, `create_slack_channel_route`, `update_slack_channel_route`, and `delete_slack_channel_route` tools manage the routing table — you can ask the Builder "route this channel to my support agent" and it'll write the row directly. Or change the default agent and the escalation channel from the Slack dialog on **Connections**.

## Slash commands

* `/agnt list` — lists your deployed agents and how to use them.
* `/agnt help` — usage instructions.

## External users

Each install has an `external_user_policy`:

* `reject` (default) — block messages from users outside your Slack workspace.
* `allow_listed` — only accept users you've explicitly added.
* `allow_all` — accept anyone the bot can see.

## Escalations

When a deployed agent calls `escalate_to_human`, the escalation lands in your dashboard Inbox and — if your Slack install has an escalation channel configured — a Slack message is posted with deep links back to the question. Replies in Slack and replies in the dashboard both flow into the same `agent_escalations` row. See [Permissions](/agents/permissions).

## Next steps

<CardGroup cols={2}>
  <Card title="Triggers" icon="bolt" href="/agents/triggers">
    Schedules and webhooks alongside Slack.
  </Card>

  <Card title="Permissions" icon="shield" href="/agents/permissions">
    Configure the escalation channel.
  </Card>

  <Card title="Sessions" icon="messages" href="/agents/sessions">
    How Slack threads map onto agent sessions.
  </Card>
</CardGroup>
