Skip to content

Slack Integration

This guide walks you through connecting an Aigentic agent to a Slack workspace.

  • An Aigentic agent already created
  • A Slack workspace where you have permission to install apps
  1. Go to the Slack API portal.
  2. Click Create New App.
  3. Choose From scratch.
  4. Enter an App Name (e.g., “My AI Agent”) and select your workspace.
  5. Click Create App.
  1. In your app settings, go to OAuth & Permissions.
  2. Under Bot Token Scopes, add at minimum:
ScopePurpose
chat:writeSend messages
channels:historyRead messages in public channels
channels:readView public channel info

You may also want these optional scopes for richer functionality:

ScopePurpose
groups:historyRead messages in private channels
im:historyRead direct messages
app_mentions:readReceive @mention events
users:readView user info
files:writeUpload files
reactions:writeAdd emoji reactions
  1. Click Install to Workspace.
  2. Review the permissions and click Allow.
  3. Copy the Bot User OAuth Token (starts with xoxb-).

For the bot to receive messages, enable events:

  1. Go to Event Subscriptions in your app settings.
  2. Toggle Enable Events to on.

Socket Mode does not require a public URL. It uses a WebSocket connection.

  1. Go to Socket Mode in your app settings.

  2. Toggle it On.

  3. Generate an App-Level Token with the connections:write scope.

  4. Copy the token (starts with xapp-).

  5. Under Subscribe to Bot Events, add:

EventDescription
message.channelsMessages in public channels
message.groupsMessages in private channels
message.imDirect messages
app_mentionWhen someone @mentions the bot
  1. Click Save Changes.
  1. Open Channels from the sidebar.
  2. Click Configure on the Slack card.
  3. Enter the Bot Token (xoxb- token from Step 2).
  4. Enter the Channel ID where the bot should operate (right-click the channel in Slack → View channel details → copy the Channel ID, starts with C).
  5. Select the responding agent from the dropdown.
  6. Choose the Reply Mode:
    • Reply to all messages (in threads) — The bot replies to every message in the channel, using threads.
    • Don’t auto-reply — The bot only responds when explicitly triggered.
  7. Optionally click Test Connection to verify the token and channel access.
  8. Click Save Configuration.

Tokens are encrypted and stored in the credential vault.

The bot needs to be added to each Slack channel where it should be active:

  1. In Slack, go to the channel.
  2. Type /invite @YourBotName.
  3. Repeat for each channel.
  1. Go to a channel where the bot is added.
  2. Send a message mentioning the bot:
    @MyAIAgent What can you help me with?
  3. The bot should respond in a thread or inline, depending on configuration.

The bot can reply in threads to keep channels organized. Follow-up messages in the thread maintain conversation context.

Slack uses its own markup format (mrkdwn). Aigentic automatically converts agent responses with bold, italic, code, and code blocks.

The bot can react to messages with emoji to acknowledge receipt while processing.

  • Verify the bot is added to the channel (/invite @YourBotName).
  • Check that Event Subscriptions are enabled and the correct events are subscribed.
  • Verify the xapp- token is correct.

The bot has not been invited to the channel. Use /invite @YourBotName.

The bot token lacks a required OAuth scope. Go to OAuth & Permissions, add the missing scope, and reinstall the app to the workspace.

  • Check that only one connection is using this bot token.
  • Verify the event subscription is not duplicated.