OpenClaw Slack Plugin
OpenClaw is a gateway for an AI agent that can be perform tasks and communicate across chat-based platforms like Slack. Doing so involves connecting OpenClaw to your Slack workspace with the OpenClaw Slack Plugin.
After installing the plugin, the OpenClaw agent becomes available to users in your workspace via assistant threads, the /openclaw slash command, and @mentions in channels by default.
0. Install OpenClaw and set up an agent
If you don't already have an OpenClaw agent, you'll need to make a quick detour. Follow the OpenClaw Getting Started Guide first to install OpenClaw and create your agent, then come back here to connect it to Slack.
1. Install the plugin
With Openclaw installed, open up a terminal and install the plugin with the following command.
openclaw plugins install @openclaw/slack
2. Create a Slack app
Now you'll need a Slack app to interface with your workspace. We've created two pre-configured Slack apps for you. They differ only in transport mode.
We recommend Socket Mode because it requires no public URL. The app will open a single WebSocket connection to Slack servers.
You can also use HTTP instead. Choose that if you're going to be running multiple copies of the same app, just know it requires a bit more setup.
Make your choice, click the corresponding button, and follow the steps over in App Settings. Then move on to step 3.
3. Configure tokens
- Socket Mode
- HTTP
When using Socket Mode, you need two tokens: an app-level token and a bot token.
Grab an app-level token
- In your app's settings, go to Basic Information.
- Scroll to the App-Level Tokens section and click Generate Token and Scopes.
- Name the token (e.g. "OpenClaw") and add the
connections:writescope. - Click Generate and copy the
xapp-token.
Grab a bot token
- In your app's settings, go to OAuth & Permissions.
- Under OAuth Tokens click Install to [workspace].
- After being returned to OAuth & Permissions, copy the Bot User OAuth Token (
xoxb-).
Set your environment variables
- macOS/Linux
- Windows
export SLACK_APP_TOKEN=xapp-...
export SLACK_BOT_TOKEN=xoxb-...
set SLACK_APP_TOKEN=xapp-...
set SLACK_BOT_TOKEN=xoxb-...
When using HTTP, you need two things: a bot token and a signing secret.
Grab a signing secret
- In your app's settings, go to Basic Information.
- In the App Credentials section, find the Signing Secret and click Show.
- Copy the signing secret. You'll use this to verify that incoming requests are from Slack.
Grab a bot token
- In your app's settings, go to OAuth & Permissions.
- Under OAuth Tokens click Install to [workspace].
- After being returned to OAuth & Permissions, copy the Bot User OAuth Token (
xoxb-).
Set up your request URL
The app manifest pre-fills https://gateway-host.example.com/slack/events as a placeholder. You'll need to update this to the public URL where your OpenClaw gateway will be hosted.
- In your app's settings, go to Event Subscriptions.
- Replace the placeholder request URL with your actual public URL (e.g.
https://your-domain.com/slack/events). - Slack will send a verification challenge to confirm your server is reachable. Make sure the gateway is running first (see step 4).
- Do the same under Interactivity & Shortcuts and Slash Commands.
Set your environment variables
- macOS/Linux
- Windows
export SLACK_SIGNING_SECRET=your-signing-secret
export SLACK_BOT_TOKEN=xoxb-...
set SLACK_SIGNING_SECRET=your-signing-secret
set SLACK_BOT_TOKEN=xoxb-...
4. Start the gateway
Run the following command to open a OpenClaw gateway. This establishes a connection to Slack and routes incoming messages to your agent:
openclaw gateway
Next steps
Your OpenClaw agent is now live in Slack. From here, we recommend you explore the OpenClaw docs. Perhaps the following will feel inspiring: