Connect OpenClaw to Slack
Add OpenClaw to your Slack workspace. Get AI assistance in channels, threads, or DMs with slash command support.
- ✓WebSocket Connection — Real-time messaging via Slack Bot API + Socket Mode
- ✓Slash Commands — Native /clawd command interface
- ✓Thread Support — Keep conversations organized with history context
- ✓Rich Formatting — Formatted responses with reactions and pins
- ✓Flexible Access — DMs, public channels, and private channels
- •Slack Bot Token — Starts with xoxb-...
- •Slack App Token — Starts with xapp-... (for Socket Mode)
- •Slack App — With appropriate OAuth scopes configured
Setup Steps
Create a Slack App
Go to the Slack API portal and create a new application:
- • Visit api.slack.com/apps
- • Click "Create New App"
- • Choose "From scratch"
- • Name it (e.g., "OpenClaw") and select your workspace
Add Bot Token Scopes
Configure OAuth permissions for your bot:
- • Go to "OAuth & Permissions" in the sidebar
- • Under "Bot Token Scopes", add:
- - app_mentions:read — Read mentions
- - channels:history — View channel messages
- - channels:read — View channel info
- - chat:write — Send messages
- - im:history — View DM history
- - im:read — View DM info
- - im:write — Start DM conversations
- - reactions:write — Add reactions
- - users:read — View user info
Enable Socket Mode
Socket Mode allows real-time communication without a public URL:
- • Go to "Socket Mode" in the sidebar
- • Toggle "Enable Socket Mode" on
- • Generate an App-Level Token with connections:write scope
- • Copy the token (starts with xapp-...)
Install App to Workspace
Install the app and get your Bot Token:
- • Go to "Install App" in the sidebar
- • Click "Install to Workspace"
- • Authorize the requested permissions
- • Copy the Bot User OAuth Token (starts with xoxb-...)
Configure OpenClaw
Add the Slack configuration to your openclaw.json:
{
"channels": {
"slack": {
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-..."
}
}
}Invite Bot to Channels
Add the bot to channels where you want it to respond:
- • Open the channel in Slack
- • Type /invite @OpenClaw
- • Or click the channel name -> Integrations -> Add apps
- • Restart OpenClaw with openclaw restart and test by mentioning the bot.
Thread Support
Maintains conversation context within threads with configurable history scope.
Emoji Reactions
Bot can add reactions to acknowledge messages or indicate status.
Message Pinning
Pin important responses for easy reference later.
Slash Commands
Use /clawd for quick AI queries from anywhere.
Member Info
Look up workspace member information when needed.
DM Support
Private one-on-one conversations with the bot.
Full configuration options for Slack integration:
{
"channels": {
"slack": {
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-...",
"dm": {
"enabled": true,
"policy": "pairing",
"allowFrom": ["U123", "U456"]
},
"channels": {
"#general": {
"allow": true,
"requireMention": true,
"users": ["U123"]
}
},
"historyLimit": 50,
"slashCommand": {
"enabled": true,
"name": "clawd"
},
"actions": {
"reactions": true,
"messages": true,
"pins": true
}
}
}
}dm.enabled— Allow direct messages to the botdm.policy— DM access policy ("pairing" or "open")dm.allowFrom— Array of user IDs allowed to DMchannels— Per-channel configuration objectrequireMention— Only respond when @mentionedhistoryLimit— Number of messages to include for contextslashCommand— Configure slash command settingsactions— Enable/disable reactions, messages, and pins
Allowlist Mode
Only respond in explicitly configured channels. Best for controlled environments.
Open Mode
Respond in all channels where the bot is invited. Use requireMention to gate responses.
From Profile:
Click on a user's name -> View profile -> Click the three dots (...) -> Copy member ID
From Slack Admin:
Workspace Settings -> Manage Members -> Export member list as CSV
Bot not responding in channels?
Make sure the bot is invited to the channel and has the correct scopes. Check if requireMention is enabled.
Socket Mode connection errors?
Verify your App Token (xapp-...) is correct and has the connections:write scope.
Slash command not showing?
Go to "Slash Commands" in your Slack app settings and create the command manually, pointing it to Socket Mode.
Permission denied errors?
Reinstall the app to your workspace after adding new scopes. Some scope changes require re-installation.
Slack Connected!
Now configure more channels or enhance your bot with custom skills.