Slack
Slack is a messaging platform for teams and organizations where they can collaborate, share ideas and information.
ingestr supports Slack as a source.
URI format
The URI format for Slack is as follows:
slack://?api_key=<api-key-here>URI parameters:
api_key: The API key used for authentication with the Slack API.
The URI is used to connect to the Slack API for extracting data.
Setting up a Slack integration
To set up a Slack integration, you need to create a Slack App and obtain an API token with the necessary permissions.
Step 1: Create a Slack App
- Go to Slack API Apps page
- Click Create New App
- Choose From scratch
- Enter an App Name (e.g., "Data Integration") and select your workspace
- Click Create App
Step 2: Choose a Token Type
Slack supports two token types, and ingestr works with either:
- User token (
xoxp-) — recommended for one-off ingestion by an admin. Inherits the installing user's channel access, so no per-channel setup is needed. - Bot token (
xoxb-) — recommended for unattended, long-running pipelines. The bot must be invited to each channel you want to read messages from (/invite @your-appin each channel).
Step 3: Configure OAuth Scopes
- In the left sidebar, click OAuth & Permissions
- Scroll down to Scopes and add the scopes below under User Token Scopes or Bot Token Scopes, matching the token type you chose in Step 2:
channels:read— list public channelschannels:history— read messages in public channelsusers:read— list workspace usersteam:read— read team metadataadmin.teams:read— required foraccess_logs(Enterprise Grid only)
Step 4: Install the App and Get the Token
- Scroll to the top of the OAuth & Permissions page
- Click Install to Workspace and approve the requested permissions
- Copy the token that matches your choice in Step 2:
- User OAuth Token (
xoxp-…), or - Bot User OAuth Token (
xoxb-…)
- User OAuth Token (
This token is your api_key for the ingestr URI.
Once you have the API key, let's say it is axb-test-564, here's a sample command that will copy the data from Slack into a DuckDB database:
ingestr ingest --source-uri 'slack://?api_key=axb-test-564' --source-table 'channels' --dest-uri duckdb:///slack.duckdb --dest-table 'dest.channels'The result of this command will be a table in the slack.duckdb database.
Tables
Slack source allows ingesting the following sources into separate tables:
| Table | PK | Inc Key | Inc Strategy | Details |
|---|---|---|---|---|
| channels | id | - | replace | Retrieves information about all the channels |
| users | id | - | replace | Retrieves all the users |
| messages:chan1,chan2 | ts | ts | append/merge | Retrieves messages from specified channels (e.g., general, memes). Multiple channels can be listed separated by commas |
| access_logs | user_id | - | append | Retrieves access logs |
Use these as --source-table parameter in the ingestr ingest command.