--- title: Add a Slack source slug: l8490367 canonical_url: https://docs.coveo.com/en/l8490367/ collection: index-content source_format: adoc --- # Add a Slack source [.version.enterprise-required] [Enterprise](https://docs.coveo.com/en/l2590456#platform-plans) Slack workspace administrators can [index](https://docs.coveo.com/en/204/) the content of a Slack workspace and make it searchable to workspace members through a Coveo-powered [search interface](https://docs.coveo.com/en/2741/). To do so, you must create a Slack [source](https://docs.coveo.com/en/246/) in your [Coveo organization](https://docs.coveo.com/en/185/). You can index messages, including files and attachments, from specific public and private channels. Additionally, you can also choose to index channel and user-profile data as separate items. When a member of your Slack workspace clicks a query result from a Slack source in a Coveo-powered search interface, the user is redirected to the corresponding item in Slack. Your Slack source provides your Coveo organization with authorization to access your Slack workspace items using an OAuth 2.0 access token. The access token is linked to a [Slack bot](https://docs.coveo.com/en/l84f5496/) that you create for use with your source. The Slack bot is installed in your workspace and added to the channels that you want to index. > **Leading practice** > > The number of [items](https://docs.coveo.com/en/210/) that a source processes per hour (crawling speed) depends on various factors, such as network bandwidth and source configuration. > See [About crawling speed](https://docs.coveo.com/en/2078/) for information on what can impact crawling speed, as well as possible solutions. ## Source key characteristics The following table presents the main characteristics of a Slack source. [cols="4",options="header"] |=== 2+|Features |Supported |Additional information 2+|Slack version ^|Latest version | 2+|Indexable content |Messages, channels, user profiles, files, and attachments. | .3+.^|[Content update operations](https://docs.coveo.com/en/2039/) |[refresh](https://docs.coveo.com/en/2710/) ^|[check] |To set an automatic refresh schedule, see [Schedule a source update](https://docs.coveo.com/en/1933/). A rescan or rebuild is required to take account of deleted messages, deleted channels, and deleted user profiles, and to retrieve replies to messages. |[rescan](https://docs.coveo.com/en/2711/) ^|[check] |To set an automatic rescan schedule, see [Schedule a source update](https://docs.coveo.com/en/1933/). Extracts all of the data and indexes new items and existing items with a modified date greater than the date in the index. The data that your source scans depends on your source [Messages](#messages-subtab) options. |[rebuild](https://docs.coveo.com/en/2712/) ^|[check] |The data that your source scans depends on your source [Messages](#messages-subtab) options. .3+.^|[Content security](https://docs.coveo.com/en/1779/) options |[Same users and groups as in your content system](https://docs.coveo.com/en/1779#same-users-and-groups-as-in-your-content-system) ^|[check] | |[Specific users and groups](https://docs.coveo.com/en/1779#specific-users-and-groups) ^|[check] | |[Everyone](https://docs.coveo.com/en/1779#everyone) ^|[check] | |=== ## Requirements Before creating a new Slack source, [create a Slack bot](https://docs.coveo.com/en/l84f5496/) and add it to your workspace and channels. ## Add a Slack source > **Leading practice** > > It's best to create or edit your source in your sandbox organization first. > Once you've confirmed that it indexes the desired content, you can copy your source configuration to your production organization, either [with a snapshot](https://docs.coveo.com/en/3239/) or manually. > > See [About non-production organizations](https://docs.coveo.com/en/2959/) for more information and best practices regarding sandbox organizations. . Before you create a new Slack source, ensure that you've [created a Slack bot](https://docs.coveo.com/en/l84f5496/) for use with your source. . On the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page, click **Add source**, and then select **Slack**. . Enter a **Name** for your source. > **Leading practice** > > A source name can't be modified once it's saved, therefore be sure to use a short and descriptive name, using letters, numbers, hyphens (`-`), and underscores (`_`). Avoid spaces and other special characters. . Enter the OAuth **Access token** of the Slack connector bot that you created for your Slack source. > **Note** > > [Get your Slack bot's OAuth access token](https://docs.coveo.com/en/l84f5496#get-the-slack-bot-oauth-access-token) from the Slack API website. > You can [change the access token](#authentication-subtab) at any time after creating your source. . Use the **Project** selector to associate your source with one or more [projects](https://docs.coveo.com/en/n7ef0517/). > **Note** > > After source creation, you can update your Coveo project selection under the [**Identification**](#identification-subtab) subtab. . Click **Add source**. . Specify your source settings. Refer to the following sections for detailed information on the source settings: ** ["Configuration" tab](#configuration-tab) ** ["Content security" tab](#content-security-tab) ** ["Access" tab](#access-tab) > **Note** > > You can save your source settings at any time by clicking **Save and rebuild source**/**Save**. ### "Configuration" tab Select the channels to index and what to index from the selected channels. You can also change the access token to link the source to a different Slack connector bot. #### "Channels" subtab This section lists all the Slack channels to which you added the Slack connector bot that's [associated with this source](#authentication-subtab). Select a channel to index its messages. Your Slack source indexes the messages only for the selected channels. > **Tip** > > Use the **Type** dropdown menu to filter the list by private or public channels, or search for a specific channel by entering the channel name in the search field. > If you don't see a channel in the list, [add the Slack connector bot to the channel](https://docs.coveo.com/en/l84f5496#add-the-slack-bot-to-your-channels) in your workspace. > **Notes** > > * 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. > > * If you archive or delete a previously indexed Slack channel, your source removes all corresponding message data from the index following a rescan or rebuild. > **Important** > > Select the **Same users and groups as in your content system** [content security](#content-security-tab) option to ensure that only members of the private channel have access to the channel's content in a Coveo-powered search interface. #### "Messages" subtab Specify the indexing options for the messages that are sent from the [selected channels](#channels-subtab). ##### Include bot messages By default, your Slack source indexes messages sent only by workspace members. Enable **Include messages sent by bots and integrations in Slack** to also index messages sent by bots and integrations. ##### Index messages sent Slack channels can contain a large amount of message data. This option limits the amount of data that's scanned and indexed/re-indexed by your source, which not only accelerates the indexing operation but ensures that your index isn't cluttered with excessive message data. Set your source to index a subset of your message history by specifying an indexing window based on a floating time period or a start date. The option you choose depends on your organizational needs and on the amount of message data that's sent across your indexed channels. ![Slack source indexing date | Coveo](https://docs.coveo.com/en/assets/images/index-content/slack-source-time-frame.png) * Select **Only during the last** to set a floating time frame for which to index messages. * Select **Since this date** to set a date from which to start indexing messages. > **Note** > > Your source indexes new and modified message data only if the creation or modified date falls within the indexing window. > Messages that were sent or modified before the start of the indexing window aren't indexed by your source. > If a message that was previously indexed no longer falls within the indexing window, the message is deleted from the index during the next rescan or rebuild. > > As for replies, your source indexes a reply message only if the parent message is also indexed. > For example, if a reply is sent during the indexing window, but the parent message was created outside of the indexing window, your source doesn't index the reply because the parent message isn't indexed. > A source [rescan or rebuild](https://docs.coveo.com/en/2039/) is required to index replies to messages. > **Notes** > > * This option applies to message data only. > If you choose to index [channels](#additionalchannels) and [members](#members) as additional separate items, your source always indexes all the channel data and member data in the workspace. > > * To display message replies hierarchically below the parent message in your search interface result list, [enable result folding](#enable-result-folding-for-slack-threads) in your search page. #### "Additional content" subtab Specify additional content to index as separate items. > **Note** > > If you archive a previously indexed Slack channel, your source removes all corresponding data from the index following a rescan or rebuild. ##### Channels Select this option to index every channel in your workspace as a separate item. When a query matches the channel name, the channel appears as a separate result in a Coveo-powered search interface. > **Note** > > This option applies only to channel data and not to the indexing of channel messages. > Message data is indexed based on your source [channels](#channels-subtab) and [messages](#messages-subtab) settings. ##### Files and attachments Select this option to index the files and attachments in indexed messages as separate items. This allows users to search for filenames or content within a file/attachment. When a query matches the filename or content of a file, the file appears as a separate result in a Coveo-powered search interface. If this option is disabled, files and attachments aren't indexed, and therefore aren't searchable in a Coveo-powered search interface. Your source is configured to index the most common file types by default, such as `.doc`, `.xls`, `.pdf`, `.txt`, `.html`, and `.json`. Review your source JSON configuration to [view and modify the list of supported item types](https://docs.coveo.com/en/l3qg9275/). ##### Members Select this option to index the profiles of your Slack workspace members. When a query matches a name or display name in Slack, the member appears as a separate result in a Coveo-powered search interface. When combined with the **Files and attachments** option, users can filter search results based on the document author. If you index member profiles, you can also choose to **Include deleted or archived members** in your index. #### "Authentication" subtab Your Slack source authorizes the Coveo organization to access your workspace items using your [Slack connector bot's](https://docs.coveo.com/en/l84f5496/) OAuth 2.0 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. Your Slack source was linked to a Slack connector bot, via an access token, when the source was created. However, you can change the Slack connector bot that's associated with this source by changing the source access token. > **Note** > > The **Authentication** page shows the Slack workspace in which the associated Slack connector bot is installed. > **Important** > > If you change the access token for your source, revisit your source's [**Channels**](#channels-subtab) subtab to select the channels from which to index messages. To change the Slack connector bot that's associated with this source . Get the [Slack connector bot's OAuth access token](https://docs.coveo.com/en/l84f5496#get-the-slack-bot-oauth-access-token). . In the **Authentication** section of your Slack source, click **Edit**. . Paste the access token in the token field. . Click **Save**. #### "Identification" subtab The **Identification** subtab contains general information about the source. ## Name The source name. It can't be modified once it's saved. :leveloffset!: ##### Project Use the **Project** selector to associate your source with one or more Coveo [projects](https://docs.coveo.com/en/n7ef0517/). ### "Items" tab On the **Items** tab, you can specify how the source handles items based on their file type or content type. #### File types File types let you define how the source handles [items](https://docs.coveo.com/en/210/) based on their file extension or content type. For each file type, you can specify whether to index the item content and [metadata](https://docs.coveo.com/en/218/), only the item metadata, or neither. You should fine-tune the file type configurations with the objective of indexing only the content that's relevant to your users. **Example** Your repository contains `.pdf` files, but you don't want them to appear in search results. You click **Extensions** and then, for the `.pdf` extension, you change the **Default action** and **Action on error** values to `Ignore item`. For more details about this feature, see [File type handling](https://docs.coveo.com/en/l3qg9275/). #### Content and images If you want Coveo to extract text from image files or PDF files containing images, enable the appropriate option. The extracted text is processed as item data, meaning that it's fully searchable and will appear in the item [Quick view](https://docs.coveo.com/en/2760#search-result-quick-view). > **Note** > > When OCR is enabled, ensure the source's relevant [file type configurations](https://docs.coveo.com/en/l3qg9275/) index the item content. > Indexing the item's metadata only or ignoring the item will prevent OCR from being applied. See [Enable optical character recognition](https://docs.coveo.com/en/2937/) for details on this feature. ### "Content security" tab Select who will be able to access the source items through a Coveo-powered [search interface](https://docs.coveo.com/en/2741/). For details on the content security options, see [Content security](https://docs.coveo.com/en/1779/). > **Note** > > Select the **Same users and groups as in your content system** option to ensure that workspace content is accessible only by intended users based on your Slack permission system. > With this option enabled, an active Slack workspace member has access to message data for all public channels in the workspace, but only for private channels in which they're a member. > **Important** > > When using the **Everyone** content security option, see [Safely apply content filtering](#safe) for information on how to ensure that your source content is safely filtered and only accessible by intended users. ### "Access" tab . On the **Access** tab, specify whether each group (and API key, if applicable) in your [Coveo organization](https://docs.coveo.com/en/185/) can view or edit the current source. For example, when creating a new source, you could decide that members of Group A can edit its configuration, while Group B can only view it. For more information, see [Custom access level](https://docs.coveo.com/en/3151#custom-access-level). On the **Access** tab, specify whether each group (and API key, if applicable) in your [Coveo organization](https://docs.coveo.com/en/185/) can view or edit the current source. For example, when creating a new source, you could decide that members of Group A can edit its configuration, while Group B can only view it. For more information, see [Custom access level](https://docs.coveo.com/en/3151#custom-access-level). ## Build or rebuild your source You must build the source in order for Coveo to retrieve the source content and apply changes to your source settings. You can build or rebuild your source by doing either of the following: * You can choose to build or rebuild when saving the source by clicking **Save and rebuild source**. * You can build or rebuild your source directly from the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page by clicking **Launch build** or **Launch rebuild** in the **Status** column for your source. Alternatively, you can click the source, and then click **More** > **Rebuild** in the Action bar. Once the source is built, you can [review its content in the Content Browser](https://docs.coveo.com/en/2053/). ## Enable result folding for Slack threads To display replies from a Slack thread in your search results and group the replies with the original message, enable _result folding_ in your search page. This enhances the end-user experience as users expect query results that belong to the same conversation to be displayed in such a way that the original message is represented as the parent of each subsequent reply. **Example** The following image shows replies in a Slack thread grouped under the parent message in a search page with result folding enabled. ![Slack Message Thread](https://docs.coveo.com/en/assets/images/index-content/slack-thread.png) To enable result folding * If you're using a legacy [hosted search page](https://docs.coveo.com/en/1656/) or the [JavaScript Search Framework](https://docs.coveo.com/en/375/) for your search interface, use the [`FoldingForThread`](https://docs.coveo.com/en/428#enable-result-folding) component to enable result folding in your search page. Your Slack source includes [default preconfigured fields](https://docs.coveo.com/en/2718/) (`foldingcollection`, `foldingchild`, and `foldingparent`) in your index for use with your result folding implementation. > **Note** > > For hosted search pages, a `CoveoFolding` component is automatically added to your search page. Open the Interface Editor via the [**Search Pages**](https://platform.cloud.coveo.com/admin/#/orgid/search/search-pages/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/search/search-pages/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/search/search-pages/)) page, and then, on the **Code View** tab, replace `CoveoFolding` with `CoveoFoldingForThread`. > Folded results are automatically rendered when using the prebuilt Slack result template with hosted search pages. * If you're using [Headless](https://docs.coveo.com/en/headless/latest/), [Atomic](https://docs.coveo.com/en/atomic/latest/), or [REST API](https://docs.coveo.com/en/1370/) for your search interface, refer to the corresponding documentation for information on how to implement result folding in search results: ** Headless: [`FoldedResultList`](https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FoldedResultList.html) ** Atomic: [`atomic-folded-result-list`](https://static.cloud.coveo.com/atomic/v3/storybook/index.html?path=/docs/atomic-folded-result-list\--docs) ** REST API: [Handle folded results](https://docs.coveo.com/en/1372#handle-folded-results) ## Verify and edit your source fields and mappings [mappings](https://docs.coveo.com/en/217/) define what Coveo [index](https://docs.coveo.com/en/204/) [fields](https://docs.coveo.com/en/200/) contain for each [source](https://docs.coveo.com/en/246/) [item](https://docs.coveo.com/en/210/). Your Slack source automatically includes mapping rules for the fields that are indexed. The default mapping rules are suitable in most instances. However, you can modify the mappings as required. Do one or both of the following to verify and edit your field mappings: * Access the [mapping panel for your source](https://docs.coveo.com/en/1640#navigating-the-edit-mappings-panel), and then review and [edit](https://docs.coveo.com/en/1640#manage-mappings) the mappings as required. * [Build your source](https://docs.coveo.com/en/2107#build-or-rebuild-your-source), use the [**Content Browser**](https://platform.cloud.coveo.com/admin/#/orgid/content/browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/browser/)) to inspect the source content, and then [edit](https://docs.coveo.com/en/1640#manage-mappings) the mappings as required. ### Create additional source fields and mappings (optional) In certain situations, you may want to create a field in addition to the fields that are created automatically by your source. For example, you may want to create a field that's used across multiple sources and mapped to different metadata for each source, or you may want to create a field that aggregates multiple metadata for a single source. To create additional fields and mappings: . [Add a field](https://docs.coveo.com/en/1833#add-a-field) to the Coveo index manually. . [Create a mapping rule](https://docs.coveo.com/en/1640#manage-mappings) in each source that you want to use the new field. . [Build the sources that you modified](https://docs.coveo.com/en/2107#build-or-rebuild-your-source). ## [[safe]]Safely apply content filtering The best way to ensure that your indexed content is seen only by the intended users is to enforce [content security](#content-security-tab) by selecting the [**Same users and groups as in your content system**](https://docs.coveo.com/en/1779#same-users-and-groups-as-in-your-content-system) option. Should this option be unavailable, select [**Specific users and groups**](https://docs.coveo.com/en/1779#specific-users-and-groups) instead. However, if you need to configure your source so that the indexed source content is accessible to [**Everyone**](https://docs.coveo.com/en/1779#everyone), you should adhere to the following leading practices. These practices ensure that your source content is safely filtered and only accessible by the appropriate users: * [Configure query filters](#configure-query-filters): Apply filter rules on a query pipeline to filter the source content that appears in search results when a query goes through that pipeline. * [Use condition-based query pipeline routing](#use-condition-based-query-pipeline-routing): Apply a condition on a query pipeline to make sure that every query originating from a specific search hub is routed to the right query pipeline. ### Configure query filters [Filter rules](https://docs.coveo.com/en/3410/) allow you to enter hidden [query](https://docs.coveo.com/en/231/) expressions to be added to all queries going through a given [query pipeline](https://docs.coveo.com/en/180/). They're typically used to add a field-based expression to the [constant query expression (`cq`)](https://docs.coveo.com/en/179/). **Example** You apply the `@objectType=="Solution"` query filter to the pipeline to which the traffic of your public support portal is directed. As a result, the `@objectType=="Solution"` query expression is added to any query sent via this support portal. Therefore, if a user types `Speedbit watch wristband` in the search box, the items returned are those that match these keywords and whose `objectType` has the `Solution` value. Items matching these keywords but having a different `objectType` value aren't returned in the user's search results. To learn how to configure query pipeline filter rules, see [Manage filter rules](https://docs.coveo.com/en/3410/). > **Note** > > You can also enforce a filter expression directly in the [search token](#configure-the-search-token). ### Use condition-based query pipeline routing The most recommended and flexible query pipeline routing mechanism is [condition-based routing](https://docs.coveo.com/en/1666#condition-based-routing-recommended). When using this routing mechanism, you ensure that search requests are routed to a specific query pipeline according to the search interface from which they originate, and the authentication is done server side. To accomplish this: . [Apply a condition to a query pipeline based on a search hub value](https://docs.coveo.com/en/1959/), such as **Search Hub is Community Search** or **Search Hub is Agent Panel**. This condition ensures that all queries that originate from a specific search hub go through that query pipeline. . [Authenticate user queries via a search token](#configure-the-search-token) that's generated server side and that contains the search hub parameter that you specified in the query pipeline. > **Note** > > If you're using the Coveo In-Product Experience (IPX) feature, see [Implement advanced search token authentication](https://docs.coveo.com/en/3160#option-2-implement-advanced-search-token-authentication). ## Required privileges You can assign privileges to allow access to specific tools in the [Coveo Administration Console](https://docs.coveo.com/en/183/). The following table indicates the privileges required to view or edit elements of the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page and associated panels. See [Manage privileges](https://docs.coveo.com/en/3151/) and [Privilege reference](https://docs.coveo.com/en/1707/) for more information. > **Note** > > The **Edit all** privilege isn't required to create sources. > When granting privileges for the [Sources](https://docs.coveo.com/en/1707#sources-domain) domain, you can grant a group or API key the **View all** or [**Custom**](https://docs.coveo.com/en/3151#custom-access-level) access level, instead of **Edit all**, and then select the **Can Create** checkbox to allow users to create sources. > See [Can Create ability dependence](https://docs.coveo.com/en/3151#can-create-ability-dependence) for more information.