docs/channels/slack.mdx
Integrate CowAgent into Slack via a Slack App in Socket Mode. Supports direct messages (DM) and channels (triggered by @mention or replying within a thread). Socket Mode uses a persistent WebSocket connection — no public IP or callback URL required, works out of the box.
CowAgent), pick the Workspace to install into, and create it.connections:write scope. Save this token starting with xapp-.Go to Features → OAuth & Permissions, click Add an OAuth Scope under Bot Token Scopes, and add the following scopes one by one:
app_mentions:read
channels:history
chat:write
commands
files:read
files:write
groups:history
im:history
mpim:history
users:read
Go to Features → Event Subscriptions, turn on Enable Events, and under Subscribe to bot events click Add Bot User Event to add:
app_mention
message.im
message.channels
Go to Features → App Home, enable Messages Tab under Show Tabs, and check Allow users to send Slash commands and messages from the messages tab. Otherwise the DM input box is disabled and users cannot message the bot.
Back in OAuth & Permissions, click Install to Workspace. After installing, copy the Bot User OAuth Token starting with xoxb-.
```json
{
"channel_type": "slack",
"slack_bot_token": "xoxb-xxxxxxxxxxxx",
"slack_app_token": "xapp-xxxxxxxxxxxx",
"slack_group_trigger": "mention_or_reply"
}
```
| Key | Description | Default |
| --- | --- | --- |
| `slack_bot_token` | Bot User OAuth Token, like `xoxb-...` | - |
| `slack_app_token` | App-Level Token (generated after enabling Socket Mode), like `xapp-...` | - |
| `slack_group_trigger` | Channel trigger: `mention_or_reply` (@ or reply in thread) / `mention_only` (@ only) / `all` (all messages) | `mention_or_reply` |
The integration is ready when you see logs like:
[Slack] Bot logged in as user_id=U0XXXXXXX, team=Txxxxxxxx
[Slack] ✅ Slack bot ready, listening for events
| Feature | Support |
|---|---|
| Direct message (DM) | ✅ |
| Channel (@bot / reply in thread) | ✅ |
| Text messages | ✅ send / receive |
| Image messages | ✅ send / receive |
| File messages | ✅ send / receive (PDF / Word / Excel, etc.) |
| Thread replies | ✅ replies are posted to the thread of the triggering message |
Once connected:
/invite @your-app), then trigger it with @your-app hello; continue the conversation by replying within the same thread.When sending an image or file, you can add a text caption (description / question) in the attachment input — the bot will answer based on both. Sending an attachment first and then a follow-up question also works; the two messages are merged automatically.