> ## Documentation Index
> Fetch the complete documentation index at: https://forest-docs-prd-616-workflow-webhook-trigger.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Smart Action notifications to Slack

This example shows you how to integrate [Slack incoming webhooks](https://api.slack.com/messaging/webhooks) to receive notifications in your workspace when a Smart Action e.g `"Reject application"` is triggered.

Demo

## Create your Forest slack app

Follow Slack's guide to [create a new app](https://api.slack.com/messaging/webhooks) in your workspace and start sending messages using Incoming Webhooks.

<img src="https://mintcdn.com/forest-docs-prd-616-workflow-webhook-trigger/7CReagZK6gkpGoy9/images/legacy/javascript-agents/image%20(527).png?fit=max&auto=format&n=7CReagZK6gkpGoy9&q=85&s=3050a7b8ba529c89a7b6d0884ad0a1e7" alt="" width="2880" height="1534" data-path="images/legacy/javascript-agents/image (527).png" />

At the end of this guide, make sure your Slack app has the following features activated:&#x20;

* Incoming Webhooks
* Interactive Components
* Bots
* Permissions

<img src="https://mintcdn.com/forest-docs-prd-616-workflow-webhook-trigger/7CReagZK6gkpGoy9/images/legacy/javascript-agents/image%20(506).png?fit=max&auto=format&n=7CReagZK6gkpGoy9&q=85&s=f1a29ba53fa90633f8367a05a26705a0" alt="" width="2880" height="1532" data-path="images/legacy/javascript-agents/image (506).png" />

Once your Slack app has its shiny Incoming Webhook URL, you will be able to send your [message](https://api.slack.com/messages) in JSON as the body of an `application/json` POST request.

```
https://hooks.slack.com/services/YOUR_WORKSPACE_ID/YOUR_CHANNEL_ID/YOUR_SECRET_TOKEN
```

## Connect your app from a Slack channel of your choice

<img src="https://mintcdn.com/forest-docs-prd-616-workflow-webhook-trigger/7CReagZK6gkpGoy9/images/legacy/javascript-agents/image%20(485).png?fit=max&auto=format&n=7CReagZK6gkpGoy9&q=85&s=77f297722e3a0a0a8cc26942b7d5c508" alt="" width="2880" height="1534" data-path="images/legacy/javascript-agents/image (485).png" />

## Set up the webhook from your admin backend

### Install the [node.js Slack SDK](https://slack.dev/node-slack-sdk)

From your project's directory, simply run&#x20;

```bash theme={null}
$ npm install --save @slack/webhook
```

### Add the Incoming Webhook URL to your .env

```bash theme={null}
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR_WORKSPACE_ID/YOUR_CHANNEL_ID/YOUR_SECRET_TOKEN
```

<Warning>
  This Incoming Webhook URL contains a secret key, please make sure it does not appear in your code.
</Warning>

### Create the Smart Action and initialize the Incoming Webhook

#### Smart Action declaration

#### Smart Action logic

<Info>
  To learn more about composing messages using the Slack API, please visit the

  * Slack Interactive messages [guide](https://api.slack.com/messaging/interactivity)
  * Slack Block Kit [visual builder](https://api.slack.com/tools/block-kit-builder)
</Info>

<Warning>
  To learn more about error handling of Slack Interactive Webhooks, please visit the Slack [changelog](https://api.slack.com/changelog/2016-05-17-changes-to-errors-for-incoming-webhooks).
</Warning>
