How to set up Slack webhooks using event subscriptions
November 14, 2024
This guide explains how to configure your Slack app's event subscriptions to work with Unified.to webhooks. This is a required step before you can create webhooks that listen for Slack events. Once configured, your webhooks will receive real-time notifications when specific events occur in your Slack workspace, such as when users send messages.
Before you begin
Ensure you have:
- A Slack app created in your workspace
- Access to your Slack app's configuration settings
- Your Unified.to workspace ID
- An understanding of how webhooks work in Unified.to
Enable event subscriptions in Slack
- Go to the Slack API dashboard at https://api.slack.com/apps
- Select your app from the list of available apps
- In the left sidebar, under Features, click Event Subscriptions
- Toggle the Enable Events switch to On
- In the Request URL field, enter (depending on your data center):
- (US data center)
https://api.unified.to/webhook/workspace/slack
- (EU data center)
https://api-eu.unified.to/webhook/workspace/slack
- (US data center)
- Wait for Slack to verify the URL. You should see a green checkmark indicating successful verification.
- Click Save Changes at the bottom of the page
Subscribe to events from Slack
After you've enabled events and verified the request URL works, you need to subscribe to the events that you are interested in.
- The minimum event you should subscribe to is
message.groups
(under user) - The other events you can subscribe to are the ones that fall under the following scopes under Subscribe to events on behalf of users:
channels:history
groups:history
im:history
mpim:history
Example of Slack events that you can subscribe to for webhook events
- Click Save Changes at the bottom of the page
Once completed, you can create webhooks in Unified.to that will receive these Slack events in real-time.
Happy building!