Slack¶
Sync channel messages and metadata from Slack into your data warehouse.
| Feature | Details |
|---|---|
| Auth | Bot User OAuth Token (xoxb-) |
| Env Variable | SLACK_ACCESS_TOKEN |
| Incremental | Yes |
| Date Range | Yes (default: last 90 days) |
| dlt Package | slack |
Managing this source in the Web UI
After setup, manage this source from the Sources page in the Web UI (http://localhost:8800/sources). Trigger syncs, view history, and monitor status without using the CLI. See Web UI — Sources.
Prerequisites¶
- A Slack workspace where you have admin (or app-install) permissions
- A Slack Bot User OAuth Token (
xoxb-...)
Create a Slack App and Bot Token¶
- Go to api.slack.com/apps and click Create New App
- Choose From scratch, name it (e.g., "Dango Data"), and select your workspace
- Go to OAuth & Permissions in the sidebar
- Under Bot Token Scopes, add these scopes:
channels:history— read messages in public channelschannels:read— list public channelsgroups:history— read messages in private channels (optional)groups:read— list private channels (optional)users:read— read user profiles
- Click Install to Workspace at the top of the page
- Authorize the app
- Copy the Bot User OAuth Token (starts with
xoxb-)
Invite the bot to channels
After creating the app, you must invite the bot to each channel you want to sync:
The bot can only read messages from channels it has been invited to.
Setup¶
Via Wizard (Recommended)¶
? Select a data source: Slack
? Source name: slack
? Environment variable for access token [SLACK_ACCESS_TOKEN]: SLACK_ACCESS_TOKEN
? Filter to specific channels? (leave empty for all):
? Start date (default: 90 days ago):
Via Configuration File¶
Edit .dango/sources.yml:
version: '1.0'
sources:
- name: slack
type: slack
enabled: true
description: Slack workspace messages
slack:
access_token_env: SLACK_ACCESS_TOKEN
First Sync¶
Configuration¶
Optional Parameters¶
| Parameter | Default | Description |
|---|---|---|
selected_channels | All channels | List of specific channel IDs to sync |
start_date | 90 days ago | Earliest date to fetch messages from |
Filter to Specific Channels¶
To sync only certain channels, provide their channel IDs:
slack:
access_token_env: SLACK_ACCESS_TOKEN
selected_channels:
- C01ABCDEF # #general
- C02GHIJKL # #engineering
- C03MNOPQR # #sales
How to find a channel ID
- Open Slack in a web browser
- Navigate to the channel
- The URL looks like:
https://app.slack.com/client/TXXXXXXX/C01ABCDEF - The last segment (
C01ABCDEF) is the channel ID
Or right-click the channel name > View channel details > scroll to the bottom to find the Channel ID.
Set a Custom Start Date¶
slack:
access_token_env: SLACK_ACCESS_TOKEN
start_date: "2024-01-01" # Sync messages from January 2024 onward
Full Configuration Example¶
version: '1.0'
sources:
- name: slack
type: slack
enabled: true
description: Engineering Slack channels
slack:
access_token_env: SLACK_ACCESS_TOKEN
selected_channels:
- C01ABCDEF
- C02GHIJKL
start_date: "2024-06-01"
Tables Loaded¶
Data loads into the raw_{source_name} schema. By default, each channel gets its own message table:
| Table | Description |
|---|---|
raw_slack.channels | Channel metadata (name, topic, purpose, member count) |
raw_slack.users | User profiles (display name, email, status) |
raw_slack.{channel_name} | Messages for each channel (one table per channel) |
For example, if the bot is in #general and #engineering:
raw_slack.general— messages from #generalraw_slack.engineering— messages from #engineering
Query example:
Sync Behavior¶
- Incremental: After the first sync, subsequent syncs fetch only messages posted since the last sync.
- Write disposition:
appendfor messages (new messages are added, never deleted). - First sync: Loads messages within the date range from all invited channels. Large workspaces with extensive history may take 10-30 minutes.
Slack API rate limits
Slack enforces rate limits (typically 1 request per second for conversations.history). Dango handles rate limiting automatically. Very large channel histories may take longer to sync.
Common Issues¶
No Messages Returned¶
- Bot not invited: The most common issue. Run
/invite @YourBotNamein each channel you want to sync. - Channel IDs wrong: If using
selected_channels, verify the IDs. Channel IDs start withC(public) orG(private). - Start date too recent: Check your
start_datesetting.
"not_authed" or "invalid_auth"¶
- Verify the bot token in
.envstarts withxoxb- - Check that the app is still installed in your workspace (not uninstalled by an admin)
- Regenerate the token if needed: go to your app's OAuth & Permissions page and reinstall
"missing_scope" Errors¶
Your bot token lacks a required scope. Go to api.slack.com/apps > your app > OAuth & Permissions > add the missing scope > Reinstall to Workspace.
Private Channels Not Syncing¶
Private channels require the groups:history and groups:read scopes. Add these scopes and reinstall the app, then invite the bot to the private channel.
Next Steps¶
- Adding Sources - Full wizard walkthrough
- Sync Modes - Incremental vs. full refresh
- Source Catalog - All available data sources
- Transformations - Transform Slack data with dbt
- Slack API Documentation