--- title: Create a Slack connector bot slug: l84f5496 canonical_url: https://docs.coveo.com/en/l84f5496/ collection: index-content source_format: adoc --- # Create a Slack connector bot To have your [Slack source](https://docs.coveo.com/en/l8490367/) retrieve your workspace and channel data, you must [create a Slack bot and install it in your workspace](https://docs.coveo.com/en/l84f5496#create-and-install-a-slack-bot). Then, [add the bot to the channels](https://docs.coveo.com/en/l84f5496#add-the-slack-bot-to-your-channels) that you want to index. A Slack bot is essentially an app that contains bot token scopes, which give your Slack source permission to access your workspace data. Your Slack source authorizes the Coveo organization to access your workspace items using your Slack bot's OAuth 2.0 access token. > **Note** > > Org-wide installation of a Slack bot is not supported by the Slack source. > To index the content of multiple Slack workspaces, create a dedicated Slack source and Slack bot per workspace. ## Create and install a Slack bot Create the Slack bot [using a preconfigured manifest file](https://docs.coveo.com/en/l84f5496#use-the-manifest-file), which includes the required bot token scopes. You can also create the bot [manually](https://docs.coveo.com/en/l84f5496#create-the-app-manually) by adding each scope separately. ### Use the manifest file . Access the [app management page](https://api.slack.com/apps/) on the Slack API website. > **Note** > > If you're not logged in to a Slack account, a sign-in message appears on the Slack API website. > In this case, log in, select your Slack workspace, and then access the [app management page](https://api.slack.com/apps/) again. . Click **Create an App**/**Create New App**. . Click **From an app manifest**. . Select the workspace in which to install the app. . Click **Next**. . Replace the default YAML manifest with the following: ```yaml display_information: name: Coveo Slack Connector features: bot_user: display_name: Coveo Slack Connector always_online: false oauth_config: scopes: bot: - channels:history - channels:read - files:read - groups:history - groups:read - team:read - users.profile:read - users:read.email - users:read - usergroups:read settings: org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false ``` > **Note** > > The app name in the manifest is set to **Coveo Slack Connector** by default. You can modify the name as required. . Click **Next**, and then click **Create**. . [Install the app](https://api.slack.com/authentication/oauth-v2) on your workspace. > **Note** > > Once you install the app, the **Bot User OAuth Token** appears. > You'll need the access token when you [create your Slack source](https://docs.coveo.com/en/l8490367/). > > Copy the access token to a secure location where you can access it when creating your source, or [get the access token](https://docs.coveo.com/en/l84f5496#get-the-slack-bot-oauth-access-token) later. . [Add the app to each channel](https://docs.coveo.com/en/l84f5496#add-the-slack-bot-to-your-channels) that you want to index. ### Create the app manually . Access the [app management page](https://api.slack.com/apps/) on the Slack API website. > **Note** > > If you're not logged in to a Slack account, a sign-in message appears on the Slack API website. > In this case, log in, select your Slack workspace, and then access the [app management page](https://api.slack.com/apps/) again. . Click **Create an App**/**Create New App**. . Click **From scratch**. . Enter a descriptive **App Name**. . Select the workspace in which to install the app. . Click **Create App**. . Once you create the app, add the following [**Bot Token Scopes**](https://api.slack.com/authentication/oauth-v2#asking) to your app: ** `channels:read` ** `channels:history` ** `files:read` ** `groups:history` ** `groups:read` ** `team:read` ** `usergroups:read` ** `users:read` ** `users.profile:read` ** `users:read.email` . [Install the app](https://api.slack.com/authentication/oauth-v2) on your workspace. > **Note** > > Once you install the app, the **Bot User OAuth Token** appears. > You'll need the access token when you [create your Slack source](https://docs.coveo.com/en/l8490367/). > > Copy the access token to a secure location where you can access it when creating your source, or [get the access token](https://docs.coveo.com/en/l84f5496#get-the-slack-bot-oauth-access-token) later. . [Add the app to each channel](https://docs.coveo.com/en/l84f5496#add-the-slack-bot-to-your-channels) that you want to index. ## Add the Slack bot to your channels You can add your Slack bot to any number of public or private channels in your workspace. The message data that your Slack source has access to is limited to the Slack channels to which you add your Slack bot. This doesn't mean that your Slack source automatically indexes the messages for all the channels that contain your Slack bot. You can choose the channels to index in your Slack source [**Channels** subtab](https://docs.coveo.com/en/l8490367#channels-subtab). Adding your Slack bot to channels simply makes the channels available for selection in your Slack source. > **Note** > > To index the content of private channels, your [Slack bot must include the `groups:history` and `groups:read`](https://docs.coveo.com/en/l84f5496#create-and-install-a-slack-bot) bot token scopes. As new channels are created in your workspace, you can use the [`channel_created`](https://api.slack.com/events/channel_created) event in Slack to get notified of new channels. Use one of the following two methods to add a Slack bot to a channel: ### From a channel Use this method to add the Slack bot to a newly created channel, or to add the bot to a small number of channels. . In your Slack desktop application, click the channel that you want to index. . In the message field, enter `/add`, and then click **Add apps to this channel**. . Click **Add** corresponding to the app that's associated with your Slack bot. . Repeat the steps above to add the Slack bot to another channel. ### From the Apps sidebar menu Use this method to add the Slack bot to numerous channels. . In your Slack desktop application, if the app that's associated with your Slack bot doesn't appear under **Apps** in the left sidebar: .. Under **Apps**, click **Add Apps**. .. Click your app. Your app now appears under **Apps**. . Under **Apps**, right-click the app, and then click **View app details**. . Click **Add this app to a channel**. . Select the channel from the list. . Click **Add**. . Repeat steps 4 and 5 for each subsequent channel. [TIP.leading-practice] #### To see the channels to which your Slack bot is currently added, access your Slack source's [**Channels**](https://docs.coveo.com/en/l8490367#channels-subtab) subtab, or your Slack app management page as follows: . [Access your Slack app management page](https://app.slack.com/workspace-signin?redir=%2Fgantry%2Fapps-manage). . Select your workspace. . Select the app that's associated with your bot from the list. . Review the channels listed in the **Bot User** section. #### == Get the Slack bot OAuth access token This section details how to get the OAuth access token for your Slack connector bot. Your Slack source authorizes the Coveo organization to access your workspace items using your Slack connector bot's OAuth access token. The Slack data that your source has access to is limited to the Slack workspace and channels to which the Slack connector bot is added. You need the access token when [creating a Slack source](https://docs.coveo.com/en/l8490367#add-a-slack-source), or when [changing the access token](https://docs.coveo.com/en/l8490367#authentication-subtab) for an existing Slack source that you want to link to a different Slack bot. To get a Slack bot's access token . Access the [**Your Apps**](https://api.slack.com/apps/) page of the Slack API website. . Click the app that's associated with your Slack bot. . Click **OAuth & Permissions** in the left menu. . Under **OAuth Tokens for Your Workspace**, copy the **Bot User OAuth Token**.