Connect Slack to OpenClaw
Run your OpenClaw AI assistant directly inside Slack. This guide walks you through creating a Slack app, getting the required tokens, and launching your instance. The whole process takes about 5 minutes.
How it works
OpenClaw connects to Slack via Socket Mode — a secure WebSocket connection initiated from your instance to Slack's servers. This means no public webhook URLs are needed and your instance stays fully private with no public IP exposure.
You'll need two tokens:
- Bot Token (
xoxb-...) — authenticates your bot and grants it permissions in your workspace. - App Token (
xapp-...) — establishes the Socket Mode connection.
Step 1: Create a Slack app
- Go to api.slack.com/apps and click Create New App.
- Choose "From scratch".
- Give it a name (e.g. "OpenClaw Assistant") and select your workspace.
- Click Create App.
Step 2: Add bot token scopes
Your bot needs permission to read and write messages. In your app settings:
- Go to OAuth & Permissions in the sidebar.
- Scroll to Scopes → Bot Token Scopes.
-
Add these scopes:
app_mentions:readRespond when mentioned in channelschat:writeSend messages as the botchannels:historyRead public channel messagesgroups:historyRead private channel messagesim:historyRead direct messagesim:readView DM metadatampim:historyRead group DMs
Step 3: Install the app and get the Bot Token
- Still in OAuth & Permissions, click Install to Workspace at the top.
- Review the permissions and click Allow.
- Copy the Bot User OAuth Token — it starts with
xoxb-.
Tip: Keep this token secret. Treat it like a password.
Step 4: Enable Socket Mode and get the App Token
- In the sidebar, go to Socket Mode.
- Toggle Enable Socket Mode to on.
- You'll be prompted to create an app-level token. Give it a name (e.g. "openclaw-socket") and add the
connections:writescope. - Click Generate.
- Copy the App Token — it starts with
xapp-.
Step 5: Subscribe to events
So your bot can receive messages, you need to subscribe to events:
- In the sidebar, go to Event Subscriptions.
- Toggle Enable Events to on. (Since Socket Mode is enabled, no URL is needed.)
-
Under Subscribe to bot events, add:
app_mention— when someone @-mentions your botmessage.im— direct messages to the botmessage.channels— messages in public channels (optional)message.groups— messages in private channels (optional)
- Click Save Changes.
Note: After changing event subscriptions, you may need to reinstall the app to your workspace. Slack will prompt you if needed.
Step 6: Enter tokens in OpenClaw Setup
- Go to the OpenClaw Setup dashboard.
- Start the setup wizard and select Slack (or both Telegram + Slack) as your platform.
- Paste your Bot Token (
xoxb-...) and App Token (xapp-...). - Configure your LLM provider and launch.
Your OpenClaw assistant will connect to Slack via Socket Mode and start responding to messages. No webhook setup needed.
Step 7: Configure the allowlist
By default, your bot uses an allowlist so only approved users and channels can interact with it. After launching:
- Open the Slack section in your instance dashboard.
- Add Slack user IDs for DM access (find yours in Slack: click your profile → ... → Copy member ID).
- Add channel IDs for channels where the bot should respond (right-click a channel → View channel details → scroll to find the ID at the bottom).
Troubleshooting
- Bot doesn't respond to DMs
- Make sure you've subscribed to the
message.imevent and your Slack user ID is in the DM allowlist. - Bot doesn't respond in channels
- The bot requires @-mention by default. Make sure the channel ID is in the allowlist, and that you've subscribed to
app_mentionandmessage.channelsevents. - Token validation fails
- Double-check you're pasting the correct token type: Bot Token starts with
xoxb-, App Token starts withxapp-. Make sure the app is installed to your workspace. - Socket Mode not connecting
- Ensure Socket Mode is enabled in your app settings and the App Token has the
connections:writescope.
Ready to launch?
Once you have both tokens, go to the dashboard to complete setup and launch your Slack-connected assistant.