Slack
This guide walks you through creating a Slack app, configuring it with the right permissions, and connecting it to Snippbot so that your agents can receive and reply to messages in Slack.
Prerequisites
Section titled “Prerequisites”- Admin access to a Slack workspace (or permission to install apps)
- A running Snippbot instance accessible from the internet on port 18790 (or via ngrok)
- Your Snippbot version is 1.0 or later
Setup Steps
Section titled “Setup Steps”-
Create a Slack app
Go to api.slack.com/apps and click Create New App > From scratch.
- App Name: Choose a name (e.g. “Snippbot”)
- Workspace: Select the workspace where the bot will be installed
Click Create App.
-
Add Bot Token Scopes
In your new app’s settings, navigate to OAuth & Permissions > Scopes > Bot Token Scopes and add the following:
Scope Purpose chat:writeSend messages channels:readRead public channel info groups:readRead private channel info im:readRead direct messages im:writeSend direct messages app_mentions:readReceive @mention events files:readRead files shared with the bot -
Install the app to your workspace
Navigate to OAuth & Permissions > Install to Workspace and click Allow.
After installation, copy the Bot User OAuth Token — it starts with
xoxb-. -
Configure Snippbot with the bot token
In the Snippbot UI, navigate to Settings > Channels > Slack.
Enter the following values:
Field Value Bot Token xoxb-your-token-hereSigning Secret Found under Basic Information > App Credentials in the Slack app settings Click Save.
-
Enable the Events API
In your Slack app settings, navigate to Event Subscriptions and toggle Enable Events to on.
Set the Request URL to:
https://your-server.com:18790/webhook/slackReplace
your-server.comwith your public hostname. If you are developing locally, use an ngrok URL:Start ngrok tunnel ngrok http 18790Slack will send a verification challenge to this URL. Snippbot handles the challenge automatically — the URL turns green once verified.
-
Subscribe to bot events
Still in Event Subscriptions, expand the Subscribe to bot events section and add:
Event Triggered when message.channelsA message is posted in a public channel the bot is in message.imA direct message is sent to the bot app_mentionThe bot is @mentioned in any channel Click Save Changes.
-
Start the channel adapter
Start the channel adapter snippbot channel startThe adapter starts on port 18790 and begins accepting Slack event payloads.
-
Test the integration
- DM the bot: Open Slack and send a direct message to your app. The bot should reply within a few seconds.
- Mention in a channel: Invite the bot to a channel with
/invite @Snippbot, then type@Snippbot hello.
Channel Bindings
Section titled “Channel Bindings”By default, all messages to the bot are routed to the default agent in Snippbot. To route messages from specific Slack channels or users to different agents, configure channel bindings.
Bind a Slack channel to an agent
Section titled “Bind a Slack channel to an agent”- Open Settings → Channels → Bindings in the Snippbot UI
- Click New Binding
- Select the Slack channel (e.g.,
#dev-help) - Select which agent handles messages from that channel
- Set access mode and click Save
To find a channel’s ID, open the channel in Slack, click the channel name at the top, and scroll to the bottom of the popup — the channel ID is listed there (e.g. C08ABC1234).
You can also route specific users’ DMs to a dedicated agent by creating a binding with the user’s Slack ID (e.g. U01USER123) as the context ID.
Configuration Reference
Section titled “Configuration Reference”| Option | Type | Required | Description |
|---|---|---|---|
bot_token | string | Yes | Bot User OAuth Token from Slack (xoxb-...) |
signing_secret | string | Yes | Used to verify that events come from Slack |
socket_mode | boolean | No | Enable Slack Socket Mode (no public URL needed; default: false) |
workspace_id | string | No | Slack workspace ID for multi-workspace setups |
default_agent_id | string | No | Agent to use when no binding matches the incoming message |
reply_in_thread | boolean | No | When true, bot replies are posted as thread replies (default: false) |
show_typing | boolean | No | Send a typing indicator while the agent is working (default: true) |
These options can be set in the UI under Settings > Channels > Slack, or in ~/.snippbot/config.toml:
[channels.slack]bot_token = "xoxb-..."signing_secret = "abc123..."reply_in_thread = trueTroubleshooting
Section titled “Troubleshooting”The Request URL verification fails
Section titled “The Request URL verification fails”- Confirm that
snippbot channel startis running and listening on port 18790 - Confirm that port 18790 is reachable from the internet (check your firewall)
- If using ngrok, make sure the tunnel is still active (ngrok sessions expire after 8 hours on the free plan)
The bot does not respond to messages
Section titled “The bot does not respond to messages”- Check that the bot has been invited to the channel:
/invite @Snippbot - Verify that the
message.channelsevent is subscribed and the channel is public (usemessage.groupsfor private channels) - Look at the Snippbot channel adapter logs:
journalctl -u snippbot-channels -for the terminal where you ransnippbot channel start
Messages arrive but responses are slow
Section titled “Messages arrive but responses are slow”- The default agent model is
claude-opus-4-6. For faster replies, consider switching to a lighter model in the agent settings - Check for API rate limits in your Anthropic account dashboard