Docs
Plugins
Sources
Slack
Overview

Slack Source Plugin

Latest: v1.3.1

The CloudQuery Slack plugin extracts information from your Slack organization(s) and loads it into any supported CloudQuery destination (e.g. PostgreSQL, BigQuery, Snowflake, and more).

Installation

Install a custom Slack app with read-only permissions into your workspace by clicking the button below and following the instructions:

Once installed into the workspace, go to Install App (under Settings) and copy the Bot User OAuth Token. You will need this in your source config.

Syncing message histories

The Slack source plugin supports syncing of message histories, but only for channels that the bot is added to. If you would like to sync the messages and threads in a channel, add the CloudQuery bot that you installed in Step 1 to the channel before running a sync, and make sure that the slack_conversation_histories table is included in the tables list in your Slack plugin source config.

Example Queries

List all active users in the Slack workspace

select id, name from slack_users where deleted is not true;

Rank users by number of messages sent in public channels

select 
    u.name, count(h.user) 
from slack_conversation_histories h 
    join slack_conversation_replies r on h.ts = r.conversation_history_ts 
    join slack_users u on u.id = h.user 
group by u.name order by count desc;

List all bookmarks

select title, link from slack_conversation_bookmarks;

List URLs to all uploaded files

select title, url_private from slack_files;

List all external files

select title, url_private from slack_files where is_external is true;