Skip to content

Docs/Connectors

Slack

Messages in the public Slack channels a bot was added to, as message records and thread episodes. File contents are never read.

The slack connector reads the channels a Slack app's bot was added to: who wrote, when, the text, and how each thread went.

Connector name slack
Products Records, episodes
Credentials A bot token (starts with xoxb-)
Scopes channels:history, channels:read, users:read
Status Preview: tested against Slack's documented responses, not yet on a live workspace

What it reads

Object Contents
chat_message Channel, thread and message ids, sent time, sender, text, channel name and type, file count and file types, reply and shared-message flags, position in the thread
chat_participant The sender and every person mentioned in each message
chat_user The workspace's members: name, display name, address when the app has users:read.email, and whether each is a bot

The member list is read on every run so the scrubber learns every name in the workspace. A colleague named in a message is replaced even if they never wrote in the window, and the run stops before upload if a name survives.

Episodes. One per thread: the first message, then each reply, by its sender.

What it never reads

  • Direct messages and private channels, unless you list their ids in channels. Those also need the im:history, mpim:history or groups:history scope.
  • Channels the bot was not added to.
  • File contents. Only the count and file types are sent.
  • Join, leave and topic notices.

Setup

  1. Create a Slack app at api.slack.com/apps, add the bot scopes channels:history, channels:read and users:read, and install it to the workspace.
  2. Invite the bot to each channel to share with /invite @your-app.
  3. Connect with the Bot User OAuth Token:
bash
datayield connect slack -o token=env:SLACK_BOT_TOKEN

Options

Option Required Meaning
token yes The bot token. Stored as a secret.
channels no Channel ids to read instead of every public channel the bot is in. The only way to include a private channel or a direct message.
excludeChannels no Channel ids never read
threadLookbackDays no How far back to look for older threads with new replies. Default 30.
excludeDomains no Skip a message when its sender or anyone mentioned has an address at one of these domains
excludePersonalDomains no Also skip personal mail domains. Default false.
maxBodyLength no Longest text sent, in characters. Default 20000.

New records on each run

Each run reads messages sent since the last successful run, and new replies in threads started up to threadLookbackDays earlier. A reply to an older thread is missed. Slack's rate limits are retried after the wait Slack asks for.