Skip to main content
Slack integration with OpenClaw uses Socket Mode, which provides a WebSocket connection for receiving events without exposing a public HTTP endpoint. You’ll need both a bot token (xoxb-…) and an app-level token (xapp-…).

Quick Start

The fastest way to set up Slack is with the interactive onboarding:
Select Slack and follow the prompts to enter your tokens.

Creating a Slack App

1

Create a new app

  1. Go to Slack API: Your Apps
  2. Click “Create New App”
  3. Choose “From scratch”
  4. Give your app a name (e.g., “OpenClaw Bot”)
  5. Select the workspace where you want to install it
  6. Click “Create App”
2

Enable Socket Mode

  1. In the left sidebar, click “Socket Mode”
  2. Toggle “Enable Socket Mode” on
  3. Give your token a name (e.g., “OpenClaw Socket”)
  4. Click “Generate”
  5. Copy the app-level token (starts with xapp-)
  6. Save this token - you’ll need it later
3

Configure OAuth scopes

  1. Go to “OAuth & Permissions” in the sidebar
  2. Scroll to “Scopes” → “Bot Token Scopes”
  3. Add these scopes:
    • chat:write - Send messages
    • channels:history - Read public channel messages
    • channels:read - View public channels
    • groups:history - Read private channel messages
    • im:history - Read DM messages
    • mpim:history - Read multi-person DM messages
    • users:read - View users
    • app_mentions:read - Receive @mentions
    • reactions:read - Read reactions
    • reactions:write - Add reactions
    • files:read - Read files
    • files:write - Upload files
    • pins:read - Read pinned messages
    • pins:write - Pin messages
    • commands - Use slash commands
4

Install app to workspace

  1. Go to “OAuth & Permissions”
  2. Click “Install to Workspace” (or “Reinstall to Workspace” if you added new scopes)
  3. Review permissions and click “Allow”
  4. Copy the Bot User OAuth Token (starts with xoxb-)
  5. Save this token - you’ll need it for configuration
5

Enable events (optional but recommended)

  1. Go to “Event Subscriptions” in the sidebar
  2. Toggle “Enable Events” on
  3. Under “Subscribe to bot events”, add:
    • app_mention - Bot @mentions
    • message.channels - Public channel messages
    • message.groups - Private channel messages
    • message.im - Direct messages
    • message.mpim - Multi-person DMs
    • reaction_added - Reactions added
    • reaction_removed - Reactions removed
  4. Click “Save Changes”
6

Enable App Home (for DMs)

  1. Go to “App Home” in the sidebar
  2. Under “Show Tabs”, enable the “Messages Tab”
  3. Check “Allow users to send Slash commands and messages from the messages tab”

Configuration

Using Environment Variables

The simplest way to configure Slack:
Then enable in config:

Using Config File

Alternatively, store tokens directly in openclaw.config.json:

DM Policies

  • pairing (recommended): Unknown users get a pairing code; approve with openclaw pairing approve slack <userId>
  • allowlist: Only user IDs in allowFrom can DM the bot
  • open: Anyone can DM the bot (set allowFrom: ["*"])
  • disabled: Ignore all Slack DMs

Getting Your Slack User ID

Method 1: Check profile
  1. Click your profile picture in Slack
  2. Select “Profile”
  3. Click the three dots → “Copy member ID”
Method 2: Check logs
  1. DM your bot in Slack
  2. Run openclaw logs --follow
  3. Look for a line like:
Method 3: Use Slack API

Channel Configuration

Allowlist Specific Channels

To restrict the bot to specific channels:
To get channel IDs:
  1. Right-click the channel in Slack
  2. Select “View channel details”
  3. Scroll to the bottom - the ID is at the end
Or use the Slack API:

Per-Channel Settings

Resolving Channel Names

OpenClaw can resolve channel names to IDs:

Slash Commands

Slack slash commands let users trigger the bot with /command.

Creating a Slash Command

  1. Go to “Slash Commands” in your app settings
  2. Click “Create New Command”
  3. Set:
    • Command: /openclaw (or any name)
    • Request URL: Leave this for Socket Mode (not used)
    • Short Description: “Talk to OpenClaw”
    • Usage Hint: [message]
  4. Click “Save”
OpenClaw will automatically handle the command.

Thread Support

Slack threads are automatically detected and maintained. Messages in a thread will keep conversation context:

Interactive Components

Slack supports buttons, select menus, and other interactive elements. OpenClaw can render these in responses:

Multi-Account Support

You can connect to multiple Slack workspaces:

Troubleshooting

Check these common issues:
  1. Socket Mode is not enabled
    • Go to Slack API → Socket Mode → Toggle on
  2. Missing OAuth scopes
    • Verify all required scopes are added (see setup steps)
    • Reinstall the app after adding scopes
  3. Channel not in allowlist
    • Check channels configuration includes the channel ID
  4. Bot not invited to channel
    • Type /invite @BotName in the channel
Verify status:
Socket Mode requires both tokens:
  • Bot token (xoxb-…) - from “OAuth & Permissions”
  • App token (xapp-…) - from “Socket Mode”
Verify both are configured:
Ensure Event Subscriptions are configured:
  1. Go to “Event Subscriptions” in Slack API
  2. Enable events
  3. Subscribe to:
    • message.channels
    • message.groups
    • message.im
    • app_mention
  4. Save and reinstall the app
Enable the Messages tab in App Home:
  1. Go to “App Home” in Slack API
  2. Enable “Messages Tab”
  3. Check “Allow users to send Slash commands and messages from the messages tab”
Check that your tokens are correct and not expired:
  • Bot token starts with xoxb-
  • App token starts with xapp-
If tokens are invalid, regenerate them in the Slack API portal.

Security Considerations

  • Keep tokens secret - they give full access to your bot and workspace
  • Use environment variables instead of committing tokens to version control
  • Rotate tokens if they may have been exposed
  • Use allowlist mode for production bots
  • Review OAuth scopes - only grant what’s needed
  • Monitor bot activity via Slack’s audit logs

App Manifest (Quick Setup)

For quick setup, you can use this manifest when creating your app:

Next Steps

Signal Setup

Set up Signal as another channel

Pairing Guide

Learn about pairing codes and approvals

Configuration Reference

Full configuration options

Multi-Channel

Using multiple channels together