This guide walks you through creating and configuring a Slack app to send messages to Cortex.
- Go to api.slack.com/apps
- Click Create New App > From scratch
- Name it (e.g., "Cortex Bot") and select your workspace
- Click Create App
- In the left sidebar, go to OAuth & Permissions
- Scroll to Bot Token Scopes and add:
channels:history- Read messages in public channelschannels:read- View basic channel infogroups:history- Read messages in private channels the bot is inusers:read- Resolve user display names
- Scroll to the top of OAuth & Permissions
- Click Install to Workspace
- Authorize the requested permissions
- Copy the Bot User OAuth Token (
xoxb-...) - Add it to your
.envfile asSLACK_BOT_TOKEN
- Go to Basic Information in the left sidebar
- Under App Credentials, find Signing Secret
- Click Show and copy it
- Add it to your
.envfile asSLACK_SIGNING_SECRET
- Go to Event Subscriptions in the left sidebar
- Toggle Enable Events to On
- Set the Request URL to your Harper endpoint:
- Local development:
https://YOUR_NGROK_URL/SlackWebhook - Production:
https://YOUR_CLUSTER.harperfabric.com/SlackWebhook
- Local development:
- Slack will send a verification challenge. The app handles this automatically.
Under Subscribe to bot events, add:
message.channels- Messages in public channelsmessage.groups- Messages in private channels (optional)
Click Save Changes.
If Slack asks you to reinstall the app after changing scopes or events, do so.
In each Slack channel you want monitored, type:
/invite @Cortex Bot
(Use whatever name you gave your app in Step 1.)
Send a test message in a monitored channel. Check the Memory table:
curl https://YOUR_CLUSTER.harperfabric.com/Memory/ \
-H "Authorization: Basic YOUR_AUTH"You should see a new record with rawText, classification, entities, and embedding populated.