Connect Slack to Managed Agents Limited availability
Connect Slack to Managed Agents to let your agents read Slack messages, list channels, and look up users and user groups. You can also allow agents to send messages, add reactions, join and leave channels, mark conversations as read, and manage user groups.
A bot token (xoxb-...) is limited to conversations the Slack bot is a member
of. A user token (xoxp-...) uses that Slack user's access and the scopes you
grant.
To get started, create or configure a Slack app and use its bot token to connect the integration in the Aiven Console.
Prerequisites
- Managed Agents enabled for your project. If you have not requested access or enabled Managed Agents, see Enable Managed Agents.
- A Slack workspace where you can create an app and install it, or request installation approval.
Create and configure a Slack app
-
Go to Slack API: Your Apps and create a Slack app or select an existing app.
-
Add the following Bot Token Scopes:
Scope Purpose channels:read,channels:historyList public channels and read their messages. groups:read,groups:historyList private channels and read their messages. im:read,im:historyAccess direct message conversations and read their messages. mpim:read,mpim:historyAccess group direct message conversations and read their messages. search:read.publicSearch public channel content. users:readLook up Slack users. usergroups:readList user groups. canvases:readRead Slack canvases. For more information, see Slack OAuth scopes.
-
Optional: Add the following Bot Token Scopes for the write tools you enable:
Scope Purpose chat:writeSend messages. reactions:writeAdd and remove reactions. channels:joinJoin public channels. channels:manageLeave public channels and mark them as read. usergroups:writeCreate and update user groups and their members. -
Install the app to your Slack workspace and authorize the requested permissions. If installation requires approval, request it from your Slack workspace administrator.
If you change the scopes after installing the app, reinstall the app to authorize the updated permissions.
-
In your Slack app settings, open OAuth & Permissions and copy the Bot User OAuth Token (
xoxb-...).warningKeep your Slack token secure. Anyone with access to the token can access Slack resources with the permissions you granted to the app.
For more information, see Slack tokens.
Connect Slack to an agent
Before you start, have the bot token from your Slack app ready.
- In the Aiven Console, open your project.
- Select Agents, then select your agent.
- Select Integrations > Manage integrations.
- Under Integrations catalog, find Slack and select Connect to open the Connect Slack dialog.
- In the dialog:
- In Integration name, enter a name for the integration, such as
slack. - In Slack Bot / User Token, enter the bot token from your Slack app.
- Optional: To allow the agent to make changes in Slack, turn off Read-only access. This setting is on by default. In read-only mode, the agent can use only the read tools listed in Available Slack tools. The Slack app must also have the scopes that the write tools need.
- In Integration name, enter a name for the integration, such as
- Select Connect.
- Close the Manage agent integrations dialog.
- On the agent's Integrations page, enable the Slack integration and select the tools the agent can use. Write tools appear only when Read-only access is turned off.
- Select Save changes.
The agent can now use the selected Slack tools, subject to the permissions granted to your Slack app.
Available Slack tools
The tools that an agent can use depend on the Read-only access setting and on the type of Slack token.
Read-only mode
When Read-only access is on, the agent can use the following tools:
| Tool | Purpose |
|---|---|
| Channels List | List channels. |
| Channels Me | List the channels that the Slack user or bot is a member of. |
| Conversations History | Read messages in a channel or direct message. |
| Conversations Replies | Read the replies in a message thread. |
| Users Search | Look up Slack users. |
| Usergroups List | List user groups. |
| Usergroups Me | List the user groups that the Slack user belongs to. |
Write mode
When you turn off Read-only access, the agent can use the read tools and the following write tools:
| Tool | Purpose |
|---|---|
| Conversations Add Message | Send a message to a channel or thread. |
| Reactions Add | Add a reaction to a message. |
| Reactions Remove | Remove a reaction from a message. |
| Conversations Join | Join a channel. |
| Conversations Leave | Leave a channel. |
| Conversations Mark | Mark a conversation as read. |
| Usergroups Create | Create a user group. |
| Usergroups Update | Update a user group. |
| Usergroups Users Update | Update the members of a user group. |
Tools that require a user token
If you connect with a user token (xoxp-...), the agent can also use the
following tools in both modes. Bot tokens (xoxb-...) can't use these tools.
| Tool | Purpose |
|---|---|
| Conversations Search Messages | Search messages. |
| Conversations Unreads | List conversations with unread messages. |
Manage the Slack integration
To view or manage your Slack integration, open the agent's Integrations page and select Manage integrations.
If the integration shows Reconnect required, select reconnect and enter a valid Slack token to restore access.
To change which Slack tools an agent can use, update the tool selection on the Integrations page and select Save changes.
Slack integrations keep the tool list from when you connected them. To get the current tools, disconnect the integration and connect it again.
Related pages