Slack Integration
Query your data from Slack with slash commands and threaded follow-ups.
Atlas integrates with Slack via a slash command (/atlas) and threaded follow-ups. Ask questions in any channel, get answers with formatted data tables, and continue the conversation in a thread.
SaaS
On app.useatlas.dev, the Atlas Slack app is pre-configured. Install it to your workspace from Admin > Integrations. For custom Slack app setup (e.g., your own branding), contact support.
Self-hosted prerequisites
- Atlas API server running and accessible over HTTPS (required by Slack)
- A Slack workspace with permissions to create apps
SLACK_SIGNING_SECRETfrom your Slack app's Basic Information page- For multi-workspace OAuth: internal database (
DATABASE_URL)
Setup Modes
| Mode | Env Vars | Best For |
|---|---|---|
| Single-workspace | SLACK_BOT_TOKEN + SLACK_SIGNING_SECRET | One Slack workspace |
| Multi-workspace (OAuth) | SLACK_CLIENT_ID + SLACK_CLIENT_SECRET + SLACK_SIGNING_SECRET | Distributing to multiple workspaces |
Both modes require SLACK_SIGNING_SECRET for request signature verification.
Single-Workspace Setup (Self-Hosted)
SaaS
SaaS users do not need to create their own Slack app. Use the pre-configured Atlas app from Admin > Integrations. The sections below are for self-hosted operators.
The simplest setup -- no OAuth flow, no database storage for tokens.
1. Create a Slack App
Go to api.slack.com/apps and create a new app from scratch.
2. Configure Scopes
Under OAuth & Permissions, add these Bot Token Scopes:
commands-- Register slash commandschat:write-- Post messagesapp_mentions:read-- Read mentions (for thread follow-ups)
3. Create the Slash Command
Under Slash Commands, create a new command:
- Command:
/atlas - Request URL:
https://your-api-host/api/v1/slack/commands - Description: Ask a data question
4. Enable Events
Under Event Subscriptions:
- Request URL:
https://your-api-host/api/v1/slack/events - Subscribe to bot events:
message.channels,message.groups
5. Install and Configure
Install the app to your workspace, then copy the Bot User OAuth Token and Signing Secret:
# .env — copy these from your Slack app's settings page
SLACK_BOT_TOKEN=xoxb-your-bot-token # OAuth & Permissions → Bot User OAuth Token
SLACK_SIGNING_SECRET=your-signing-secret # Basic Information → Signing SecretMulti-Workspace OAuth Setup (Self-Hosted)
SaaS
SaaS users do not need to configure OAuth. Use the pre-configured Atlas app from Admin > Integrations. This section is for self-hosted operators only.
For distributing Atlas to multiple Slack workspaces. Requires an internal database (DATABASE_URL) to store per-workspace bot tokens.
1. Configure OAuth
In your Slack app settings, under OAuth & Permissions:
- Redirect URL:
https://your-api-host/api/v1/slack/callback
2. Set Environment Variables
# .env — OAuth credentials from your Slack app settings
SLACK_CLIENT_ID=your-client-id
SLACK_CLIENT_SECRET=your-client-secret
SLACK_SIGNING_SECRET=your-signing-secret
DATABASE_URL=postgresql://... # Required — stores per-workspace bot tokens3. Install Flow
Direct users to https://your-api-host/api/v1/slack/install. This redirects to Slack's OAuth authorize page. After approval, the callback stores the bot token in the slack_installations table.
How It Works
Slash Command
/atlas What was last month's revenue?- Slack sends the command to
POST /api/v1/slack/commands - Atlas verifies the request signature (HMAC-SHA256, 5-minute timestamp window)
- Atlas immediately acknowledges within 3 seconds (Slack requirement)
- In the background, Atlas posts a "Thinking..." message, runs the agent, and updates the message with the formatted response
Thread Follow-ups
When a user replies in a thread started by Atlas:
- Atlas receives the message via the Events API
- Loads the conversation history from the original thread
- Runs the agent with the full conversation context
- Posts the response in the same thread
This provides multi-turn conversations within Slack threads.
Action Approvals
When the action framework is enabled and a query produces pending actions, Atlas posts approval buttons visible only to the requesting user. Clicking Approve or Deny triggers POST /api/v1/slack/interactions.
Message Formatting
Atlas formats responses using Slack Block Kit:
- Answer text -- The agent's narrative response
- SQL -- The executed query in a code block
- Data table -- Column-aligned text table (max 20 rows displayed, with a "Showing X of Y" note)
- Metadata -- Steps taken, tokens used
Block Kit limits: max 50 blocks per message, max 3,000 characters per text block.
Environment Variables
| Variable | Required | Description |
|---|---|---|
SLACK_SIGNING_SECRET | Yes | Request signature verification |
SLACK_BOT_TOKEN | Single-workspace | Bot OAuth token |
SLACK_CLIENT_ID | Multi-workspace | OAuth app client ID |
SLACK_CLIENT_SECRET | Multi-workspace | OAuth app client secret |
See Environment Variables for the full reference.
Deployment Notes
- The API must be accessible over HTTPS for Slack to deliver events and commands
- Slash commands have a 3-second response deadline -- Atlas acknowledges immediately and processes asynchronously
- Rate limiting is per Slack user per team for commands, and per team for thread follow-ups
- Error messages sent to Slack are scrubbed to prevent leaking connection strings, API keys, or stack traces
- Without an internal database (
DATABASE_URL), thread conversation mappings and OAuth tokens cannot be persisted. Single-workspace mode withSLACK_BOT_TOKENstill works, but thread follow-ups won't have conversation history
Troubleshooting
Events not being delivered -- Verify the Request URL in your Slack app settings is HTTPS and publicly reachable. Slack retries failed deliveries but will disable the subscription after repeated failures.
OAuth callback fails -- Ensure the Redirect URL in your Slack app settings matches https://your-api-host/api/v1/slack/callback exactly. Check that DATABASE_URL is set (required for storing OAuth tokens).
Bot doesn't respond in threads -- The bot needs message.channels and message.groups event subscriptions. Also verify DATABASE_URL is set for conversation history persistence.
See Troubleshooting for general diagnostic steps.