Slack Setup Guide
Connect OpenClaw to your Slack workspace. About 6 minutes.
Prerequisites
- β OpenClaw installed and running (Quick Start)
- β A Slack workspace where you can install apps
- β About 6 minutes
Create a Slack App
- Go to api.slack.com/apps
- Click Create New App β From scratch
- Name your app (e.g. "OpenClaw")
- Pick your workspace β Create App
Choose "From scratch" β it's the simpler option.
Enable Socket Mode
Socket Mode lets your bot connect without a public URL β no server setup needed.
- In the left sidebar, go to Socket Mode
- Toggle it ON
- Go to Basic Information β App-Level Tokens (scroll down)
- Click Generate Token and Scopes
- Name it anything (e.g. "openclaw") β add scope
connections:write - Click Generate β copy the App Token
The App Token starts with xapp-. You'll need this in Step 5.
Set Permissions & Events
First, add the scopes your bot needs:
- Go to OAuth & Permissions in the left sidebar
- Scroll to Bot Token Scopes and add these scopes:
chat:writeβ send messagesim:historyβ read DM historyim:readβ view DM channelsim:writeβ open DM channelsapp_mentions:readβ detect @mentions
Then, subscribe to events so your bot gets notified:
- Go to Event Subscriptions in the left sidebar
- Toggle Enable Events β ON
- Under Subscribe to bot events, add:
message.imβ when someone DMs the botapp_mentionβ when someone @mentions the bot
- Click Save Changes
Install & Get Bot Token
- Go to Install App in the left sidebar
- Click Install to Workspace β Allow
- Copy the Bot User OAuth Token
Copy the Bot token (starts with xoxb-), not the User token (xoxp-).
One more thing β enable DMs:
- Go to App Home in the left sidebar
- Turn ON the Messages Tab
This lets users send direct messages to your bot from the Slack sidebar.
Configure OpenClaw
Run the setup wizard β you'll need both tokens from earlier:
openclaw init Select Slack when prompted. Paste the App Token (xapp-) and Bot Token (xoxb-) when asked.
Or edit the config file manually
Add this to ~/.openclaw/config.yaml:
channels:
slack:
appToken: "xapp-YOUR_APP_TOKEN"
botToken: "xoxb-YOUR_BOT_TOKEN"
enabled: true Start & Test
Start the gateway:
openclaw gateway start Open Slack and send a direct message to your bot (find it under Apps in the sidebar).
Success! Your Slack bot is now connected to OpenClaw.
Bonus: Channel Mentions
Your bot also responds to @mentions in channels. Just invite it to a channel and type @YourApp how's the weather?
To invite the bot to a channel: type /invite @YourApp in that channel.
Troubleshooting
Bot doesn't respond to DMs
Make sure the Messages Tab is turned on in App Home (Step 4). Also check that message.im event is subscribed (Step 3).
Connection error on startup
Double-check that Socket Mode is enabled and the App Token (xapp-) is correct.
"not_allowed_token_type" error
You mixed up the tokens. The App Token starts with xapp- and the Bot Token starts with xoxb-.
Bot responds slowly
This is normal for the first message. Subsequent messages should be faster.