Home Channels & Messaging OpenClaw Slack Integration
Business Messaging Slack Workplace AI

OpenClaw Slack Integration: The Automatic Workplace AI Setup

A properly configured OpenClaw Slack bot handles hundreds of team requests without a single manual intervention. Getting the token scopes wrong means it handles zero. Here's exactly how to do it right.

AL
A. Larsen
Integration Engineer
Feb 7, 2025 16 min read 11.3k views
Updated Mar 2025
Key Takeaways
Create the Slack app at api.slack.com/apps — you need a Slack account in the target workspace, not necessarily admin access to start.
Minimum required scopes: chat:write, app_mentions:read, channels:history. Add im:history for DMs.
Event Subscriptions must point to your OpenClaw gateway URL — Slack will send a challenge request that OpenClaw must respond to within 3 seconds.
Enterprise workspaces often require admin approval before a new bot can post — get this sorted before demo day.
Thread replies keep channels clean — set thread_replies: true in your channel config from day one.

Slack is where most teams already live. Getting OpenClaw into Slack means AI agents operate exactly where your team asks questions — no separate interface, no workflow change. The setup takes under 20 minutes with the right scopes from the start. The wrong scopes cost hours of debugging and a second approval cycle from your workspace admin.

Create a Slack App

Navigate to api.slack.com/apps and click "Create New App." Choose "From scratch" rather than from a manifest — the manifest approach is faster but obscures the individual settings you need to understand for debugging.

Give the app a name. "OpenClaw" or "[YourTeam] AI" works well. Select the target workspace. Click "Create App."

You're now in the app configuration dashboard. Two sections matter most: "OAuth & Permissions" (for scopes) and "Event Subscriptions" (for receiving messages). We'll cover both in order.

💡
One app, one workspace
A single Slack app installation covers one workspace. If you need OpenClaw in multiple workspaces, you'll either create multiple apps or distribute the app publicly via Slack's app distribution feature. For most teams, one app per workspace is the right approach.

Bot Token Scopes

Go to "OAuth & Permissions" in the left sidebar. Scroll to "Scopes" → "Bot Token Scopes." Add each scope listed here. Adding the wrong scopes — or too few — is the single most common cause of failed Slack integrations.

Scope Required For Required?
chat:write Sending messages and replies Yes
app_mentions:read Receiving @mentions Yes
channels:history Reading public channel messages Yes
im:history Reading direct messages Optional
im:read Listing DM conversations Optional
commands Slash command support Optional
groups:history Private channel messages Optional

After adding scopes, scroll up and click "Install to Workspace." Slack will show an OAuth screen — approve it. You'll land on a page showing your Bot User OAuth Token, starting with xoxb-. Copy this. It's the SLACK_BOT_TOKEN environment variable OpenClaw needs.

Event Subscriptions

Go to "Event Subscriptions" in the sidebar. Toggle "Enable Events" on. Paste your OpenClaw gateway URL in the "Request URL" field. The URL format is:

https://gateway.openclaw.io/webhooks/YOUR-AGENT-ID/slack

Slack will immediately send a challenge request to this URL. OpenClaw's gateway handles this automatically — the URL field should turn green with "Verified" within 3 seconds. If it shows an error, your gateway URL is either unreachable or the agent ID is wrong.

Under "Subscribe to Bot Events," add:

Save changes. Slack will ask you to reinstall the app — do it. New scopes and event subscriptions don't take effect until after reinstallation.

⚠️
Reinstall after every scope change
Every time you add or remove a scope in the Slack app config, you must reinstall the app. The OAuth token doesn't update automatically. Reinstall from "OAuth & Permissions" → "Install to Workspace." This is the most frequently missed step that causes "permission denied" errors in production.

Connect OpenClaw to Slack

With the bot token in hand and events configured, connecting OpenClaw is a single command:

# Set the bot token environment variable
export SLACK_BOT_TOKEN="xoxb-your-token-here"

# Add the Slack channel
openclaw channels add slack \
  --token "$SLACK_BOT_TOKEN" \
  --thread-replies true

# Verify
openclaw channels status slack

A successful connection shows:

Slack channel connected.
Workspace: Your Workspace Name
Bot user: @openclaw (ID: UXXXXXXXX)
Thread replies: enabled
Status: active

Now invite the bot to a test channel in Slack: /invite @openclaw. Then @mention it: @openclaw hello. Watch the OpenClaw logs:

openclaw logs --channel slack --follow

# Expected:
# [Slack] app_mention from U12345 in #general: "hello"
# [Agent] Routing through pipeline...
# [Slack] Reply posted in thread

Setting Up Slash Commands

Slash commands give team members a cleaner interface than @mentions for specific agent actions. Go to "Slash Commands" in the Slack app sidebar and click "Create New Command."

Example command configuration:

In your OpenClaw agent config, map the slash command to a skill:

# openclaw.config.yaml
channels:
  slack:
    slash_commands:
      /ask:
        skill: general_qa
        thread_reply: true
      /summarize:
        skill: channel_summary
        thread_reply: true

Workspace Admin Requirements

If your Slack workspace has "Restrict app installations" enabled — common in enterprise workspaces — your admin must approve the app before it can be installed. Submit the app for approval through the Slack admin portal.

What admins typically check: the scopes requested (fewer is better), whether the app is from a known publisher, and the event subscription URL domain. Make sure your OpenClaw gateway URL is on a domain your IT team won't flag.

In our experience, approval takes 24–72 hours in enterprise settings. Request it well before any planned rollout.

Common Errors and Fixes

Socket Timeout

Log entry: [Slack] Event delivery failed: socket timeout after 3000ms. Your OpenClaw gateway is taking too long to acknowledge the Slack event. Slack requires a 200 response within 3 seconds. If your gateway is under load or on a slow host, events will be dropped. Check gateway response times with openclaw gateway stats and consider upgrading your hosting tier.

Missing Scopes Error

Bot can receive mentions but can't reply: missing chat:write. Bot can't read channel history: missing channels:history. The error in OpenClaw logs will reference a Slack API error code — look it up in Slack's error reference at api.slack.com/methods. Always reinstall the app after adding missing scopes.

Bot Not Responding After App Reinstall

The environment variable SLACK_BOT_TOKEN in your OpenClaw config still has the old token. A reinstall generates a new bot token. Copy the new xoxb- token from the OAuth page and update the env var. Restart OpenClaw with openclaw restart.

Frequently Asked Questions

Do I need to be a Slack workspace admin to set up OpenClaw?

You need admin access or a workspace admin to approve the app installation. Creating the Slack app at api.slack.com only requires a standard account, but installing it into a workspace with restricted app permissions requires admin approval.

What Slack Bot Token Scopes does OpenClaw require?

The minimum required scopes are chat:write, app_mentions:read, and channels:history. For DM support, add im:history and im:read. For slash commands, add the commands scope. Adding unnecessary scopes may trigger security reviews in enterprise workspaces.

Why is my OpenClaw Slack bot not responding to @mentions?

The most common causes are: Event Subscriptions not enabled in the Slack app config, the event URL returning an error, or app_mentions:read scope missing. Check that your OpenClaw gateway URL is publicly accessible and returning 200 on the Slack challenge handshake.

Can OpenClaw respond in Slack threads instead of the main channel?

Yes. Set thread_replies: true in your openclaw.config.yaml under the slack channel block. OpenClaw will post all replies as thread responses to the triggering message rather than as new top-level messages, which keeps channels clean.

Does the Slack integration work in private channels?

Private channels require the groups:history and groups:read scopes in addition to the standard ones. The bot must also be explicitly invited to the private channel with /invite @your-bot-name before it can read messages there.

What causes the 'socket timeout' error in OpenClaw Slack logs?

Socket timeout means OpenClaw's gateway is not receiving Slack event payloads within the required 3-second window. Check that your gateway URL is fast to respond and not under heavy load. Slack retries failed events three times before dropping them.

AL
A. Larsen
Integration Engineer
A. Larsen has built and maintained OpenClaw Slack integrations for engineering and product teams at three different SaaS companies. She wrote the OpenClaw Slack channel adapter's thread-reply feature and regularly answers Slack integration questions in the OpenClaw community Discord. Her setups handle over 2,000 agent interactions per day in production.

Your team has an AI agent in Slack.

No separate interface. No context switching. Every @mention routes through your agent pipeline and replies directly in thread — from any channel, any device. Setup complete in under 20 minutes, free to use, zero new tools for your team to learn.

Next: Microsoft Teams Setup →
Get the OpenClaw build digest
New guides, channel updates, and community tips — weekly, no filler.