Skip to main content

Slack

Add your agent to Slack as a bot. Users can interact with it via direct messages, @mentions in channels, or slash commands.

Prerequisites

  • A Slack workspace where you have admin permissions
  • Your agent created and tested in thinnestAI

Setup

Step 1: Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New App > From scratch
  3. Name your app (e.g., “Acme AI Assistant”)
  4. Select your workspace
  5. Click Create App

Step 2: Configure Bot Permissions

  1. Go to OAuth & Permissions in the sidebar
  2. Under Bot Token Scopes, add:
    • chat:write — Send messages
    • app_mentions:read — Read @mentions
    • channels:history — Read channel messages (for context)
    • im:history — Read DM history
    • im:write — Send DMs
  3. Click Install to Workspace and authorize

Step 3: Get the Bot Token

After installing, copy the Bot User OAuth Token (starts with xoxb-).

Step 4: Configure Your Agent

  1. Open your agent in thinnestAI
  2. Go to the Deploy tab
  3. Select Slack
  4. Enter:
    • Bot Token — The xoxb- token from Slack
    • Signing Secret — Found in Basic Information > App Credentials
  5. Click Save & Enable

Step 5: Set Event Subscriptions

  1. In your Slack app settings, go to Event Subscriptions
  2. Toggle Enable Events on
  3. Set the Request URL to:
  1. Under Subscribe to bot events, add:
    • app_mention — Responds when @mentioned in channels
    • message.im — Responds to direct messages
  2. Click Save Changes

Step 6: Add Slash Command (Optional)

  1. Go to Slash Commands in your Slack app settings
  2. Click Create New Command
  3. Configure:
    • Command: /ask (or your preferred command)
    • Request URL: https://api.thinnest.ai/webhooks/slack/commands/YOUR_AGENT_ID
    • Description: “Ask the AI assistant a question”
  4. Click Save

How It Works

Event-Based (Mentions & DMs)

Slash Command

Session Persistence

Each Slack user gets their own conversation session per channel. Session ID format: slack_{user_id}_{channel_id}

Automatic Lead Capture

Every Slack user is automatically captured as a lead with:
  • User ID: Slack user identifier
  • Name: From slash commands (display name)
  • Channel: Stored in custom fields
  • Team ID: Workspace identifier in custom fields
  • Platform: slack
  • Deduplication: One lead per Slack user per agent

Agent Discovery

thinnestAI automatically matches Slack events to agents by finding agents with the matching bot_token in their configuration. This means one Slack app maps to one agent.

Security

  • Signature verification: Every event is verified using the Slack signing secret and X-Slack-Signature header
  • Challenge verification: Initial URL verification is handled automatically
  • Event deduplication: Slack may send events multiple times — the platform handles this gracefully
  • Token encryption: Bot tokens are encrypted at rest

Slash Command vs Events

Troubleshooting