# Slack

{% hint style="warning" %}
Slack Notification Channel is getting an upgrade: meet [Slack Connected App](https://docs.groundcover.com/integrations/connected-apps/slack-webhook)
{% endhint %}

## Method #1 - Slack WebHook

### Setting Up a Slack Webhook

To send notifications to Slack, follow these steps to generate a webhook URL for your workspace:

1. **Go to Slack Webhook Page**: Visit <https://my.slack.com/services/new/incoming-webhook> to create a new incoming webhook, Make sure you select the correct workspace in the top right corner.
2. **Select a Channel**: Once you're on the page, select the Slack channel where you want the notifications to be sent. You can also create a new channel by clicking the “create a new channel”.
3. **Create the Webhook**: Click **Add Incoming Webhook Integration**. A webhook URL will be generated.
4. **Copy the Webhook URL**: After the webhook is created, copy the webhook URL. This URL will be used to configure your **groundcover** workflow.

### Configuring Slack Webhook in groundcover

Once you have the Slack webhook URL, you can configure it in your workflow to send notifications.

Go to settings page, and then go to the integrations page.

Click on the “Slack Webhook” card:

<figure><img src="https://2771001740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUHgqKYgCiRKdOpWQdi52%2Fuploads%2Fgit-blob-b666b5f22b6c70a973ba56d44d36b7f5abe4d423%2Fimage.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

In the window, fill in the name and the URL you’ve created, the name will be used later when setting up workflows:

<figure><img src="https://2771001740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUHgqKYgCiRKdOpWQdi52%2Fuploads%2Fgit-blob-593a0b25dc64769ce597d09bf3437c82eecca738%2FSlack%20webhook.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### Workflow Example

You can see detailed workflow examples to use with your integration, [here](https://docs.groundcover.com/use-groundcover/workflows/integration-examples#slack-notification).

## Method #2 - Slack App with Bot Tokens

{% hint style="info" %}
Adding a Slack App depends on your workspace’s approval settings. In some workspaces, any member can install apps, while in others only admins or owners can approve them. If approval is required, you’ll see a “**Request to install**” button and the request must be approved before the app is added.
{% endhint %}

### Adding the Slack App Integration

#### Create a Slack App

1. Go to [Slack API – Your Apps](https://api.slack.com/apps).
2. Click **Create New App** → choose **From Scratch**.
3. Give the app a name (e.g., g*roundcover Alerts*) and select your workspace.

#### Configure Permissions

1. In the left menu, go to **OAuth & Permissions**.
2. Under Scopes (Bot Token Scopes), add at least:
   1. *chat:write* - allows the app to post messages.
   2. (Optional) *chat:write.public* – required if the app should post to public channels it isn’t a member of.
3. Save your changes.

#### Install the App

1. In the same menu, scroll up and click **Install App to Workspace**.
2. Approve the requested permissions.
3. After installation, you’ll see an **OAuth Tokens for Your Workspace** section. Copy the **Bot User OAuth Token** (it begins with xoxb-). This is the token you’ll use in groundcover to send notifications.

#### Invite the App to Channels

For the app to post in a channel, it must be a member:

* In Slack, open the channel and run:

```
/invite @[your-app-name]
```

**Next step:** Once the app is installed, configure groundcover to use the bot token and channel IDs to send alerts dynamically via Slack’s chat.postMessage API. Create a webhook with the following attributes:

* Integration Name: slack-routing-endpoint (it can be any name)
* Webhook URL: <https://slack.com/api/chat.postMessage>
* Headers: Key: Authorization, Value: Bearer xoxb-\[your-bot-token-from-app]

You are now ready to use your Slack App integration with [a workflow](https://docs.groundcover.com/~/revisions/ETrLpNk6KtHjyaVUTLoE/use-groundcover/workflows/full-webhook-examples/slack-app-for-channel-routing)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groundcover.com/integrations/workflow-integrations/slack-webhook-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
