Buda LogoBuda

Connect Slack Bot

How to configure and connect a Slack bot to Buda via Socket Mode (WebSocket) for two-way AI conversations.

Connect Slack Bot

Buda connects to Slack via Socket Mode — a persistent WebSocket connection. This means you do not need a public HTTPS endpoint or any webhook URL configuration. You only need two tokens, and Buda will automatically maintain the connection in the background.

Step 1: Create a Slack App

  1. Go to https://api.slack.com/apps and click Create New App.
  2. Select From scratch, enter an app name (e.g., Buda Assistant), and choose your workspace.
  3. Click Create App.

Step 2: Enable Socket Mode and Get the App-Level Token

  1. In the left menu, click Socket Mode.
  2. Toggle on Enable Socket Mode.
  3. A dialog will appear asking you to create an App-Level Token:
    • Enter a token name (e.g., buda-socket).
    • Click Add Scope and select connections:write.
    • Click Generate.
  4. Copy the generated token — it starts with xapp-. This is your App-Level Token.

Step 3: Configure Bot Permissions

  1. In the left menu, go to OAuth & Permissions.
  2. Under Bot Token Scopes, click Add an OAuth Scope and add the following:
    • app_mentions:read — receive @mention events in channels
    • channels:history — read channel message history
    • chat:write — send messages
    • im:history — read direct message history
    • im:read — access DM channel info
    • im:write — open DM conversations
    • users:read — look up user display names

Step 4: Subscribe to Events

  1. In the left menu, click Event Subscriptions.
  2. Toggle on Enable Events.
  3. Under Subscribe to bot events, click Add Bot User Event and add:
    • app_mention — triggers when a user @mentions the bot in a channel
    • message.im — triggers when a user sends the bot a direct message

Step 5: Install the App to Your Workspace

  1. In the left menu, go to OAuth & Permissions.
  2. Click Install to Workspace and authorize the app.
  3. Copy the Bot User OAuth Token — it starts with xoxb-. This is your Bot Token.

Step 6: Configure the Channel in Buda

  1. Open Channels Settings in Buda (Settings → Channels).
  2. Click Add Channel and select Slack.
  3. Fill in the two fields:
    • Bot User OAuth Token: paste your xoxb-... token
    • App-Level Token: paste your xapp-... token
  4. Optionally set a Label and select a Target Agent.
  5. Click Connect.

Once saved, Buda will immediately establish a Socket Mode WebSocket connection to Slack in the background.

Step 7: Start Chatting

  • In a channel: invite the bot first with /invite @YourBotName, then @mention it with your message.
  • Direct message: open a DM with the bot and send any message — no @mention needed.

Buda's AI Agent will process your message in real-time and reply in the same thread.

On this page