On this page
🏢 Why Slack?
| Advantage | Details |
|---|---|
| Thread support | Reply in threads — keeps conversations organized and channels clean. |
| No public URL | Socket Mode uses WebSocket — works behind NAT, no port forwarding, no ngrok. |
| Enterprise ready | Admin controls, compliance features, audit logs — IT teams approve Slack integrations. |
| Mention-based activation | Agent only responds when @mentioned in channels — no spam. |
| DMs | Direct message the bot for private conversations alongside channel usage. |
| Reactions | Agent can read and add emoji reactions for quick feedback loops. |
💡 Best for dev workflow: If your team already lives in Slack, OpenClaw becomes a native team member. PR review summaries, CI alerts, ticket creation — all delivered in-context. See the Dev Workflow Playbook.
📝 Create a Slack app
- Go to api.slack.com/apps
- Click “Create New App” → choose “From scratch”
- Name it (e.g., “OpenClaw”) and select your workspace
- You'll land on the Basic Information page — keep this tab open
🔑 Bot scopes (permissions)
Go to OAuth & Permissions → Bot Token Scopes → add these:
| Scope | Required? | Purpose |
|---|---|---|
chat:write | ✅ Required | Send messages |
app_mentions:read | ✅ Required | Respond when @mentioned |
channels:history | ✅ Required | Read public channel messages |
groups:history | ✅ Required | Read private channel messages |
im:history | ✅ Required | Read direct messages |
im:read | ✅ Required | Know when DMs are opened |
im:write | ✅ Required | Start DM conversations |
mpim:history | ✅ Required | Read group DMs |
reactions:read | Recommended | Read emoji reactions |
reactions:write | Recommended | Add emoji reactions |
pins:read | Optional | Read pinned messages |
pins:write | Optional | Pin important messages |
commands | Optional | Slash command support |
✅ Minimum viable scopes:
chat:write, app_mentions:read, channels:history, groups:history, im:history, im:read, im:write, mpim:history. Add the rest if you need reactions and pins.🔌 Enable Socket Mode
- Go to Socket Mode in the sidebar → toggle it ON
- When prompted, create an App-Level Token with scope
connections:write - Name it anything (e.g., “openclaw-socket”) → click Generate
- Copy the token (starts with
xapp-) — this is your Slack App Token
Then go to Event Subscriptions → toggle ON → add these bot events:
message.channels— messages in public channelsmessage.groups— messages in private channelsmessage.im— direct messagesmessage.mpim— group DMsapp_mention— when someone @mentions the bot
💡 Socket Mode vs Webhooks: Socket Mode uses WebSocket — your OpenClaw instance connects outbound to Slack (no public URL needed). This is ideal for local machines and VPS behind firewalls. Webhooks require a public HTTPS endpoint.
📥 Install to your workspace
- Go to OAuth & Permissions → click “Install to Workspace”
- Authorize the requested permissions
- Copy the Bot User OAuth Token (starts with
xoxb-) — this is your Slack Bot Token
You now have two tokens:
| Token | Prefix | Purpose |
|---|---|---|
| App-Level Token | xapp- | Socket Mode connection |
| Bot User OAuth Token | xoxb- | API calls (send messages, etc.) |
⚙️ Configure OpenClaw
// ~/.openclaw/openclaw.json
{
"channels": {
"slack": {
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-...",
"dmPolicy": "pairing"
}
}
}
Environment variables (alternative)
export SLACK_BOT_TOKEN="xoxb-..."
export SLACK_APP_TOKEN="xapp-..."
Restart the gateway: openclaw gateway restart
Go to Slack, DM the bot, and say “hello” to test the connection.
🧵 Thread-based conversations
Slack threads are a natural fit for OpenClaw sessions:
- When someone @mentions the bot in a channel, the bot responds in a thread (not cluttering the main channel)
- Each thread maintains its own conversation context
- Multiple people can have separate threads going simultaneously
✅ Best practice from community: Create a Slack skill that instructs your agent to “always respond in threads and not as new messages.” This keeps channels clean and conversations easy to follow.
📢 Channel routing
Control where the bot responds:
{
"channels": {
"slack": {
"groupPolicy": "allowlist",
"groups": {
"C_DEV_CHANNEL": {
"requireMention": true
},
"C_AI_CHANNEL": {
"requireMention": false,
"activation": "always"
}
}
}
}
}
Channel IDs start with C. Right-click a channel → “View channel details” → copy the Channel ID at the bottom.
Cron delivery to Slack
openclaw cron add \
--name "Morning dev briefing" \
--cron "0 8 * * 1-5" \
--session isolated \
--message "Morning briefing: check open PRs and CI status" \
--announce --channel slack \
--to "channel:C_DEV_CHANNEL"
✨ Supported features
| Feature | Status | Notes |
|---|---|---|
| Text messages | ✅ Full | Markdown, code blocks, mrkdwn format |
| Thread replies | ✅ Full | Bot replies in threads by default |
| @mentions | ✅ Full | Mention-based activation in channels |
| DMs | ✅ Full | Direct messages with pairing/allowlist |
| Reactions | ✅ Full | Read and write emoji reactions |
| File uploads | ✅ Full | Images, PDFs, code files |
| Pins | ✅ Full | Pin important messages (with scope) |
| Slash commands | ✅ Full | /status, /model, /reset |
| Voice / audio | ❌ No | Slack Huddles not supported |
| Multi-workspace | ⚠️ Limited | One workspace per Slack app installation |
🔧 Troubleshooting
| Problem | Fix |
|---|---|
| Bot doesn't respond to messages | Check Event Subscriptions are ON and bot events (message.im, app_mention) are subscribed. |
| Bot responds but can't read messages | Missing scope. Add channels:history, im:history etc. Reinstall the app after adding scopes. |
| “not_authed” or “invalid_auth” | Bot token is wrong or expired. Regenerate from OAuth & Permissions page. |
| Socket Mode won't connect | Check appToken (starts with xapp-) is correct and Socket Mode is enabled in the Slack app settings. |
| Bot can't DM users | Missing im:write scope. Add it and reinstall the app. |
| Messages in private channels not seen | Bot must be invited to the channel (/invite @OpenClaw) AND have groups:history scope. |
| Scopes changed but not working | After adding new scopes, you must reinstall the app to the workspace for changes to take effect. |
⚠️ Common gotcha: After changing bot scopes, you must reinstall the app to your workspace. Go to OAuth & Permissions → “Reinstall to Workspace”. Simply restarting the gateway is not enough.