Channel setup

10 min read

Slack Integration

Connect OpenClaw to Slack and interact with your AI agent from channels, DMs, and threads. Full setup guide with bot creation and configuration.

Slack is one of the most popular communication platforms for teams, and it works great as a channel for your OpenClaw agent. With Slack integration, your agent can participate in channels, respond to direct messages, and even work within threads.

This guide covers creating a Slack app, configuring the right permissions, and connecting it to your OpenClaw gateway.

What You Need

  • A Slack workspace where you have admin or app-install permissions
  • Your OpenClaw instance running and accessible
  • About 10 minutes

Step 1: Create a Slack App

Go to the Slack API dashboard at api.slack.com/apps and click "Create New App". Choose "From scratch" and give your app a name (for example, "OpenClaw Agent") and select your target workspace.

Step 2: Configure OAuth Scopes

Navigate to "OAuth & Permissions" in your app settings. Under "Bot Token Scopes", add these scopes:

  • chat:write - Send messages
  • channels:history - Read channel messages
  • groups:history - Read private channel messages
  • im:history - Read direct messages
  • im:write - Send direct messages
  • files:write - Upload files (optional, for sharing generated content)
  • reactions:write - Add emoji reactions (optional, for confirmations)

Step 3: Enable Socket Mode

OpenClaw uses Socket Mode to connect to Slack without needing a public endpoint. In your app settings, go to "Socket Mode" and enable it. Generate an app-level token with the connections:write scope.

This means your OpenClaw instance does not need to be publicly accessible. The connection works outbound from your server to Slack's servers.

Step 4: Install the App to Your Workspace

Go to "Install App" in your app settings and install it to your workspace. After installation, copy the Bot User OAuth Token (starts with xoxb-). You will need this for the OpenClaw configuration.

Step 5: Configure OpenClaw

In your OpenClaw configuration, add Slack as a channel. You need to provide:

  • The Bot User OAuth Token (xoxb-...)
  • The App-Level Token (xapp-...) for Socket Mode

Add the Slack channel to your OpenClaw config file. The exact format depends on your setup method, but the key pieces are the two tokens from the previous steps.

Step 6: Invite the Bot

In Slack, invite your new bot to any channel where you want it to respond. Type /invite @OpenClaw Agent (or whatever you named your app) in the channel.

For direct messages, simply start a new DM conversation with the bot.

Using Threads

One of Slack's strengths is threaded conversations. OpenClaw can use threads to maintain separate conversation contexts. When you reply to your agent's message in a thread, it continues that specific conversation. Starting a new top-level message in a channel begins a fresh context.

This is useful for running multiple tasks in parallel within the same channel without mixing up contexts.

Tips for Team Workflows

  • Create a dedicated channel like #ai-agent for agent interactions
  • Use threads to keep conversations organized
  • Set up a private channel for sensitive tasks
  • Use mentions (@OpenClaw Agent) to trigger the bot in busy channels
  • Consider setting up standing orders for routine checks

Limitations

  • Slack's free plan retains only the last 10,000 messages
  • File uploads are limited by Slack's plan restrictions
  • Socket Mode keeps a persistent WebSocket connection; ensure your server has stable connectivity
  • Message formatting supports Slack's mrkdwn, not full Markdown

Troubleshooting

Bot does not respond

Check that Socket Mode is enabled, both tokens are correctly configured, and the bot has been invited to the channel. Review the OpenClaw gateway logs for connection errors.

Bot sees messages but cannot reply

Verify the chat:write scope is added and the app is installed (not just created). Reinstall the app after adding new scopes.

Connection drops periodically

Socket Mode connections can drop. OpenClaw handles reconnection automatically. If drops are frequent, check your server's network stability and firewall rules for outbound connections to Slack's WebSocket endpoints.

FAQ

Is Slack free to use with OpenClaw?

Slack has a free tier that works with OpenClaw. You need a workspace where you can install custom apps. The free plan supports up to 10 app integrations, which is enough for OpenClaw.

Can my agent respond in multiple channels?

Yes. Once the bot is installed, your OpenClaw agent can respond in any channel it has been invited to, as well as in direct messages.

How is message history handled?

Your OpenClaw agent reads messages in real time. Slack message history is subject to Slack's own retention policies (10,000 messages on the free plan). OpenClaw manages its own session context independently.

What OAuth scopes does the app need?

Minimum scopes: chat:write, channels:history, groups:history, im:history, and im:write. For richer responses, also add files:write and reactions:write.

Can I use Slack threads for separate conversations?

Yes. OpenClaw can map Slack threads to separate sessions, letting you run multiple independent conversations within a single channel.

Need help from people who already use this stuff?

Need help with Slack integration?

Join My AI Agent Profit Lab for Slack-specific configurations, troubleshooting help, and community-tested bot setups.