Skip to main content
This example shows you how to integrate Slack incoming 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 in your workspace and start sending messages using Incoming Webhooks. At the end of this guide, make sure your Slack app has the following features activated:
  • Incoming Webhooks
  • Interactive Components
  • Bots
  • Permissions
Once your Slack app has its shiny Incoming Webhook URL, you will be able to send your message 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

Set up the webhook from your admin backend

Install the node.js Slack SDK

From your project’s directory, simply run
$ npm install --save @slack/webhook

Add the Incoming Webhook URL to your .env

SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR_WORKSPACE_ID/YOUR_CHANNEL_ID/YOUR_SECRET_TOKEN
This Incoming Webhook URL contains a secret key, please make sure it does not appear in your code.

Create the Smart Action and initialize the Incoming Webhook

Smart Action declaration

Smart Action logic

To learn more about composing messages using the Slack API, please visit the
To learn more about error handling of Slack Interactive Webhooks, please visit the Slack changelog.