# Slack

Connects an agent to a Slack workspace as a bot. Users message the bot in Slack; the agent receives and replies in the same channel or direct message.

- **Supported agents:** Chatbot
- **Route type:** Conversation

## Before You Start

1. Go to [api.slack.com/apps](https://api.slack.com/apps) and create a new Slack App.
2. Under **OAuth & Permissions**, add the required bot token scopes for your use case (at minimum: `chat:write`, `app_mentions:read` or `im:read`).
3. Under **Event Subscriptions**, enable events and set the **Request URL** to the Neo webhook URL. The webhook URL is generated by Neo after channel creation — you will need to return to this step once the channel is set up.
4. Install the app to your workspace. Copy the **Bot User OAuth Token** (starts with `xoxb-`).
5. Under **Basic Information**, copy the **Signing Secret**.

Your agent must be published with an active version.

## Configuration

**Credentials**

- **Bot Token** — The Bot User OAuth Token from your Slack App (starts with `xoxb-`). Required.
- **Signing Secret** — The Signing Secret from your Slack App’s Basic Information page. Required.

**Route Settings**

- **Description** — Optional label for this channel instance.
- **Purpose** — Optional note on when the agent should use this channel.
- **Session Expiry (hours)** — Idle timeout before a conversation session resets. Default: 24. Range: 0.01–168.

> **Note**
>
> After creating the channel in Neo, return to your Slack App’s Event Subscriptions settings and update the Request URL with the webhook URL shown in the channel configuration. Slack will verify the URL before activating event delivery.

## Webhook Security

Neo checks the `X-Slack-Signature` header on every request Slack sends, including the URL verification challenge, using the **Signing Secret** in the credential. Requests with a missing or incorrect signature are rejected, and so are requests whose timestamp is more than five minutes old — keep the server clock in sync.
