> ## Documentation Index
> Fetch the complete documentation index at: https://ai-kb.automationanywhere.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate EKB Chatbot to Slack

> Bring EKB to Slack

Integrating EKB with Slack brings intelligent, context-aware chat directly into your workspace, allowing teams to interact with your AI agent without leaving Slack. This guide walks you through installing the EKB app in Slack, configuring permissions, and setting up a channel for seamless communication with your AI agent.

<Warning>
  Each EKB project can only be linked to a single Slack app. You will need to create a new Slack app for each additional EKB project you want to connect.
</Warning>

## Prerequisites

* You have:
  * your Project's `project id` at hand
  * a set of **API Key + Secret** to setup the EKB app in Slack

## Install and Set Up EKB App in Slack

1. Go to [Slack API Apps](https://api.slack.com/apps). You may need to log in to your Slack workspace.
2. Click **Create an App**.
3. Select **From scratch**.
4. Enter the **App Name** (e.g., "EKB Chatbot").
5. Select the **Development Slack Workspace** where you want to install the app.
6. Click **Create App**.
7. In the **Basic Information** section, note down the following values: `App ID`, `Client ID`, `Client Secret`, `Signing Secret`, and `Verfication Token`. You will need these to configure the app in step 11 below.
8. In the left sidebar, click on **OAuth & Permissions**:\
   a. Click **Add Redirect URL** and enter the following URL:

   ```text theme={null}
   https://ai-api.automationanywhere.com/slack/oauth
   ```

   b. Click **Add** and then **Save URLs**. c. Under **Scopes**, add the following **Bot Token Scopes**:

   * `app_mentions:read` – to allow the bot to read messages where it is mentioned in conversations the app is in.
   * `channels:history` – to allow the bot to view messages and other content in public channels that the app is a member of.
   * `channels:manage` – to allow the bot to manage channels, including creating, archiving, and renaming channels.
   * `channels:read` – to allow the bot to view basic information about public channels in a workspace.
   * `chat:write` – to allow the bot to send messages as the app.
   * `commands` – to allow the bot to add slash commands that users can invoke.
   * `groups:read` – to allow the bot to view basic information about private channels that the app is a member of.
   * `im:history` – to allow the bot to view messages and other content in direct messages that the app is a member of.
   * `im:write` – to allow the bot to send direct messages as the app.
   * `users.profile:read` – to allow the bot to view user profiles.
   * `users:read` – to allow the bot to view people in a workspace.
   * `users:read.email` – to allow the bot to view users emails.
9. Click **App Home** in the left sidebar. Under **Show Tabs**, ensure **Messages Tab** is enabled, as well as the checkbox below it.
10. In the left side bar, click **Slash Commands**:\
    a. Click **Create New Command**. b. In the **Command** field, enter `/setup`.\
    c. In the **Request URL** field, enter:

    ```
    https://ai-api.automationanywhere.com/slack/events
    ```

    d. In the **Short Description** field, enter something like "Channel Setup".\
    e. Optionally, you can add a longer description in the **Usage Hint** field.\
    f. Click **Save**.
11. Complete the following API endpoint URL, with the values gathered in step 7:

    ```
    https://ai-api.automationanywhere.com/slack/custom_install/{client_id}/{client_secret}/{signing_secret}/{verification_token}
    ```

    Replace `{client_id}`, `{client_secret}`, `{signing_secret}`, and `{verification_token}` with the values from your Slack app found in the **Basic Information** section.
12. Open the completed URL in a new browser. This will redirect you to a page with an **Add to Slack** button. Click this button to install the app in your workspace.
13. You will be redirected to a page requesting permission to access your workspace. Click **Allow** to grant the necessary permissions.
14. You should see a confirmation message indicating that the installation was successful, and you'll be redirected to your Slack workspace.
15. Navigate to **Event Permissions** from the sidebar and do the following:\
    a. Toggle **Enable Events**.\
    b. In the **Request URL** field, enter:
    ```
    https://ai-api.automationanywhere.com/slack/events
    ```
    d. Next, go to **Subscribe to Bot Events** underneath.\
    e. Click **Add Bot User Event** and add these two events: `app_mention` and `message.im`.\
    f. Click **Save Changes**.
16. Navigate to **Interactivity & Shortcuts** from the sidebar and do the following:\
    a. Toggle **Interactivity**.\
    b. In the **Request URL** field, enter:
    ```
    https://ai-api.automationanywhere.com/slack/events
    ```
    c. Click **Save Changes**.
17. Go to your Slack workspace, and you should see the EKB app in the list of apps on the left sidebar.

<Check>
  App is successfully installed in your Slack workspace! The next step is to run the setup command to configure a channel for EKB.
</Check>

## Set Up a Channel for EKB App

To set up a channel for EKB, you need to run the `/setup` command in the desired channel. This command will configure the channel to work with EKB.

1. Open your Slack workspace and navigate to the channel where you want to set up EKB.
2. In the message input box, type `/setup` and press **Enter**.
3. A pop-up will appear, prompting you to enter the following information:
   * **Channel** – Select the channel you want to set up for EKB.\\
     <Note>
       If you want to use the app in direct messages, select your own user name.
     </Note>
   * **Project ID**: Enter your EKB Project ID.
   * **API Key**: Enter your EKB API Key.
   * **API Secret**: Enter your EKB API Secret.
4. Click **Submit** to complete the setup process. The app will validate the information and configure the channel.
5. If the setup is successful, you will see a confirmation message in the channel indicating that EKB has been set up successfully.<br />
   <Check>
     EKB is now set up in your selected channel! You can start interacting with the bot by mentioning it in messages or using the slash commands.
   </Check>
