Docs / Sources

Slack

Connect Slack accounts to community members. Route activity notifications to selected channels.

Matches onVerified email
HistoryFull, with an export
Also doesRouting, presence
You'll needSlack admin access

Use the app and an export

The Slack app supplies email addresses. These addresses link members to their GitHub and forum accounts. A Slack export supplies older history that the app cannot read. Both connections can read the same workspace.

Slack appSTART HERE

  • Email addresses link accounts automatically
  • New activity as it happens
  • Routing and member cards into channels
  • Only public channels the app is in

Slack export

  • Every public channel, back to day one
  • Works on any Slack plan
  • Email addresses may be absent
  • The export contains no future updates

Connect the Slack app

Datum creates an app for your Slack workspace. Your workspace keeps control of the token. To create the app, Datum needs a temporary configuration token. Sign in to Datum as a workspace owner. Sign in to Slack as the owner of the Slack workspace.

  1. Get a configuration token

    1. Open Slack apps.
    2. Find Your App Configuration Tokens.
    3. Generate a token for your workspace.

    Datum uses the token one time to create the app. Then Datum deletes the token.

  2. Open Sources

    1. Open Sources → Connect a source → Slack app.
    2. Enter the token in App configuration token.
    3. Leave the other secret fields empty.
    4. Press Connect.

    Datum saves the connection and opens a new tab.

  3. Create the app

    Press Create or update app in the Create or update your Slack app tab.

    Datum creates an app with the name Datum and connects its event subscriptions to this source. It stores the app credentials and the signing secret in the vault of your workspace. Slack then asks you to install the app.

  4. Approve it in Slack

    Approve the permissions that the app asks for in Slack.

    The app asks for access to member profiles, email addresses, public channels, messages and reactions. It also asks for permission to post cards and direct messages for routing rules. It never asks for access to private channels. After the approval, Slack sends you back to Sources.

  5. Verify

    Press Verify when the setup panel displays Authorization received. Verify to check access.

    The result names the workspace and bot. It reports whether Slack granted users:read.email, chat:write and im:write.

  6. Add it to your channels

    Run this command in each public channel that you want to include:

    /invite @Datum
  7. Check the result

    The Slack connection shows on Sources. After the first sync, people from Slack show in Members. If email addresses are missing, the Slack row tells you.

Use your own Slack app

You can create the app yourself. Then connect it with one of the two methods below. Both methods use deploy/slack-manifest.yaml.

  1. Open Slack apps.
  2. Select Create New App → From a manifest.
  3. Select the workspace.
  4. Paste the supplied manifest.
  5. Keep users:read.email in the scopes.

This scope supplies the email addresses that link accounts.

Sign in through your app.

  1. Add your Datum address followed by /connect/slack/callback to the OAuth redirect URLs of the app.
  2. Open Basic Information → App Credentials in Slack.
  3. Open Sources → Connect a source → Slack app in Datum.
  4. Enter the OAuth client ID.
  5. Enter the OAuth client secret.
  6. Leave App configuration token empty.
  7. Press Connect.
  8. Approve the app in Slack.
  9. Press Verify.

Paste a bot token.

  1. Select Install to Workspace in Slack.
  2. Copy the Bot User OAuth Token.
  3. Enter the token in the Bot User OAuth Token field in Datum.
  4. Press Verify.

Bot tokens start with xoxb-. This method needs no sign-in step.

The supplied manifest has no event subscriptions. Thus, an app that you make manually gets data only from scheduled syncs until you add subscriptions.

  1. Open Settings → Webhook on the connection.
  2. Paste the Slack signing secret of the app.
  3. Choose Save signing secret.
  4. Turn on Event Subscriptions in Slack.
  5. Set the destination to the address from Webhook URL on Sources.
  6. Subscribe the bot to team_join, user_change, message.channels and reaction_added.
  7. Save the subscriptions.
  8. Check that Slack marks the destination Verified.

Do not add member_joined_channel in the Slack event picker. It can also add groups:read and mpim:read. These scopes ask for metadata about private channels and group DMs, which Datum does not need. If the picker added them, remove the membership event and both scopes. Then install the app again. Before you approve the installation, compare OAuth & Permissions with the supplied manifest.

Without that subscription, channel joins do not arrive as live events. The import of historical channel membership continues to work. Slack documents public-channel membership events with channels:read. The automatic app setup in Datum uses this scope. The manual event picker can ask for wider access.

From your terminal or agent

Some settings need the terminal, for example client credentials on an existing connection. Store secrets with --secret. Do not put secrets in --config.

ocmgr connection setup slack --json
ocmgr connection create --kind slack --config '{}' --secret configToken=<token> --json
ocmgr connection connect <connectionId> --json   # open human_url signed in as the workspace owner
ocmgr connection verify <connectionId> --json

# Your own OAuth app instead of a configuration token
ocmgr connection create --kind slack --config '{}' \
  --secret clientId=<id> --secret clientSecret=<secret> --json

Open the link from connect_connection in a browser signed in to Datum and Slack.

Import a Slack export

  1. In Slack, open Settings & administration → Workspace settings → Import/Export Data.
  2. Export the date range that you want.
  3. Download the ZIP.
  4. In Datum, open Sources → Connect a source → Slack export.
  5. Choose the ZIP.
  6. Check the counts of people and public channels.
  7. Press Import ZIP.
  8. Check Recent runs on the connection page until the import is complete.

Datum puts the history in a queue and imports it in the background.

To import a later export, open the same connection and press Upload another ZIP. If you retry an interrupted upload, or import dates that overlap, Datum does not duplicate activity.

The browser reads the ZIP on your computer and sends it in small batches. Datum removes message text before it stores anything. Only people and the activity metadata of public channels go to the import queue. Datum does not import private channels or direct messages. The server does not keep the ZIP, so later text analysis cannot read it again. Datum keeps accepted batch metadata for 30 days, and member erasure clears it.

The browser accepts ZIPs up to 100 MB, with at most 20,000 files. The expanded JSON can be up to 256 MB in total and 64 MB for each file. For a larger archive, use the server or CLI import below.

A partial upload can put some history in the queue. To retry safely, select the same ZIP. If the source page says that Datum could not store Slack export batches, upload the ZIP again. Those batches did not get to the import, and a replay cannot recover them. This is true even if the browser said that the upload finished.

Datum finds the workspace from the people in the export. If it can identify the workspace, it uses the same workspace ID as the Slack app connection. The matcher then treats the two sources as the same population. An export that Datum cannot identify stays separate, and the preview tells you before the import. Later exports must match the workspace of the connection.

Terminal and API imports

If the process that runs the CLI can read the ZIP, use a connection with a path:

ocmgr connection create --kind slack-export --name 'Slack history' --config '{"path":"/data/imports/slack.zip"}' --json
ocmgr connection verify <connectionId> --json
ocmgr ingest <connectionId> --json

A served request or a queued backfill can read only paths inside OCMGR_IMPORT_DIR. The worker must also be able to read the file. Browser uploads do not need shared file storage.

API clients can create a slack-export connection with {"browserUpload":true,"teamId":"T…"}. They then send batches to POST /v1/connections/{id}/slack-export. The MCP tool is import_slack_export_batch. The terminal command is ocmgr slack-export import <connectionId> --batch batch.json --json.

Each batch has these fields:

  • batchId: a stable SHA-256 hex ID.
  • observedAt: an ISO timestamp.
  • kind: users or messages.
  • records: up to 250 native Slack records, less than 768 KiB in total.
  • channel: for message batches only, the public channel, as {"id":"C…","name":"general"}.

Send all users batches before the first messages batch. Put "usersComplete": true on the last users batch. Only users.json tells which accounts are bots. Thus, Datum refuses messages batches until the last users batch arrives. A new users batch without the flag makes Datum refuse messages batches again.

When you retry, keep the batch ID, the contents and the observation time the same. You can find the inbound_event_id from the response in the inbound log. A receipt confirms that Datum stored the batch. The worker imports it later as historical data.

Data Datum imports

Members Name, handle, avatar, title, time zone and email address
Activity Messages, thread replies and reactions, with links back to Slack
Presence Who was active on each day, without storing what anyone said
Not collected Direct messages, private channels, and message text

Datum stores message titles and metadata without message text. Its Slack cards contain the same information.

Troubleshooting

Bots counted as community members

Slack bots imported by an earlier version stay as accounts, because Datum does not delete history. To leave them out of community counts:

  1. Make Datum read the Slack user list again. For an export, upload the ZIP again. For the Web API connection, start a backfill from the beginning.
  2. Run ocmgr members classify-non-persons --dry-run --json. An agent can use classify_non_person_accounts with dry_run.
  3. Check the counts.
  4. Run the command again without the dry run.

organisationDissolves is the number of company records that the command would dissolve in your CRM or warehouse. These companies would then have only staff and bots.

The command classifies only the accounts that the Slack user list marks as bots. These accounts do not become staff, so a filter on team members does not find them. If a member also has another account, the command lists the member in mixedMemberIds and does not change it. Check those members manually. Classified members stay in the Everyone view, and analytics do not include them. To count a member again, run ocmgr members clear-non-person <memberId> --json.

“Email scope missing”

The app does not have permission to read email addresses. Possibly, a person removed that scope during the approval.

  1. Press Grant email scope on the Slack row in Sources.
  2. Approve the full permission list in Slack, including View email addresses of people in a workspace.

If Slack does not show that permission, the app itself does not have the scope. Update the app:

  1. Generate a new configuration token.
  2. Store the token with ocmgr connection update <connectionId> --secret configToken=<token>.
  3. Press Grant email scope again.

Datum updates the scopes of the app before Slack asks for approval. After the next sync, the warning goes away and accounts start to link through email.

“No user in this export carries an email address”

Some exports do not include addresses. Datum checks the actual records. To supply addresses for linking, connect the Slack app as well as the export.

FAQ

Will Datum post anything in Slack?

Only when you ask for it. Routing rules and Send to… on member pages create cards and direct messages. Direct messages go only to your own team, never to community members.

Can I use a bot token I already have?

Yes. A pasted bot token works if it has the same scopes. users:read.email supplies addresses for linking.

Does it read new messages straight away?

Yes, after the app joins a channel. Slack sends new messages when they occur. If your workspace uses Tightknit, turn on polling to include its site posts.