Slack Channel Setup
Connect your AI agent to Slack workspaces so users can interact with your agent directly through Slack channels or direct messages.
Overview
A Slack channel allows your agent to:
Receive messages from users in Slack channels or direct messages
Respond to messages in real-time
Participate in threaded conversations
Support both public channels and private direct messages
Prerequisites
Before you begin, you'll need:
A Slack workspace where you have administrative access or permission to create apps
A Slack App that you've created (or permission to create one)
A published agent in your Stage5 project that you want to connect to Slack
Step 1: Create a Slack App
Go to Slack API - Your Apps
Click "Create New App"
Choose "From scratch"
Give your app a name (e.g., "Customer Support Bot")
Select the Slack workspace where you want to use the bot
Click "Create App"
Step 2: Configure OAuth & Permissions
In your app settings, navigate to "OAuth & Permissions" in the left sidebar
Scroll down to "Scopes" → "Bot Token Scopes"
Add the following required permissions:
chat:write- Send messages as the botchannels:history- Read messages in public channelsgroups:history- Read messages in private channelsim:history- Read messages in direct messagesim:write- Send direct messagesmpim:history- Read messages in group direct messagesmpim:write- Send group direct messageschannels:join- Allow the bot to join public channelsusers:read- View user information for message attribution
Scroll up and click "Install to Workspace" (or "Reinstall to Workspace" if updating permissions)
Authorize the app in your workspace
Copy the "Bot User OAuth Token" - you'll need this in the next step (it starts with
xoxb-)
Step 3: Configure Event Subscriptions
In your app settings, navigate to "Event Subscriptions" in the left sidebar
Toggle "Enable Events" to ON
Set the "Request URL" - This will be provided by Stage5 after you publish your channel. For now, you can leave this blank and update it later, or use a placeholder URL temporarily.
In "Subscribe to bot events", add the following events:
message.channels- Receive messages posted in public channelsmessage.groups- Receive messages posted in private channelsmessage.im- Receive direct messagesmessage.mpim- Receive group direct messages
Click "Save Changes"
Step 4: Get Your Signing Secret
In your app settings, navigate to "Basic Information" in the left sidebar
Scroll down to "App Credentials"
Copy the "Signing Secret" - you'll need this to configure your channel in Stage5
Step 5: Add the Bot to Slack Channels
Your bot needs to be added to any Slack channels where you want it to respond:
In Slack, go to the channel where you want your agent active
Click the channel name at the top
Go to the "Integrations" tab
Click "Add apps"
Find and add your bot app
Alternatively, you can type /invite @YourBotName in the channel.
Step 6: Configure the Channel in Stage5
In your Stage5 project, in order to create or edit a channel manifest file, just instruct the assistant. For example:
Connect the Customer Support Agent to a Slack channel. Make sure to have placeholders for all of the Secrets that are needed and I'll add them later. Behind the scenes the Stage5 Assistant will create it all, leaving you just to set the secrets.Configure the required secrets. For more information see the "Storing Secrets" section.
Required Settings
You'll need to store these values as secrets in your project's Secret Vault:
Bot Token Secret Key - The name of the secret storing your Bot User OAuth Token (from Step 2)
Signing Secret Key - The name of the secret storing your Signing Secret (from Step 4)
Optional Settings
Reply in Threads - If
true, the bot will reply in threaded conversations instead of posting to the main channel. Defaults tofalse.
Example Channel Configuration
Step 7: Store Secrets
Before publishing, make sure you've stored the required secrets in your project's Secret Vault:
Store your Bot User OAuth Token (from Step 2) with the key name you specified as
botTokenSecretKeyStore your Signing Secret (from Step 4) with the key name you specified as
signingSecretKey
Step 8: Publish and Configure Webhook
Publish your channel to the desired environment (Production, Staging, etc.)
After publishing, Stage5 will provide you with a webhook URL
Go back to your Slack app settings → "Event Subscriptions"
Paste the webhook URL from Stage5 into the "Request URL" field
Slack will verify the URL - if successful, you'll see a green checkmark
Click "Save Changes"
Step 9: Test Your Channel
Go to any Slack channel where your bot is added (or send a direct message to the bot)
Send a test message
Your agent should respond within a few seconds
If you don't receive a response, check:
The bot is added to the channel
The webhook URL is correctly configured
Your secrets are stored correctly
The agent manifest path is correct
Configuration Options Reference
Channel Name
Type: String
Required: Yes
Description: A descriptive name for your Slack channel (e.g., "Customer Support Bot")
Channel Description
Type: String
Required: Yes
Description: Brief explanation of what this channel is for
Agent Manifest Path
Type: String
Required: Yes
Description: Path to your agent manifest file (e.g., "agents/support-agent.json")
Bot Token Secret Key
Type: String (secret key name)
Required: Yes
Description: The name of the secret in your Secret Vault that stores your Slack Bot User OAuth Token (starts with
xoxb-)
Signing Secret Key
Type: String (secret key name)
Required: Yes
Description: The name of the secret in your Secret Vault that stores your Slack Signing Secret
Reply in Threads
Type: Boolean
Required: No
Default:
falseDescription: When
true, the bot will reply in threads instead of posting to the main channel. When a user posts a message, the bot's response will appear as a thread reply.
Self-Registration Options
See the main Channels documentation for details on:
selfRegistrationForExistingUsersEnabledselfRegistrationForNewUsersEnabledselfRegistrationForExistingUsersDisabledMessageselfRegistrationForNewUsersDisabledMessageuserDisabledMessageuserDeletedMessage
Troubleshooting
Bot Not Responding
Check bot is added to channel: The bot must be added as a member of any channel where it should respond
Verify webhook URL: Ensure the webhook URL in Slack app settings matches the one from Stage5
Check secrets: Verify your Bot Token and Signing Secret are correctly stored in the Secret Vault
Review permissions: Make sure all required OAuth scopes are enabled
Webhook Verification Failing
Ensure URL is correct: Copy the exact webhook URL from Stage5
Check HTTPS: Slack requires HTTPS endpoints
Timing: Wait a few seconds after publishing before configuring the webhook
Permission Errors
Review scopes: Make sure all required bot token scopes are added in OAuth & Permissions
Reinstall app: If you added new scopes, reinstall the app to your workspace
Check workspace permissions: Ensure you have permission to install apps in your workspace
Messages Not Being Received
Verify events: Ensure all required bot events are subscribed in Event Subscriptions
Check channel type: Make sure you've subscribed to events for the channel types you're using (channels, groups, im, mpim)
Best Practices
Start with a test workspace: Before deploying to production, test your channel in a separate Slack workspace
Monitor usage: Keep an eye on how users interact with your bot
Use threads for long conversations: Enable "Reply in Threads" to keep channel feeds clean
Clear naming: Give your bot a descriptive name so users know what it does
Set expectations: Consider adding a welcome message or channel description explaining what the bot can help with
Security Considerations
Never share your Bot Token or Signing Secret: Keep these secure and only store them in your Secret Vault
Use environment-specific apps: Consider creating separate Slack apps for staging and production. Make sure to use different secret names for each environment. For example
SLACK_BOT_TOKEN_DEVandSLACK_BOT_TOKEN_PROD.Review permissions regularly: Only grant the minimum permissions your bot needs
Monitor for unusual activity: Regularly check your bot's message history for any suspicious activity
Last updated