Slack
Add your private AI assistant to Slack. OpenClaw works behind firewalls using Socket Mode — no public URL needed. Full setup guide.
Slack is the best channel for work contexts. Socket Mode keeps your agent connected without requiring a public URL, and it works reliably behind firewalls and corporate VPNs. Slack works on any supported OpenClaw host including small VPS instances, and adds no cost on top of your normal AI API spend.
New to OpenClaw? Start with the installation guide to get the gateway running, then return here. If you want to connect Telegram first as a simpler test, Module 2 covers that.
Create your Slack app
- Go to api.slack.com/apps and click Create New App
- Choose From scratch
- Name it (something like "My Assistant") and select your workspace
- Under Socket Mode, enable it and generate an App-Level Token with
connections:writescope - Under OAuth & Permissions, add these Bot Token Scopes:
chat:write— send messagesim:history— read DMschannels:history— read channel messages (only channels you add the bot to)app_mentions:read— detect @mentions
- Install the app to your workspace and copy the Bot Token
Save your tokens
Store them as environment variables (never put real tokens directly in config files):
export SLACK_BOT_TOKEN="xoxb-..."
export SLACK_APP_TOKEN="xapp-..."
export SLACK_SIGNING_SECRET="..."Configure OpenClaw
Add the Slack channel to ~/.openclaw/openclaw.json:
{
"channels": {
"slack": {
"enabled": true,
"mode": "socket",
"dmPolicy": "pairing",
"groupPolicy": "mention",
"requireMention": true,
"botToken": "${SLACK_BOT_TOKEN}",
"appToken": "${SLACK_APP_TOKEN}",
"signingSecret": "${SLACK_SIGNING_SECRET}",
"allowedChannels": [
"C0123456789"
],
"threadReplies": true
}
}
}Restart and test
openclaw gateway restartDM your bot or @mention it in your allowed channel:
Hey, are you there?Check logs if it doesn't respond:
openclaw logs --follow | grep slackSocket Mode vs. Events API
Socket Mode (Recommended)
Creates a persistent WebSocket connection — no public URL required. Works behind firewalls. Automatically reconnects after interruptions.
This is what most setups should use. Reliable enough to run continuously for weeks without issues.
Socket Mode connections now honor ambient HTTP(S) proxy settings (including NO_PROXY exclusions), so OpenClaw works in proxy-only deployments without requiring manual configuration.
Events API
Requires a publicly accessible webhook URL. Slack sends event notifications to your URL when things happen. Use this only if your infrastructure can't support outbound WebSocket connections.
Interactive Replies
Slack replies have full rich reply parity for direct deliveries. If your agent's response ends with a simple Options: block, OpenClaw auto-renders those options as interactive buttons or select menus in Slack — no extra configuration needed.
Example agent output:
Here are three approaches for the migration:
Options:
- Run the migration now
- Schedule for tonight
- Skip this cycleThis renders as clickable buttons in Slack. Interactive setup defaults have been improved and reply controls are isolated from plugin interactive handlers, so custom plugins won't interfere with standard reply buttons.
Slash Command Menus (v2026.4.15)
New in v2026.4.15
Option menus for slash commands such as /verbose now work correctly when Slack renders them as native buttons. Each button is now given a unique action ID while still routing through the shared openclaw_cmdarg* listener. Previously, Slack could reject or misroute option selections when multiple buttons shared the same action ID.
Direct Message Routing
Live DM replies now correctly route back to the concrete inbound DM channel while keeping persisted routing metadata user-scoped. This ensures that normal assistant replies arrive reliably when pairing, and system messages continue to work as expected.
Token Resolution
OpenClaw correctly resolves SecretRef-backed bot tokens before passing them to file download operations. This ensures that tokens referenced from secret stores work reliably after a configuration reload, so downloadFile operations no longer fail with token resolution errors.
ACP Block Replies
Slack ACP (Advanced Channel Platform) block replies are now treated as visible delivered output. This means OpenClaw stops re-sending the final fallback text after Slack has already rendered the reply, preventing duplicate messages.
Partial Streaming
Turn-local deduplication is now keyed by dispatch kind, and the final fallback reply path stays active when preview finalization fails. This prevents stale preview text from suppressing the actual final answer.
Recent Fixes (v2026.4.15)
- Live DM replies route to the correct concrete inbound DM channel
- Persisted routing metadata remains user-scoped for consistency
- System messages continue to arrive as expected
- Socket Mode honors HTTP(S) proxy settings, including NO_PROXY exclusions
- SecretRef-backed bot tokens resolve correctly for file operations
- ACP block replies are treated as visible delivered output
- Partial streaming deduplication is correct and doesn't suppress final answers
- Slash command option menus now work correctly with unique action IDs per button
Security Recommendations
Restrict bot access to dedicated channels. Don't add your agent bot to every channel in your workspace. Create a #assistant channel and invite the bot there.
Minimal scopes. Only request the OAuth scopes you actually need. Avoid channels:read on all channels — be specific.
Separate workspaces. If you're using this for personal purposes in a work Slack, consider creating a personal workspace instead of mixing them.
Store tokens in environment variables, never directly in config files. Your openclaw.json should only reference ${SLACK_BOT_TOKEN}, not the actual token value.
Related channels
Personal use on your phone? Telegram or iMessage are simpler to set up for personal daily-use without workspace management.
Enterprise and need Microsoft? Microsoft Teams uses the official Teams SDK with full enterprise access controls.
Comparing OpenClaw to other tools? See OpenClaw vs ChatGPT — Slack integration is one of the key differentiators. ChatGPT has no native Slack channel; OpenClaw lives directly in your workspace.
Threading
With threadReplies: true, your agent responds in threads rather than the main channel. This keeps channels clean and makes it easy to track conversations.
To start a fresh conversation, message the bot directly (DM) rather than in a channel.
Thread alias fix (v2026.4.21)
As of v2026.4.21, thread aliases are preserved in runtime outbound sends. If you supply threadTs in a custom reply or automation, the message now correctly stays in the intended thread — previously, generic runtime sends could drop the thread context and post to the channel root instead. (#62947) Thanks @bek91.
Group DMs (v2026.4.23)
New in v2026.4.23
Multi-person group DMs (MPIMs) are now classified as group chat context. OpenClaw suppresses verbose tool and plan progress messages on non-DM Slack surfaces, so internal "Working…" traces no longer leak into group rooms. Tool-call progress still shows in 1:1 DMs where the owner expects it. (Fixes #70912)
Something not working?
Check the troubleshooting guide for common issues with gateway startup, channel connections, and automations.
FAQ
- Does Socket Mode require a paid Slack plan?
- No. Socket Mode is available on Slack's free tier. It uses a WebSocket connection from your server to Slack — no public URL or webhook endpoint needed. This makes OpenClaw work behind firewalls and corporate VPNs without any network configuration.
- Can the Slack bot respond in public channels?
- Yes. Add channels:history to the bot's token scopes and specify the channel ID in allowedChannels in your OpenClaw config. The bot can also respond in DMs and to @mentions in any channel it has been invited to. You control exactly which channels it monitors.
- Will the bot work in a Slack organization I don't administer?
- Only if a workspace admin installs it. Slack requires admin approval to install third-party apps. If you're in a corporate Slack, you'll need IT or admin sign-off. For personal or small team use where you are the admin, the installation takes about 5 minutes.