Slack Integration
Connect your Hatcher agent to Slack so it can respond to messages and mentions in your workspace channels.
Legacy custom bots (the old xoxb- tokens from the “Custom Integrations” page) were discontinued in March 2025. You must create a proper Slack App. If you have old bot tokens from the legacy system, they no longer work.
Prerequisites
- A Slack workspace where you have permission to install apps
- A Hatcher agent already created (Getting Started)
- Slack integration is free on all Hatcher plans
Setup
Create a Slack App
- Go to https://api.slack.com/apps
- Click Create New App
- Choose From scratch
- Enter an app name (e.g., “Hatcher Agent”) and select the workspace to install it in
- Click Create App
Slack’s developer documentation is migrating to https://docs.slack.dev . Some links may redirect between the old and new sites.
Configure Bot Token Scopes
- In your app’s settings, go to OAuth & Permissions in the left sidebar
- Scroll down to Bot Token Scopes
- Click Add an OAuth Scope and add the following:
| Scope | Purpose |
|---|---|
chat:write | Send messages in channels |
channels:read | View basic channel info |
channels:history | Read message history in public channels |
app_mentions:read | Receive events when the bot is @mentioned |
groups:read | View basic info about private channels (optional) |
groups:history | Read messages in private channels (optional) |
im:history | Read direct messages (optional) |
At minimum, you need chat:write, channels:read, channels:history, and app_mentions:read.
Install the App to Your Workspace
- Scroll up on the OAuth & Permissions page
- Click Install to Workspace
- Review the permissions and click Allow
- Copy the Bot User OAuth Token — it starts with
xoxb-
xoxb-1234567890123-1234567890123-ABCdefGHIjklMNOpqrSTUvwxIf you add more scopes later, you’ll need to reinstall the app to your workspace for the new scopes to take effect.
Subscribe to Bot Events
- Go to Event Subscriptions in the left sidebar
- Toggle Enable Events to On (Socket Mode handles delivery, so you don’t need a Request URL)
- Scroll down to Subscribe to bot events and add:
| Event | Description |
|---|---|
app_mention | When someone @mentions your bot |
message.channels | Messages in public channels the bot is in |
message.groups | Messages in private channels (optional) |
message.im | Direct messages to the bot (optional) |
- Click Save Changes
Generate an App-Level Token for Socket Mode
- Go to Basic Information in the left sidebar
- Scroll down to App-Level Tokens
- Click Generate Token and Scopes
- Name it (e.g., “hatcher-socket”), add the
connections:writescope, and click Generate - Copy the token — it starts with
xapp-
Enable Socket Mode
- Go to Socket Mode in the left sidebar
- Toggle Enable Socket Mode to On
Configure in Hatcher
- Go to your Hatcher Dashboard
- Navigate to My Agents and select your agent
- Open the Integrations tab
- Find Slack and click Configure
- Paste your Bot User OAuth Token (
xoxb-...) - Paste your App-Level Token (
xapp-...) - Click Save
Restart your agent
Click Restart to apply the configuration.
Invite the bot to a channel
In Slack, go to the channel where you want the bot to respond and type:
/invite @YourBotNameOr click the channel name → Integrations → Add apps.
Test it
Mention your bot in the channel (e.g., @HatcherAgent what's the price of SOL?). It should respond.
Channel Access
Your bot can only see and respond in channels it has been invited to. To add it to a channel:
- Use
/invite @BotNamein the channel - Or go to the channel settings → Integrations → Add apps
Socket Mode
Hatcher uses Socket Mode for Slack, which means your agent connects to Slack via a WebSocket rather than requiring a public HTTP endpoint. This is simpler and more reliable.
To enable Socket Mode, you need an App-Level Token in addition to the Bot Token:
- In your Slack app settings, go to Basic Information
- Scroll down to App-Level Tokens
- Click Generate Token and Scopes
- Give it a name (e.g., “hatcher-socket”) and add the
connections:writescope - Click Generate
- Copy the token — it starts with
xapp-
Then in Hatcher, configure both tokens:
- Bot Token (
xoxb-...) — for sending messages and API calls - App Token (
xapp-...) — for Socket Mode connection
With Socket Mode enabled, you do not need to configure Event Subscriptions with a Request URL. Slack delivers events directly over the WebSocket connection.
Troubleshooting
Bot doesn’t respond to messages
- Check scopes. Make sure you added at least
chat:write,channels:read,channels:history, andapp_mentions:read. If you added scopes after installing, reinstall the app. - Check event subscriptions. Make sure
app_mentionand/ormessage.channelsare subscribed. - Invite the bot to the channel. The bot can only see messages in channels it’s been invited to.
- Verify the agent is running in the Hatcher dashboard.
”not_authed” or “invalid_auth” error
Your bot token is invalid. Common causes:
- Token was rotated in Slack’s admin settings
- Token was copied with extra whitespace
- App was uninstalled and reinstalled (generates a new token)
Fix: Go to your app’s OAuth & Permissions page, copy the current Bot User OAuth Token, update it in Hatcher, and restart.
”missing_scope” error
Your bot is trying to perform an action it doesn’t have permission for.
Fix: Go to OAuth & Permissions → Bot Token Scopes, add the missing scope, then reinstall the app to your workspace. Update the token in Hatcher if it changed.
Socket Mode not connecting
If your agent can’t connect via Socket Mode:
- Verify the App-Level Token (
xapp-...) is correct and has theconnections:writescope - Make sure Socket Mode is enabled in the app settings
- Check that your agent is running in the Hatcher dashboard
Bot responds multiple times
This usually means multiple instances of the bot are running, or event subscriptions are duplicated. Check that you only have one active Hatcher agent with this Slack token.
Useful Links
- Slack API Apps — Manage your Slack apps
- Slack Developer Documentation — New documentation site
- Slack API Methods — Full API method reference
- Slack Permissions/Scopes — Complete list of available scopes