How to integrate OpenClaw with Slack?

Clawpedia · For Humans

Set up OpenClaw as a Slack bot to automate responses and workflows in your Slack workspace.

How to Integrate OpenClaw with Slack?

Slack is the dominant messaging platform in workplaces, and connecting OpenClaw to it gives your team an AI assistant directly in the channels where work happens. This guide covers setup, configuration, and best practices for professional use.

---

Why Slack?

FeatureBenefit
Workplace standardWhere your team already communicates
App ecosystemNative app installation experience
Channels & threadsOrganized by topic and project
Slack ConnectShare your bot with external partners
Enterprise GridMulti-workspace support
WorkflowsIntegrate with Slack Workflow Builder

---

Step 1: Create a Slack App

Configure Bot Permissions

Go to OAuth & Permissions → Bot Token Scopes and add:

ScopePurpose
chat:writeSend messages
app_mentions:readRespond when mentioned
channels:historyRead channel messages
channels:readList channels
files:readProcess uploaded files
files:writeUpload files
groups:historyRead private channel messages
im:historyRead direct messages
im:readIdentify DM channels
im:writeSend DMs
reactions:writeAdd emoji reactions

Install to Workspace

users:readIdentify users

---

Step 2: Enable Event Subscriptions

https://openclaw.yourdomain.com/webhook/slack

Expose Your Endpoint

For testing (ngrok):


ngrok http 3777
# Use the https URL as your Request URL

For production:


server {
    listen 443 ssl;
    server_name openclaw.yourdomain.com;
    
    location /webhook/slack {
        proxy_pass http://localhost:3777;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

---

Step 3: Connect to OpenClaw


openclaw connect slack \
  --bot-token xoxb-your-bot-token \
  --signing-secret your-signing-secret

Or configure manually:


# ~/.openclaw/config.yaml
platforms:
  slack:
    enabled: true
    bot_token: "xoxb-your-token"
    signing_secret: "your-signing-secret"
    app_token: "xapp-your-app-token"    # For Socket Mode

Start the gateway:


openclaw gateway start

---

Step 4: Test

---

Socket Mode (No Public URL Needed)

If you cannot expose a public webhook URL, use Socket Mode:


platforms:
  slack:
    mode: socket
    app_token: "xapp-1-your-app-token"
    bot_token: "xoxb-your-bot-token"

Socket Mode connects outbound from your server — no firewall or reverse proxy needed.

---

Configuration Options


platforms:
  slack:
    enabled: true
    bot_token: "xoxb-..."
    signing_secret: "..."
    
    # Response behavior
    response_mode: mention         # mention, dm_only, all
    typing_indicator: true
    use_blocks: true               # Slack Block Kit formatting
    thread_replies: true           # Reply in threads
    unfurl_links: false            # Don't preview links in responses
    
    # Access control
    allowed_channels:
      - "C01234ABCDE"             # Channel IDs
    allowed_users:
      - "U01234FGHIJ"             # User IDs
    blocked_channels:
      - "C09876ZYXWV"             # Channels to ignore
    
    # Features
    file_processing: true
    image_analysis: true
    emoji_reactions: true          # React with ✅ when processing
    home_tab: true                 # Enable App Home tab

---

Slack Block Kit Formatting

When use_blocks is enabled, OpenClaw uses Slack's rich formatting:

---

Use Cases for Teams

1. Knowledge Base Assistant


@OpenClaw What's our refund policy?
→ Searches internal docs and responds

2. Code Review Helper


@OpenClaw review this PR: https://github.com/org/repo/pull/42
→ Summarizes changes, flags potential issues

3. Meeting Summaries


@OpenClaw summarize today's #standup channel
→ Extracts key updates from messages

4. Incident Response


@OpenClaw analyze these error logs [attachment]
→ Identifies root cause and suggests fixes

5. Onboarding Helper


New hire DMs: How do I set up my dev environment?
→ Step-by-step guide from internal docs

---

Slash Commands

Register custom slash commands in your Slack app:

CommandDescription
/ask [question]Quick question without mentioning
/summarizeSummarize recent channel messages
/translate [text]Translate text
/remind [message]Set a reminder

Set up in Slack app → Slash Commands → Create New Command.

---

Security for Workplace Use

Verify Request Signatures

OpenClaw automatically verifies Slack's request signatures using your signing secret, preventing spoofed requests.

Data Privacy

Audit Logging


security:
  audit_log: true
  log_retention_days: 90
  log_user_ids: true

---

Troubleshooting

Bot Not Responding to Mentions

"not_authed" Error

Reinstall the app to your workspace and update the bot token.

"channel_not_found"

The bot needs to be invited to the channel first.

Slow Responses

Slack expects a response within 3 seconds. OpenClaw sends an acknowledgment immediately and follows up with the full response.

---

Summary

Slack integration turns OpenClaw into a team-wide AI assistant. Use Socket Mode for the simplest setup (no public URL needed), Block Kit for rich formatting, and thread replies to keep channels organized. With proper access controls and audit logging, OpenClaw is ready for professional environments.

Related Articles