OpenClaw Slack Channel
Connect OpenClaw to Slack using Socket Mode (default) or HTTP Events API. This enterprise-grade integration lets your AI assistant operate in Slack workspaces — handling DMs, channel conversations, reactions, threads, and slash commands. Socket Mode connects via WebSocket with no public URL required; HTTP mode uses Slack's Events API for publicly accessible deployments.
Slack Supported Features
Text Messages
Supported
Media & Files
Supported
Reactions
Supported
Threads
Supported
Voice Messages
Not Supported
Group Chat
Supported
Slack Prerequisites
- A Slack workspace with admin privileges (to install custom apps)
- A Slack App created at api.slack.com/apps
- App Token (xapp-...) with connections:write scope (for Socket Mode)
- Bot Token (xoxb-...) obtained after installing the app to your workspace
- OpenClaw Gateway running and configured
Slack Quick Setup
Create Slack App and enable Socket Mode
Go to api.slack.com/apps and click 'Create New App' → 'From scratch'. Give it a name and select your workspace. Navigate to 'Socket Mode' in the sidebar and enable it. Generate an App-Level Token with the 'connections:write' scope — this gives you the xapp-... token.
Configure OAuth scopes and install to workspace
Go to 'OAuth & Permissions', add the required Bot Token Scopes (chat:write, channels:history, channels:read, im:write, im:history, im:read, users:read, reactions:read, reactions:write, files:write, etc.). Click 'Install to Workspace' and authorize. Copy the Bot User OAuth Token (xoxb-...). Then go to 'Event Subscriptions', enable events, and subscribe to: message.channels, message.groups, message.im, message.mpim, app_mention, reaction_added, reaction_removed.
Add config, start Gateway, and invite bot
Add the Slack channel configuration to ~/.openclaw/openclaw.json with your appToken and botToken. Start the Gateway — it will connect to Slack via Socket Mode. Invite the bot to your target channels by typing '/invite @YourBotName' in Slack. Send a message to test.
Slack Configuration Example
{
"channels": {
"slack": {
"enabled": true,
"appToken": "xapp-1-YOUR_APP_TOKEN",
"botToken": "xoxb-YOUR_BOT_TOKEN"
}
}
}
Slack Deep Dive
Architecture Overview
Creating Your Slack App
DM Security (Pairing)
{
"channels": {
"slack": {
"enabled": true,
"appToken": "xapp-...",
"botToken": "xoxb-...",
"dm": {
"policy": "pairing",
"allowFrom": ["U01ABCDEF", "user@company.com"]
}
}
}
}
Channel Configuration (Group Policy)
{
"channels": {
"slack": {
"groupPolicy": "allowlist",
"channels": {
"C01ABCDEF": {
"allow": true,
"requireMention": true,
"users": ["U01ABCDEF"],
"skills": ["search", "docs"],
"systemPrompt": "Keep answers short and technical."
},
"#general": {
"allow": true,
"requireMention": true
}
}
}
}
}
Reply Threading
{
"channels": {
"slack": {
"replyToMode": "off",
"replyToModeByChatType": {
"direct": "all",
"group": "first",
"channel": "off"
}
}
}
}
User Token (Optional)
{
"channels": {
"slack": {
"enabled": true,
"appToken": "xapp-...",
"botToken": "xoxb-...",
"userToken": "xoxp-...",
"userTokenReadOnly": true
}
}
}
Slash Commands & App Home
{
"channels": {
"slack": {
"slashCommand": {
"enabled": true,
"name": "openclaw",
"sessionPrefix": "slack:slash",
"ephemeral": true
}
}
}
}
Permissions & Scopes
HTTP Mode (Events API)
{
"channels": {
"slack": {
"enabled": true,
"mode": "http",
"botToken": "xoxb-...",
"signingSecret": "your-signing-secret",
"webhookPath": "/slack/events"
}
}
}
Advanced Configuration
{
"channels": {
"slack": {
"historyLimit": 50,
"textChunkLimit": 4000,
"chunkMode": "newline",
"mediaMaxMb": 20,
"actions": {
"reactions": true,
"messages": true,
"pins": true,
"memberInfo": true,
"emojiList": true
}
}
}
}
Slack Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the Slack channel |
| mode | string | "socket" | Connection mode. Options: socket (Socket Mode, default), http (Events API) |
| appToken | string | "" | Slack App-Level Token (xapp-...) for Socket Mode. Can also use SLACK_APP_TOKEN env var |
| botToken | string | "" | Slack Bot User OAuth Token (xoxb-...). Can also use SLACK_BOT_TOKEN env var |
| userToken | string | "" | Optional Slack User Token (xoxp-...) for enhanced read access |
| userTokenReadOnly | boolean | true | Restrict User Token to read-only operations. Set false to allow writes as the installing user |
| signingSecret | string | "" | Signing Secret for HTTP mode request verification (from Basic Information → App Credentials) |
| webhookPath | string | "/slack/events" | Webhook endpoint path for HTTP mode |
| dm.policy | string | "pairing" | DM access control policy. Options: pairing (code-based approval), open (anyone can DM) |
| dm.allowFrom | string[] | [] | Users allowed to DM the bot. Supports user IDs, @usernames, emails, and wildcard (*) |
| dm.enabled | boolean | true | Whether to accept direct messages |
| dm.groupEnabled | boolean | false | Enable group DM (MPIM) handling |
| dm.groupChannels | string[] | [] | Allowed group DM channel IDs |
| groupPolicy | string | "open" | Channel handling policy. Options: open (all channels), disabled (no channels), allowlist (configured only) |
| channels.<id>.allow | boolean | true | Allow or deny this channel in allowlist mode |
| channels.<id>.requireMention | boolean | false | Whether the bot needs @mention to respond in this channel |
| channels.<id>.users | string[] | [] | User allowlist for this channel (IDs, @usernames, or emails) |
| channels.<id>.skills | string[] | [] | Restrict available skills in this channel (empty = all skills) |
| channels.<id>.systemPrompt | string | "" | Custom AI system prompt for this channel |
| channels.<id>.allowBots | boolean | false | Process messages from other bots in this channel |
| replyToMode | string | "off" | Reply threading mode. Options: off (main channel), first (thread first reply), all (thread all replies) |
| replyToModeByChatType | object | {} | Per-chat-type threading overrides. Keys: direct, group, channel. Values: off, first, all |
| reactionNotifications | string | "off" | Which reactions trigger agent notifications. Options: off, own, all |
| historyLimit | number | 50 | Number of recent messages to include as AI context. Set to 0 to disable |
| textChunkLimit | number | 4000 | Maximum characters per message chunk for long AI responses |
| chunkMode | string | "split" | How to split long responses. Options: split (hard limit), newline (paragraph boundaries) |
| mediaMaxMb | number | 20 | Maximum media file size in megabytes |
| slashCommand.enabled | boolean | true | Enable slash command handling |
| slashCommand.name | string | "openclaw" | The slash command name (without /) |
| slashCommand.ephemeral | boolean | true | Whether slash command responses are visible only to the invoker |
Enable or disable the Slack channel
Connection mode. Options: socket (Socket Mode, default), http (Events API)
Slack App-Level Token (xapp-...) for Socket Mode. Can also use SLACK_APP_TOKEN env var
Slack Bot User OAuth Token (xoxb-...). Can also use SLACK_BOT_TOKEN env var
Optional Slack User Token (xoxp-...) for enhanced read access
Restrict User Token to read-only operations. Set false to allow writes as the installing user
Signing Secret for HTTP mode request verification (from Basic Information → App Credentials)
Webhook endpoint path for HTTP mode
DM access control policy. Options: pairing (code-based approval), open (anyone can DM)
Users allowed to DM the bot. Supports user IDs, @usernames, emails, and wildcard (*)
Whether to accept direct messages
Enable group DM (MPIM) handling
Allowed group DM channel IDs
Channel handling policy. Options: open (all channels), disabled (no channels), allowlist (configured only)
Allow or deny this channel in allowlist mode
Whether the bot needs @mention to respond in this channel
User allowlist for this channel (IDs, @usernames, or emails)
Restrict available skills in this channel (empty = all skills)
Custom AI system prompt for this channel
Process messages from other bots in this channel
Reply threading mode. Options: off (main channel), first (thread first reply), all (thread all replies)
Per-chat-type threading overrides. Keys: direct, group, channel. Values: off, first, all
Which reactions trigger agent notifications. Options: off, own, all
Number of recent messages to include as AI context. Set to 0 to disable
Maximum characters per message chunk for long AI responses
How to split long responses. Options: split (hard limit), newline (paragraph boundaries)
Maximum media file size in megabytes
Enable slash command handling
The slash command name (without /)
Whether slash command responses are visible only to the invoker
Slack Frequently Asked Questions
Slack Troubleshooting
The channel is blocked by groupPolicy, or the bot isn't in the allowlist, or the bot hasn't been invited to the channel.
DM policy is set to 'pairing' and the sender hasn't been approved, or the Messages Tab isn't enabled in App Home.
The App Token (xapp-...) is invalid or expired, or there's a network issue between your server and Slack.
The Bot Token is missing required OAuth scopes, or the token has been revoked/regenerated.
The slash command wasn't created in the Slack API portal, or the request URL is misconfigured (HTTP mode).
Long AI responses exceed OpenClaw's textChunkLimit (default: 4,000 characters) and are automatically split into multiple messages. Note: Slack's own limits are 3,000 characters per section block and 40,000 characters per message text field.