Carapace
All Guides
Communication

Slack

Send and receive messages via Socket Mode, react, read threads

Slack Setup Guide

Enables your agent to send and receive messages, react to messages, read threads, and manage channels in your Slack workspace.

Prerequisites

  • A Slack workspace where you have permission to install apps
  • Admin approval may be required depending on workspace settings

Step 1: Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New App > From scratch
  3. Enter an app name (e.g., "Carapace Agent") and select your workspace
  4. Click Create App

Step 2: Enable Socket Mode

Socket Mode lets your agent receive messages in real time without exposing a public URL.

  1. In the left sidebar, go to Socket Mode
  2. Toggle Enable Socket Mode on
  3. You'll be prompted to create an App-Level Token — name it something like "carapace-socket" and add the connections:write scope
  4. Copy the token (starts with xapp-) — you'll need this later

Step 3: Configure Event Subscriptions

  1. In the left sidebar, go to Event Subscriptions
  2. Toggle Enable Events on
  3. Under Subscribe to bot events, add:

Required events:

EventDescription
message.channelsMessages in public channels
message.groupsMessages in private channels
message.imDirect messages to your bot
app_mentionWhen someone @mentions your bot

Optional events (for triage/approval workflows):

EventDescription
reaction_addedWhen someone adds an emoji reaction
  1. Click Save Changes

Step 4: Configure Bot Token Scopes

  1. In the left sidebar, go to OAuth & Permissions
  2. Scroll to Scopes > Bot Token Scopes
  3. Add the following scopes:

Required scopes:

ScopeDescription
chat:writeSend messages
channels:readList public channels
channels:historyRead messages in public channels
groups:historyRead messages in private channels
im:historyRead direct messages
users:readLook up user info

Recommended scopes:

ScopeDescription
reactions:readRead emoji reactions (for approval workflows)
reactions:writeAdd emoji reactions
app_mentions:readRead @mentions of the bot
im:readView DM metadata
im:writeOpen DM conversations
files:writeUpload files

Step 5: Install the App

  1. In the left sidebar, go to Install App
  2. Click Install to Workspace
  3. Review the permissions and click Allow
  4. Copy the Bot User OAuth Token (starts with xoxb-)

Step 6: Invite the Bot to Channels

The bot can only see and post in channels it has been explicitly invited to.

/invite @YourBotName

Or right-click the channel > View channel details > Integrations > Add apps.

Step 7: Connect in Carapace

  1. Go to Dashboard > Connections
  2. Find Slack and click Connect
  3. Paste the Bot Token (xoxb-...)
  4. Paste the App Token (xapp-...) — this enables real-time message receiving via Socket Mode
  5. Click Save Credentials

Credential Fields Reference

FieldRequiredFormatDescription
bot_tokenYesStarts with xoxb-Bot User OAuth Token — used for API calls
app_tokenNoStarts with xapp-App-Level Token — enables Socket Mode for real-time events

Without the app token, the agent can send messages but cannot receive them in real time.

Private Channels

Private channels require different scopes than public channels:

Public channelsPrivate channels
channels:historygroups:history
channels:readgroups:read
message.channels eventmessage.groups event

Make sure you add both sets of scopes and events if your agent needs to work in private channels. The bot must still be explicitly invited to each private channel.

Triage Agent Setup

Carapace includes a triage agent template that monitors Slack channels for bug reports and feature requests, gathers structured information, consults your dev team, and creates ClickUp tasks.

To set up a triage agent:

  1. Complete the Slack setup above (including Socket Mode and reaction events)
  2. Connect a ClickUp integration with a personal API token
  3. Download the triage agent prompt template and paste it into your agent's system prompt
  4. Fill in the configurable sections: monitored channels, dev notification target, and ClickUp list ID

The triage flow:

  1. Someone posts a bug report or feature request in a monitored channel
  2. The agent reacts with a magnifying glass and starts gathering info in a thread
  3. Once info is complete, the agent posts a summary to the dev channel
  4. A dev approves (checkmark reaction or "lgtm" reply)
  5. The agent creates a structured ClickUp task and closes the loop

Gotchas

Bot must be invited to channels: The bot cannot see or post to any channel until explicitly invited. This is the most common reason the agent "can't find" a channel.

Scopes require reinstall: If you add scopes after installation, you must reinstall the app to your workspace. Go to Install App and click Reinstall to Workspace.

Event subscriptions require reinstall: Same as scopes — after changing event subscriptions, reinstall the app.

xoxb- vs xoxp- vs xapp- tokens:

  • xoxb- — Bot tokens (used for API calls)
  • xapp- — App-level tokens (used for Socket Mode)
  • xoxp- — User tokens (not supported by Carapace)

Agent must be restarted after token changes: If you update your Slack credentials in the dashboard, stop and start the agent to pick up the new tokens.

Troubleshooting

Bot doesn't respond to messages

  1. Verify Socket Mode is enabled in your Slack app settings
  2. Verify the app token (xapp-...) is saved in Carapace alongside the bot token
  3. Verify Event Subscriptions are enabled with the correct bot events
  4. Verify the bot is invited to the channel (/invite @BotName)
  5. Check that private channels have groups:history scope and message.groups event

Bot can't send messages

The bot hasn't been invited to the target channel. Use /invite @BotName.

"missing_scope" error

Add the missing scope in OAuth & Permissions > Bot Token Scopes, then reinstall the app and update the token in Carapace.

"not_in_channel" error

The bot hasn't been added to the channel. Invite it first.

Bot connects but receives no events

This usually means event subscriptions are not configured or the app wasn't reinstalled after changing them. Check Event Subscriptions in your Slack app settings and reinstall.

See Also