Slack Setup Guide

Connect OpenClaw to your Slack workspace. About 6 minutes.

⏱️ ~6 minutes

Prerequisites

  • βœ… OpenClaw installed and running (Quick Start)
  • βœ… A Slack workspace where you can install apps
  • βœ… About 6 minutes
1

Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New App β†’ From scratch
  3. Name your app (e.g. "OpenClaw")
  4. Pick your workspace β†’ Create App
πŸ’‘

Choose "From scratch" β€” it's the simpler option.

2

Enable Socket Mode

Socket Mode lets your bot connect without a public URL β€” no server setup needed.

  1. In the left sidebar, go to Socket Mode
  2. Toggle it ON
  3. Go to Basic Information β†’ App-Level Tokens (scroll down)
  4. Click Generate Token and Scopes
  5. Name it anything (e.g. "openclaw") β†’ add scope connections:write
  6. Click Generate β†’ copy the App Token
πŸ’‘

The App Token starts with xapp-. You'll need this in Step 5.

3

Set Permissions & Events

First, add the scopes your bot needs:

  1. Go to OAuth & Permissions in the left sidebar
  2. Scroll to Bot Token Scopes and add these scopes:
    • chat:write β€” send messages
    • im:history β€” read DM history
    • im:read β€” view DM channels
    • im:write β€” open DM channels
    • app_mentions:read β€” detect @mentions

Then, subscribe to events so your bot gets notified:

  1. Go to Event Subscriptions in the left sidebar
  2. Toggle Enable Events β†’ ON
  3. Under Subscribe to bot events, add:
    • message.im β€” when someone DMs the bot
    • app_mention β€” when someone @mentions the bot
  4. Click Save Changes
4

Install & Get Bot Token

  1. Go to Install App in the left sidebar
  2. Click Install to Workspace β†’ Allow
  3. Copy the Bot User OAuth Token
⚠️

Copy the Bot token (starts with xoxb-), not the User token (xoxp-).

One more thing β€” enable DMs:

  1. Go to App Home in the left sidebar
  2. Turn ON the Messages Tab
πŸ’‘

This lets users send direct messages to your bot from the Slack sidebar.

5

Configure OpenClaw

Run the setup wizard β€” you'll need both tokens from earlier:

openclaw init

Select Slack when prompted. Paste the App Token (xapp-) and Bot Token (xoxb-) when asked.

Or edit the config file manually

Add this to ~/.openclaw/config.yaml:

channels:
  slack:
    appToken: "xapp-YOUR_APP_TOKEN"
    botToken: "xoxb-YOUR_BOT_TOKEN"
    enabled: true
6

Start & Test

Start the gateway:

openclaw gateway start

Open Slack and send a direct message to your bot (find it under Apps in the sidebar).

You: Hello!

Bot: Hi! I'm your OpenClaw assistant. How can I help?

πŸŽ‰

Success! Your Slack bot is now connected to OpenClaw.

+

Bonus: Channel Mentions

Your bot also responds to @mentions in channels. Just invite it to a channel and type @YourApp how's the weather?

πŸ’‘

To invite the bot to a channel: type /invite @YourApp in that channel.

Troubleshooting

Bot doesn't respond to DMs

Make sure the Messages Tab is turned on in App Home (Step 4). Also check that message.im event is subscribed (Step 3).

Connection error on startup

Double-check that Socket Mode is enabled and the App Token (xapp-) is correct.

"not_allowed_token_type" error

You mixed up the tokens. The App Token starts with xapp- and the Bot Token starts with xoxb-.

Bot responds slowly

This is normal for the first message. Subsequent messages should be faster.