How to Connect OpenClaw with Slack: A Complete Guide

?

Anonymous

March 3, 2026

0 views
How to Connect OpenClaw with Slack: A Complete Guide

How to Connect OpenClaw with Slack: A Complete Guide

You've got OpenClaw running locally, and now you need to connect a Slack channel. Maybe you've already connected WhatsApp or Telegram, but Slack requires a bit more setup. Let's walk through the complete process.

Prerequisites

Before we begin, make sure you have:

  1. OpenClaw installed and running — If not, check out this guide on installing OpenClaw on DigitalOcean
  2. A Slack account — Sign up at slack.com using Apple or Google authentication
  3. A Slack workspace — You'll have one by default when you create your account

Overview

The Slack integration process involves:

  1. Creating a Slack app with the right permissions
  2. Obtaining Bot and App tokens
  3. Configuring OpenClaw with these tokens
  4. Enabling Socket Mode and event subscriptions
  5. Registering the Slack channel

Let's get started.


Step 1: Create a Slack App

First, we need to create a Slack application that will act as the bridge between OpenClaw and your Slack workspace.

Navigate to Slack API

  1. Go to api.slack.com/apps
  2. Click "Create App" in the top right
  3. Select "From an app manifest"
  4. Choose your workspace from the dropdown

Configure the Manifest

Slack apps use a manifest file to define permissions and features. OpenClaw provides a ready-to-use manifest in its documentation.

Copy this manifest and paste it into the manifest editor:

{
  "display_information": {
    "name": "OpenClaw",
    "description": "Slack connector for OpenClaw"
  },
  "features": {
    "bot_user": {
      "display_name": "OpenClaw",
      "always_online": false
    },
    "app_home": {
      "messages_tab_enabled": true,
      "messages_tab_read_only_enabled": false
    },
    "slash_commands": [
      {
        "command": "/openclaw",
        "description": "Send a message to OpenClaw",
        "should_escape": false
      }
    ]
  },
  "oauth_config": {
    "scopes": {
      "bot": [
        "chat:write",
        "channels:history",
        "channels:read",
        "groups:history",
        "im:history",
        "mpim:history",
        "users:read",
        "app_mentions:read",
        "assistant:write",
        "reactions:read",
        "reactions:write",
        "pins:read",
        "pins:write",
        "emoji:read",
        "commands",
        "files:read",
        "files:write"
      ]
    }
  },
  "settings": {
    "socket_mode_enabled": true,
    "event_subscriptions": {
      "bot_events": [
        "app_mention",
        "message.channels",
        "message.groups",
        "message.im",
        "message.mpim",
        "reaction_added",
        "reaction_removed",
        "member_joined_channel",
        "member_left_channel",
        "channel_rename",
        "pin_added",
        "pin_removed"
      ]
    }
  }
}

Click Next, review the configuration, and click Create.


Step 2: Obtain the Bot Token

Now that the app is created, we need to get the Bot Token (OAuth Token).

  1. In your app settings, scroll to "OAuth & Permissions" in the left sidebar
  2. Under "Bot Token Scopes", you should see the permissions from the manifest already configured
  3. Scroll down to "OAuth Tokens for Your Workspace"
  4. Click "Install to Workspace"
  5. Review the permissions and click "Allow"
  6. Copy the Bot User OAuth Token (starts with xoxb-)

This token allows OpenClaw to post messages, react to messages, and interact with your workspace as a bot.


Step 3: Obtain the App-Level Token

Next, we need an App-Level Token for Socket Mode connections.

  1. In your app settings, click "Basic Information" at the top
  2. Scroll down to "App-Level Tokens"
  3. Click "Generate Token and Scopes"
  4. Give it a name (e.g., "OpenClaw App Token")
  5. Set the scope to connections:write
  6. Click "Generate Token"
  7. Copy the token (starts with xapp-)

This token enables Socket Mode, which allows OpenClaw to receive real-time events from Slack without exposing a public webhook URL.


Step 4: Get Your User ID

To enable direct messages from your profile, we need your Slack user ID.

  1. In Slack, go to the bottom-left corner
  2. Click on your profile picture
  3. Select "Copy a link to profile" from the three-dot menu
  4. Paste the link — it will look like: https://yourworkspace.slack.com/team/UXXXXXXXXXX
  5. Extract the ID (the part after /team/): UXXXXXXXXXX

This ID goes into the allowFrom array in OpenClaw's configuration.


Step 5: Configure OpenClaw

Now let's add the Slack channel to OpenClaw's configuration.

Access the Config

  1. Open your OpenClaw configuration file (usually ~/.openclaw/config.yaml or similar)
  2. If available, switch to RAW/JSON mode to see the configuration as JSON
  3. Scroll to the bottom or find where channels are defined

Add Slack Configuration

Add the Slack channel configuration at the same level as other channels:

{
  "channels": {
    "slack": {
      "mode": "socket",
      "webhookPath": "/slack/events",
      "enabled": true,
      "appToken": "xapp-YOUR_APP_TOKEN",
      "botToken": "xoxb-YOUR_BOT_TOKEN",
      "userTokenReadOnly": false,
      "groupPolicy": "allowlist",
      "slashCommand": {
        "enabled": true,
        "name": "openclaw",
        "sessionPrefix": "slack:slash",
        "ephemeral": false
      },
      "dm": {
        "enabled": true,
        "policy": "allowlist",
        "allowFrom": [
          "UYOUR_USER_ID"
        ]
      },
      "channels": {
        "#general-workspace-name": {
          "allow": true,
          "requireMention": true
        }
      }
    }
  }
}

Replace the Tokens

Update these three fields:

  1. appToken — Paste the token from Step 3 (starts with xapp-)
  2. botToken — Paste the token from Step 2 (starts with xoxb-)
  3. allowFrom — Replace with your user ID from Step 4

Important: Channel Naming

The default configuration only includes #general, but Slack channels are named #general-workspace-name. Update the channel name to match your exact Slack channel.

Save the configuration.


Step 6: Finalize Slack App Settings

There are a few more settings to verify in your Slack app.

Enable App Features

  1. Go to "Basic Information" in your app settings
  2. Scroll to "Display Information"
  3. Click "Edit" next to "App Display Name"
  4. Ensure these are enabled:
    • Messages Tab — For DM conversations
    • Home Tab — For the bot's home screen
  5. Under "Bot User", enable "Always Show My Bot as Online" (optional but recommended)

Verify Socket Mode

  1. Go to "Socket Mode" in the left sidebar
  2. Ensure "Enable Socket Mode" is checked
  3. This is critical — without it, OpenClaw won't receive events

Verify Event Subscriptions

  1. Go to "Event Subscriptions" in the left sidebar
  2. Ensure "Enable Events" is checked
  3. Review the bot events list — if you used the manifest, these should already be configured:
    • app_mention
    • message.channels
    • message.groups
    • message.im
    • message.mpim
    • reaction_added
    • reaction_removed
    • member_joined_channel
    • member_left_channel
    • channel_rename
    • pin_added
    • pin_removed

Step 7: Add Missing Bot Permissions

There's one critical step that's often missed — OpenClaw's documentation manifest is missing some permissions required for direct messaging.

Add IM and MPIM Permissions

  1. Go to "OAuth & Permissions" in your app settings
  2. Under "Bot Token Scopes", add:
    • im:read — Read direct messages
    • mpim:read — Read multi-person direct messages
    • mpim:write — Write to multi-person direct messages

Reinstall the App

After adding new permissions, Slack requires you to reinstall the app:

  1. Scroll down to "OAuth Tokens for Your Workspace"
  2. Click "Reinstall to Workspace" (or find it in the sidebar under "Install App")
  3. Review the permissions and click "Allow"

This is crucial — without these permissions, OpenClaw won't be able to respond to direct messages.


Step 8: Restart OpenClaw

For the configuration changes to take effect, restart the OpenClaw gateway.

If Running in a Container

docker restart openclaw

If Running Directly

pnpm openclaw gateway stop
pnpm openclaw gateway start

OpenClaw should now be running with the Slack configuration active.


Step 9: Test the Connection

Let's verify that everything is working.

Test Direct Message

  1. In Slack, you should see a new app installed (named whatever you called it in the manifest, e.g., "OpenClaw")
  2. Open a direct message with the bot
  3. Send a message: Hola, ¿cómo estás?
  4. Wait a moment — you should see the bot typing indicator appear
  5. The bot should respond

Test Channel Mention

  1. Go to the channel you configured (e.g., #general-workspace-name)
  2. Send a message mentioning OpenClaw: @OpenClaw hola
  3. The first time you do this, you may see a notification saying the bot isn't in the channel
  4. Add the bot to the channel (invite the app to the channel)
  5. Try again — the bot should respond in the channel

Verify in OpenClaw

In OpenClaw's chat interface, you should see messages appearing from both:

  • The DM conversation
  • The channel mentions (these create separate sessions)

Understanding the Configuration

Let's break down what each part of the configuration does.

Socket Mode

"mode": "socket"

Socket Mode allows OpenClaw to connect to Slack via WebSocket rather than requiring a public webhook URL. This is more secure and works better for local installations.

Slash Commands

"slashCommand": {
  "enabled": true,
  "name": "openclaw",
  "sessionPrefix": "slack:slash",
  "ephemeral": false
}

This enables the /openclaw slash command in Slack. When you use it, messages go through a session with the slack:slash prefix. Setting ephemeral: false makes responses visible to everyone in the channel.

Direct Messages

"dm": {
  "enabled": true,
  "policy": "allowlist",
  "allowFrom": ["UYOUR_USER_ID"]
}

This enables DM conversations with the bot. The allowlist policy means only users in the allowFrom array can send DMs to the bot. Replace UYOUR_USER_ID with your actual Slack user ID.

Channel Access

"channels": {
  "#general-workspace-name": {
    "allow": true,
    "requireMention": true
  }
}

This configures which channels the bot can access. Setting requireMention: true means the bot only responds when explicitly mentioned with @OpenClaw.


Common Issues and Solutions

Bot Not Responding in DM

Problem: You send a DM, but the bot doesn't respond.

Solution: Verify you added the missing permissions (im:read, mpim:read, mpim:write) and reinstalled the app. Also, check that your user ID is correct in allowFrom.

Bot Not Responding in Channel

Problem: The bot doesn't respond to mentions in the channel.

Solution: Ensure the channel name in OpenClaw's config matches the exact Slack channel name (including the workspace suffix). Also, verify the bot has been added to the channel.

Socket Mode Not Connecting

Problem: Socket Mode fails to connect.

Solution: Verify that socket_mode_enabled is set to true in the Slack app settings and that you have a valid appToken in OpenClaw's config.

Events Not Being Received

Problem: OpenClaw doesn't receive message events.

Solution: Check that all required bot events are subscribed in the Slack app's Event Subscriptions. Compare your list with the manifest — if anything is missing, add it.

Incorrect Channel Name

Problem: Configuration works for DMs but not channels.

Solution: Slack channels include the workspace name (e.g., #general-workspace-name), not just #general. Update your config to match the exact channel name from Slack.


Best Practices

Security

  • Never commit tokens to version control
  • Store sensitive values in environment variables if possible
  • Use allowlist policies for DM and channel access
  • Regularly rotate tokens if your workspace security requirements demand it

Channel Organization

  • Consider creating a dedicated channel for OpenClaw interactions
  • Use descriptive channel names (e.g., #openclaw-workspace-name)
  • Document which channels have OpenClaw access for your team

User Access

  • Keep the allowFrom list minimal — only add users who need DM access
  • For team use, channel mentions are preferable to DMs
  • Educate users about the /openclaw slash command

Troubleshooting Checklist

If the connection isn't working, run through this checklist:

  • Bot token starts with xoxb- and is correct
  • App token starts with xapp- and is correct
  • User ID in allowFrom is correct
  • Channel name in config matches Slack exactly
  • Socket Mode is enabled in Slack app
  • Event Subscriptions are enabled and configured
  • im:read, mpim:read, mpim:write permissions are added
  • App was reinstalled after adding new permissions
  • Bot has been added to the channel (for channel access)
  • OpenClaw gateway has been restarted after config changes

What You Can Do With Slack + OpenClaw

Once connected, you can:

  • Ask questions — Get AI-powered answers directly in Slack
  • Execute commands — Run scripts or commands via OpenClaw
  • Manage tasks — Create to-dos, reminders, and notes
  • Code assistance — Get help with debugging or code generation
  • File sharing — Send files to OpenClaw for analysis
  • Reactions — Use emoji reactions to interact with messages
  • Pinning — Pin important messages for later reference

All of this happens from within your familiar Slack workspace, no need to switch applications.


Resources

Official Documentation

Slack Resources

Related Tutorials


Conclusion

Connecting OpenClaw to Slack requires a bit more setup than other integrations, but the payoff is worth it. You get a powerful AI assistant that lives directly in your workspace, ready to help with questions, tasks, and automation.

Key takeaways:

  • Use the manifest template to ensure all permissions are configured correctly
  • Don't forget to add the im:read, mpim:read, and mpim:write permissions
  • Channel names include the workspace suffix (e.g., #general-workspace-name)
  • Restart the OpenClaw gateway after config changes
  • Test both DM and channel communication

Now go get connected — your AI-powered productivity boost is just a Slack message away.


Want more OpenClaw tutorials? Check out my YouTube channel for step-by-step guides on installing, configuring, and maximizing OpenClaw.

openclawslackaiintegrationtutorial