Query and analyze your team’s Slack messages, channels, and engagement patterns directly through Ana.
The Slack API Connector covered in this guide is separate from the Slack integration used in Playbooks. For Playbooks setup, see the Slack Integration.
1. Overview
The Slack connector links your workspace to Ana, enabling her to search messages, post to channels, DM users, and surface engagement patterns across your team’s conversations. Ana can answer questions about communication trends, track topic activity over time, and identify patterns across public channels and direct messages based on the permissions granted. Note that Ana’s access is limited to the channels and message history your Slack plan and permission settings allow.
Quick Summary: Create a Slack app in your workspace, configure the required OAuth scopes, and store the bot token as an API Connector in TextQL.
2. Prerequisites
You’ll need:
- Slack account with access to the channels and data you want Ana to query
- Admin access in your Slack workspace to create and install a Slack app
- Enterprise Grid admin access if you are setting up an Org-level OAuth integration
- A TextQL account with permission to add API connectors
Which type of connection should I use?
TextQL supports three ways to connect to Slack depending on how much access Ana needs: API Token, OAuth Org-Level, and OAuth Per-Member.
| API Token | OAuth Org-Level | OAuth Per-Member |
|---|
| Best for | Small teams, quick setup | Enterprise Grid orgs | Teams needing per-user permissions |
| Access scope | Public channels + channels bot is invited to | All workspaces across the org | Each user’s personal channels and DMs |
| Slack plan required | Any | Enterprise | Any |
| Admin required | Workspace Admin | Org Admin | Workspace Admin + each user must authorize |
| Ana acts as | Bot user | Bot user across org | Individual members |
| Access to DMs | No | Send, not read | Send and read |
| Access to private channels | Only if invited | Only if invited | Yes, per user |
3. Capabilities
Once configured, Ana can:
- Find information across channels, threads, and conversations
- Post messages and send DMs on your behalf
- React to and comment on messages within channels and threads
- Analyze engagement patterns, message volume trends, and topic activity over time
- Identify how team members interact across channels and track participation patterns
- Access channel lists, membership, and workspace metadata to provide organizational context
The integration uses OAuth 2.0 or bot token authentication based on the connection type you select.
4. Setup Instructions
Step 1. Create your Slack App
- Go to api.slack.com/apps and click Create New App
- A pop-up will appear — click From Scratch
- Choose an app name (e.g. “Ana” or “TextQL Integration”)
- Pick the workspace you want Ana installed in
- Click Create App
You must have Admin or Owner permissions in the workspace you’re installing the app to. If you don’t have access, contact your Slack workspace admin.
-
In the left sidebar, go to OAuth & Permissions
-
If you are creating an OAuth Org-Level or Per-Member connection, scroll down to Redirect URLs and add
https://app.textql.com/auth/api-oauth/callback. Click Save.
-
Scroll down to Scopes and add your desired permissions (see recommended scopes table below — if you are unsure, add all Core scopes)
- For API Token or OAuth Org-Level, add permissions under Bot Token Scopes
- For OAuth Per-Member, add permissions under both Bot Token Scopes and User Token Scopes
Recommended Scopes
| Scope | Description | Use Case |
|---|
channels:read | See public channels | Core |
channels:history | Read messages in public channels | Core |
chat:write | Post messages as the bot | Core |
reactions:write | Add emoji reactions | Core |
users:read | View people in the workspace | Core |
team:read | View workspace info | Core |
files:read | View shared files | Read |
files:write | Upload and edit files | Write |
groups:read | View private channels | Private Channel |
groups:history | Read private channel messages | Private Channel |
im:read | View DMs | Per-Member |
im:history | Read DM messages | Per-Member |
mpim:read | View group DMs | Per-Member |
mpim:history | Read group DM messages | Per-Member |
search:read | Search across the workspace | Per-Member |
Step 3. Get your Credentials
API Token: On the same OAuth & Permissions page, scroll up to OAuth Tokens and click Install to Workspace. Authorize the app and copy the xoxb- token that is generated.
OAuth Org-Level & Per-Member: In the left sidebar, go to Basic Information and copy your Client ID and Client Secret.
Step 4. Connect in TextQL
- Click Connectors in the bottom left corner
- In the left sidebar, click APIs then select Slack
- Fill in a name for your connection
- Select your authentication type — API Token, OAuth Org-Level, or OAuth Per-Member
- Paste your bot token, or your Client ID and Client Secret for OAuth methods
- For OAuth methods, scroll down and click Authenticate
- A popup will appear asking for permissions to access your workspace — click Allow
- Click Save
Step 5. Add the App to your Slack Channels
- In the workspace you installed the app to, open your desired channel and click the channel name at the top → Integrations → Add an App
- A popup with different app connections should appear — your app should be near the top under In Your Workspace
After adding the app, Slack will say “Invites have been sent!” — this is just a generic message, your app is already connected.
Step 6. Verify the Connection
Once saved, confirm that the connector is active:
- In Connectors → APIs, check that Slack appears in your list of active connectors
- Open a new Ana chat and ask a simple query, such as: “What was the most recent message sent to #channel?”
- If Ana returns results, the connection is working. If you see an error, refer to [Section 6: Troubleshooting]
5. Usage Examples
Once configured, you can ask Ana:
- “How many messages were sent in #general this week compared to last week?”
- “Which channels have been the most active in the last 30 days?”
- “Who are the most engaged members in #product and what topics are they discussing?”
- “Summarize the key decisions made in #engineering over the past month”
- “Which team members haven’t been active in any channels in the last two weeks?”
- “Send a message to Sam saying what are your blockers?“
6. Troubleshooting
| Symptom | Likely Cause | Fix |
|---|
| ”This app doesn’t have a bot user to install” when clicking Authenticate | No bot token scopes added, or only user token scopes were configured | Go to OAuth & Permissions → scroll to Bot Token Scopes → add at least one scope |
| ”Missing scope” error when querying Ana | Required scopes weren’t added during setup | Go to OAuth & Permissions → add the missing scopes from the recommended list in Step 2 |
| OAuth flow not completing when clicking Authenticate | Redirect URL not added or incorrect | Go to OAuth & Permissions → Redirect URLs → confirm https://app.textql.com/auth/api-oauth/callback is saved |
| ”not in channel” error when Ana tries to access a channel | The bot hasn’t been added to that channel | Go to the channel in Slack → click the channel name → Integrations → Add an App |
7. Security Notes
- Bot tokens don’t expire by default. User tokens are tied to the authorizing user and will lose access if that user is deactivated or removes the app. If you opted into token rotation on Slack, tokens will automatically refresh in your app code
- Avoid using legacy bot tokens or legacy custom integration tokens — these are deprecated and use an umbrella permission model that grants broader access than necessary. Always use the newer granular bot token scopes
- Your token, Client ID, and Client Secret are stored encrypted in TextQL and are never exposed in Ana’s responses
- For more information on token types, scopes, and security best practices, visit Slack Developer Docs
- To disconnect the bot, go to your Slack workspace → Settings & Administration → Manage Apps → find your app → click Remove. For Per-Member, individual users can revoke their own access at slack.com/account/connected-apps. Then delete the connector in TextQL under Connectors → APIs
Need Help?
For further assistance, please contact support@textql.com.
Privacy Policy
For information about how we handle your data and protect your privacy, please review our Privacy Policy.