# Slack

> Create a Slack app for Corfedo, add it to your Slack workspace and choose the channels where it answers.

Source: https://docs.corfedo.ai/workspace/integrations/slack/

People ask Corfedo AI in Slack with a direct message or a mention. Each person links their Slack account once, and answers use their own Corfedo access.

## Before you begin

- You are a workspace administrator or have the **Integration administrator** role.
- An AI [profile](https://docs.corfedo.ai/workspace/ai/profiles/) for answers in Slack.
- Permission to create apps in your Slack workspace.

## Create the Slack app

Open **Settings** › **Integrations** and choose **Slack**, under **Add integration** once the page lists integrations. If **Add to a Slack workspace** opens, the app exists and you can skip to [Add it to your Slack workspace](#add-it-to-your-slack-workspace).

### Choose how Slack reaches Corfedo

Choose **Socket Mode** when your installation cannot be reached from the internet. **Request URL** needs a public address. Name the app as people should see it in Slack and select **Continue**.

![Set up Slack](https://docs.corfedo.ai/images/integrations/slack/setup.png)

### Create the app in Slack

Select **Open Slack apps** and create a new app. Choose **Paste a manifest**, pick your Slack workspace and paste the manifest Corfedo shows.

![Create new app in Slack](https://docs.corfedo.ai/images/integrations/slack/slack-new-app.png)

### Enter the app's credentials

From the app's **Basic Information** page in Slack, enter the **App ID**, **Client ID** and **Client Secret** in Corfedo. For a request URL, also enter the **Signing Secret**. For Socket Mode, select **Generate Token and Scopes** with the `connections:write` scope and enter the token as the **App-level token**. Select **Save credentials**.

![Generate an app-level token](https://docs.corfedo.ai/images/integrations/slack/slack-token.png)

For a request URL, select **Retry** next to it on the app's **Event Subscriptions** page in Slack.

**Check:** the **Slack** row under the credentials says **Connected**.

## Add it to your Slack workspace

### Choose the profile and repositories

Select **Add to a Slack workspace** and choose the **Profile**. Only people who may use it get answers. **All repositories** includes repositories added later.

![Add to a Slack workspace](https://docs.corfedo.ai/images/integrations/slack/add.png)

### Allow the app in Slack

Select **Continue in Slack**, choose your Slack workspace and select **Allow**.

![Allow the app in Slack](https://docs.corfedo.ai/images/integrations/slack/slack-allow.png)

**Check:** the integration's page opens with **Added to** and your Slack workspace's name.

## Choose where Corfedo answers

Corfedo always answers direct messages. For mentions in channels, select **Change** next to **Answers in** on the integration's page and choose **Only the channels you choose** or **Every channel the app is in**. Add the app to those channels in Slack. Everyone in a channel sees the answer, written with the access of the person who asked. In a shared channel that includes people from other organizations. **Every channel the app is in** includes shared channels.

![Answers in](https://docs.corfedo.ai/images/integrations/slack/channels.png)

## See what happened to a question

**Activity** on the integration's page lists the questions of the last 30 days. **Details** says why a question was not answered.

![Activity](https://docs.corfedo.ai/images/integrations/slack/activity.png)

## Troubleshooting

| What you see | Why | What to do |
| --- | --- | --- |
| "Slack hasn't accepted the connection yet." | The app-level token is wrong or lacks `connections:write` | Enter a new token with that scope and select **Check again** |
| "Not verified yet." next to **Slack** | Slack cannot reach the request URL | Make the address reachable from the internet and select **Retry** in Slack, or set up an app with **Socket Mode** |
| **Slack permissions are out of date.** | Corfedo needs new permissions | Select **Reconnect**. If Slack refuses, paste the **Manifest** from **App settings** into the app's settings in Slack first. |
| **Slack no longer accepts this connection.** | Slack rejected the app's token | Select **Reconnect** |
| **Permissions missing** | Slack did not grant every permission the app needs | A Slack workspace admin may need to approve the app. Then add it again. |
| **Slack workspace already connected** | Another Corfedo workspace uses this app there | Remove it there, or set up another Slack app |
| **No profile chosen** or **Profile not available** | The integration has no usable profile, or the person may not use it | Change the **Profile**, or who it is **Available to** |

Members see [Ask in Slack](https://docs.corfedo.ai/use/ask/slack/).
