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

# Slack

> Connect your agent to a Slack workspace

# Slack Setup

Connect your Vecbase agent to Slack so your team can chat with it in channels and DMs.

## Prerequisites

* A Slack workspace where you have admin permissions
* A Vecbase agent created

## Step 1: Create a Slack App

<Steps>
  <Step title="Open Slack API">
    Go to [Slack API](https://api.slack.com/apps) and click **Create New App** → **From scratch**.
  </Step>

  <Step title="Name and workspace">
    * **App Name**: e.g., "Vecbase Assistant"
    * **Workspace**: Select your workspace
  </Step>

  <Step title="Enable Socket Mode">
    Go to **Socket Mode** in the left sidebar and toggle it **On**.

    Create an **App-Level Token** with `connections:write` scope. Name it anything (e.g., "socket-token").

    Copy the token (starts with `xapp-`):

    ```
    xapp-1-A07XXXXXXXX-1234567890123-abcdef...
    ```
  </Step>
</Steps>

## Step 2: Configure Bot Permissions

<Steps>
  <Step title="Add bot scopes">
    Go to **OAuth & Permissions** → **Bot Token Scopes** and add:

    | Scope              | Purpose               |
    | ------------------ | --------------------- |
    | `chat:write`       | Send messages         |
    | `channels:read`    | List channels         |
    | `channels:history` | Read channel messages |
    | `users:read`       | Get user info         |
    | `files:read`       | Read shared files     |
    | `files:write`      | Upload files          |
    | `reactions:write`  | Add reactions         |
  </Step>

  <Step title="Enable events">
    Go to **Event Subscriptions** → toggle **On**.

    Subscribe to bot events:

    * `message.channels` — Messages in public channels
    * `message.groups` — Messages in private channels
    * `message.im` — Direct messages
    * `app_mention` — When someone @mentions the bot
  </Step>

  <Step title="Install to workspace">
    Go to **Install App** → **Install to Workspace** → **Allow**.

    Copy the **Bot User OAuth Token** (starts with `xoxb-`):

    ```
    xoxb-1234567890-1234567890123-AbCdEfGhIjKlMnOpQrStUv
    ```
  </Step>
</Steps>

## Step 3: Connect in Vecbase

<Steps>
  <Step title="Open agent settings">
    Open your agent, tap **Settings** in the top right, then select **Channels**.
  </Step>

  <Step title="Add Slack channel">
    Click **Add Channel** next to **Slack**.
  </Step>

  <Step title="Enter credentials">
    * **Display Name**: A name for this channel (e.g., "Team Workspace")
    * **App Token**: The `xapp-...` token from Socket Mode
    * **Bot Token**: The `xoxb-...` token from OAuth
  </Step>

  <Step title="Create">
    Click **Create**. Status will change to **Connected**.
  </Step>
</Steps>

## Step 4: Test

Invite the bot to a channel (`/invite @botname`) and send a message. The bot will respond.

For DMs, find the bot in your sidebar and send a message directly.

<Tip>
  Use `@botname` to mention the bot in channels. By default, the bot only responds when mentioned in group channels.
</Tip>

## Limitations

| Limit          | Value                           |
| -------------- | ------------------------------- |
| File upload    | 1 GB (workspace plan dependent) |
| Message length | 40,000 characters               |
