Slack Integration
This guide walks you through connecting an Aigentic agent to a Slack workspace.
Prerequisites
Section titled “Prerequisites”- An Aigentic agent already created
- A Slack workspace where you have permission to install apps
Step 1: Create a Slack App
Section titled “Step 1: Create a Slack App”- Go to the Slack API portal.
- Click Create New App.
- Choose From scratch.
- Enter an App Name (e.g., “My AI Agent”) and select your workspace.
- Click Create App.
Step 2: Configure OAuth and Permissions
Section titled “Step 2: Configure OAuth and Permissions”- In your app settings, go to OAuth & Permissions.
- Under Bot Token Scopes, add at minimum:
| Scope | Purpose |
|---|---|
chat:write | Send messages |
channels:history | Read messages in public channels |
channels:read | View public channel info |
You may also want these optional scopes for richer functionality:
| Scope | Purpose |
|---|---|
groups:history | Read messages in private channels |
im:history | Read direct messages |
app_mentions:read | Receive @mention events |
users:read | View user info |
files:write | Upload files |
reactions:write | Add emoji reactions |
- Click Install to Workspace.
- Review the permissions and click Allow.
- Copy the Bot User OAuth Token (starts with
xoxb-).
Step 3: Enable Events
Section titled “Step 3: Enable Events”For the bot to receive messages, enable events:
- Go to Event Subscriptions in your app settings.
- Toggle Enable Events to on.
Socket Mode (Recommended)
Section titled “Socket Mode (Recommended)”Socket Mode does not require a public URL. It uses a WebSocket connection.
-
Go to Socket Mode in your app settings.
-
Toggle it On.
-
Generate an App-Level Token with the
connections:writescope. -
Copy the token (starts with
xapp-). -
Under Subscribe to Bot Events, add:
| Event | Description |
|---|---|
message.channels | Messages in public channels |
message.groups | Messages in private channels |
message.im | Direct messages |
app_mention | When someone @mentions the bot |
- Click Save Changes.
Step 4: Configure in Aigentic
Section titled “Step 4: Configure in Aigentic”- Open Channels from the sidebar.
- Click Configure on the Slack card.
- Enter the Bot Token (
xoxb-token from Step 2). - 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). - Select the responding agent from the dropdown.
- 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.
- Optionally click Test Connection to verify the token and channel access.
- Click Save Configuration.
Tokens are encrypted and stored in the credential vault.
Step 5: Add the Bot to Channels
Section titled “Step 5: Add the Bot to Channels”The bot needs to be added to each Slack channel where it should be active:
- In Slack, go to the channel.
- Type
/invite @YourBotName. - Repeat for each channel.
Step 6: Test the Connection
Section titled “Step 6: Test the Connection”- Go to a channel where the bot is added.
- Send a message mentioning the bot:
@MyAIAgent What can you help me with?
- The bot should respond in a thread or inline, depending on configuration.
Slack Features
Section titled “Slack Features”Thread Conversations
Section titled “Thread Conversations”The bot can reply in threads to keep channels organized. Follow-up messages in the thread maintain conversation context.
Rich Formatting
Section titled “Rich Formatting”Slack uses its own markup format (mrkdwn). Aigentic automatically converts agent responses with bold, italic, code, and code blocks.
Emoji Reactions
Section titled “Emoji Reactions”The bot can react to messages with emoji to acknowledge receipt while processing.
Troubleshooting
Section titled “Troubleshooting”Bot not responding to messages
Section titled “Bot not responding to messages”- 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.
”not_in_channel” error
Section titled “”not_in_channel” error”The bot has not been invited to the channel. Use /invite @YourBotName.
”missing_scope” error
Section titled “”missing_scope” error”The bot token lacks a required OAuth scope. Go to OAuth & Permissions, add the missing scope, and reinstall the app to the workspace.
Bot responds multiple times
Section titled “Bot responds multiple times”- Check that only one connection is using this bot token.
- Verify the event subscription is not duplicated.