Overview
Connect OpenClaw to Slack and bring AI assistance to your workspace:
- Channel conversations — AI responds in public/private channels
- Direct messages — Personal AI assistant for each user
- Thread replies — Contextual responses in threads
- Slash commands — Quick AI interactions
Prerequisites
- OpenClaw installed on your machine
- A Slack workspace where you have admin permissions
- Slack account with app creation rights
Step 1: Create a Slack App
- Go to Slack API Apps
- Click “Create New App”
- Choose “From scratch”
- Enter an app name (e.g., “AI Assistant”) and select your workspace
- Click Create App
Step 2: Configure Bot Permissions
Add OAuth Scopes
- Go to “OAuth & Permissions” in the sidebar
- Scroll to “Scopes” → “Bot Token Scopes”
- Add these scopes:
| Scope | Purpose |
|---|---|
chat:write | Send messages |
channels:history | Read channel messages |
groups:history | Read private channel messages |
im:history | Read DMs |
app_mentions:read | Respond to @mentions |
users:read | Get user info |
Step 3: Enable Event Subscriptions
- Go to “Event Subscriptions”
- Toggle “Enable Events” to On
- For Request URL, you’ll need a public endpoint. Options:
- Use ngrok for local development:
ngrok http 18789 - Deploy to a server with public IP
- Use ngrok for local development:
- Enter:
https://your-domain.com/slack/events - Under “Subscribe to bot events”, add:
app_mentionmessage.channelsmessage.groupsmessage.im
- Click Save Changes
Step 4: Install App to Workspace
- Go to “Install App” in the sidebar
- Click “Install to Workspace”
- Review permissions and click Allow
- Copy the Bot User OAuth Token (starts with
xoxb-)
Step 5: Get Signing Secret
- Go to “Basic Information”
- Under “App Credentials”, find Signing Secret
- Click Show and copy it
Step 6: Add Slack to OpenClaw
Run in your terminal:
openclaw channels add slack
Enter when prompted:
- Bot Token: Your
xoxb-token - Signing Secret: The signing secret from Basic Information
Or configure manually:
openclaw config set slack.botToken "xoxb-your-token"
openclaw config set slack.signingSecret "your-signing-secret"
Step 7: Start the Gateway
openclaw gateway
If using ngrok for development:
# In another terminal
ngrok http 18789
Update the Request URL in Slack with your ngrok URL.
Configuration Options
Restrict to Specific Channels
openclaw config set slack.allowedChannels "C01234567,C09876543"
Set Response Mode
# Respond only when mentioned (default)
openclaw config set slack.trigger mention
# Respond to all messages
openclaw config set slack.trigger all
Thread Behavior
# Always reply in threads (recommended for busy channels)
openclaw config set slack.replyInThread true
Slash Commands (Optional)
Add custom slash commands:
- Go to “Slash Commands” in your app settings
- Click “Create New Command”
- Configure:
- Command:
/ask - Request URL:
https://your-domain.com/slack/commands - Description: “Ask the AI assistant”
- Command:
- Save and reinstall the app
Production Deployment
For production use, deploy OpenClaw on a server:
Using Docker
docker run -d \
-e SLACK_BOT_TOKEN=xoxb-your-token \
-e SLACK_SIGNING_SECRET=your-secret \
-p 18789:18789 \
openclaw/openclaw gateway
Verify Webhook
Slack will send a challenge request to verify your endpoint. OpenClaw handles this automatically.
Troubleshooting
”URL Verification Failed”
- Ensure OpenClaw gateway is running
- Check the URL is publicly accessible
- Verify no firewall blocking port 18789
Bot Not Responding
- Check the bot is invited to the channel
- Verify OAuth scopes include
channels:history - Confirm events are subscribed correctly
”Invalid Signing Secret”
Re-copy the signing secret from Slack. Make sure there are no extra spaces.
Messages Delayed
If using ngrok free tier, connections may timeout. Consider:
- Upgrading ngrok
- Deploying to a cloud server
- Using Slack’s Socket Mode (no public URL needed)
Socket Mode (Alternative)
For local development without a public URL:
- Go to “Socket Mode” in app settings
- Enable Socket Mode
- Generate an App-Level Token with
connections:writescope - Configure OpenClaw:
openclaw config set slack.socketMode true
openclaw config set slack.appToken "xapp-your-app-token"
Next Steps
- Connect Discord — For community servers
- Connect Signal — Secure messaging
- Voice Assistant — Voice interaction