Skip to content

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.

  • 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

  1. 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.

  2. Add Bot Token Scopes

    In your new app’s settings, navigate to OAuth & Permissions > Scopes > Bot Token Scopes and add the following:

    ScopePurpose
    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
  3. 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-.

  4. Configure Snippbot with the bot token

    In the Snippbot UI, navigate to Settings > Channels > Slack.

    Enter the following values:

    FieldValue
    Bot Tokenxoxb-your-token-here
    Signing SecretFound under Basic Information > App Credentials in the Slack app settings

    Click Save.

  5. 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/slack

    Replace your-server.com with your public hostname. If you are developing locally, use an ngrok URL:

    Start ngrok tunnel
    ngrok http 18790

    Slack will send a verification challenge to this URL. Snippbot handles the challenge automatically — the URL turns green once verified.

  6. Subscribe to bot events

    Still in Event Subscriptions, expand the Subscribe to bot events section and add:

    EventTriggered 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.

  7. Start the channel adapter

    Start the channel adapter
    snippbot channel start

    The adapter starts on port 18790 and begins accepting Slack event payloads.

  8. 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.

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.

  1. Open Settings → Channels → Bindings in the Snippbot UI
  2. Click New Binding
  3. Select the Slack channel (e.g., #dev-help)
  4. Select which agent handles messages from that channel
  5. 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.


OptionTypeRequiredDescription
bot_tokenstringYesBot User OAuth Token from Slack (xoxb-...)
signing_secretstringYesUsed to verify that events come from Slack
socket_modebooleanNoEnable Slack Socket Mode (no public URL needed; default: false)
workspace_idstringNoSlack workspace ID for multi-workspace setups
default_agent_idstringNoAgent to use when no binding matches the incoming message
reply_in_threadbooleanNoWhen true, bot replies are posted as thread replies (default: false)
show_typingbooleanNoSend 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:

~/.snippbot/config.toml
[channels.slack]
bot_token = "xoxb-..."
signing_secret = "abc123..."
reply_in_thread = true

  • Confirm that snippbot channel start is 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)
  • Check that the bot has been invited to the channel: /invite @Snippbot
  • Verify that the message.channels event is subscribed and the channel is public (use message.groups for private channels)
  • Look at the Snippbot channel adapter logs: journalctl -u snippbot-channels -f or the terminal where you ran snippbot channel start
  • 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