WebHooks are automated messages sent from apps when something happens. They have a message—or payload— and are sent to a unique URL; named WebHook URL. This article will serve to assist with sending WebHook notifications to a Slack channel.
Before setting up notifications to Slack, please read over our Alerts article to learn basic concepts and useful tips.
In order to set up WebHook notifications to Slack, you will need:
- A Slack workspace and channel (within the workspace) that you want messages to arrive in.
- Admin or super-admin user role within Hudu.
At any time, you can come back to the Hudu admin area → Alerts → edit specific alert to make changes to the alert.
Enabling alerts
- Navigate to your Hudu admin area → Alerts.
- Click + New Alert.
- Give your alert a name.
-
Select the alert type from the choices and complete the required fields (see Alerts for more information).
- Record created/updated/deleted alerts are sent by webhook only. To get alerts when processes change, select Processes only or All types of records as the record type. Process runs don't trigger this alert.
- Under Configure Webhook, enter the WebHook URL from Slack (see Obtaining the Slack WebHook URL below).
- Enter your payload in the Webhook payload field. The payload must be valid JSON.
- Click Create Alert to save.
Obtaining the Slack WebHook URL
- Navigate to your Slack Workspace, and into the channel that you'd like messages to be sent to.
- Click on your Slack Workspace Name → Settings & Administration → Manage Apps.
- In the window that opens, click Build in the top right of the toolbar (next to your workspace name).
- Alternatively, navigate to https://api.slack.com/apps/
- Click Create an App → from scratch.
- Name the app and choose a workspace (choose the workspace that you'd like to receive the notifications in).
- Click Create App.
- Select Incoming WebHooks and activate incoming WebHooks on the next window.
- Click Add New WebHook to Workspace and select which channel you'd like to send notifications to.
- Copy the newly generated WebHook URL into Hudu WebHook alert settings exactly.
WebHook payloads
In order to have a message generated in your Slack, you will need to deliver a payload. A payload is a piece of essential information in a data block that you send to or receive from the server when making API requests. The payload must be sent or received in JSON format.
Hudu Radar alert webhooks send a preconfigured JSON payload that can't be customized. Because Slack expects its own message format, Radar alert webhooks may not post to a Slack channel without additional configuration to handle the payload.
Supported variables
The variables available for each alert type are also listed on the alert form below the payload field. Visit Understanding WebHooks for more information.
Single expiration
- $HUDU_URL = Link to the relevant expiration in Hudu
- $RECORD_NAME = Name of expiring record
- $RECORD_ID = Record ID
- $RECORD_TYPE = Type of record
- $COMPANY_NAME = Name of expiring record's company
- $COMPANY_ID = Company ID
- $HUDU_COMPANY_URL = Link to the company in Hudu (if present)
- $TRIGGER_DAYS = Number of days set as trigger time
- $EXPIRATION_TYPE = Type of expiration (e.g., domain, ssl_certificate, warranty)
- $EXPIRATION_DATE = The expiration date
- $USER = Who triggered the alert (the scheduled job for automated alerts)
Expiration list
- $HUDU_URL = Link to the relevant expirations in Hudu
- $EXPIRATIONS_COUNT = Number of expirations
- $TRIGGER_DAYS = Number of days set as trigger time
- $USER = Who triggered the alert (the scheduled job for automated alerts)
Website down
- $HUDU_URL = Link to the website in Hudu
- $RECORD_NAME = Name of website
- $RECORD_ID = Record ID
- $RECORD_TYPE = Type of record
- $COMPANY_NAME = Name of the website's company
- $COMPANY_ID = Company ID
- $HUDU_COMPANY_URL = Link to the company in Hudu (if present)
- $USER = Who triggered the alert (the scheduled job for automated alerts)
One-time shared password reveal
- $HUDU_URL = Link to the password in Hudu
- $RECORD_NAME = Name of password
- $RECORD_ID = Record ID
- $RECORD_TYPE = Type of record
- $COMPANY_NAME = Name of the password's company
- $COMPANY_ID = Password record's company ID
- $HUDU_COMPANY_URL = Link to the company in Hudu (if present)
- $USER = Who revealed the password (a guest with their IP address)
Record created/updated/deleted (webhook only)
- $HUDU_URL = Link to the record in Hudu
- $RECORD_NAME = Name of record
- $RECORD_ID = Record ID
- $RECORD_TYPE = Type of record, including processes
- $ACTION = Action that occurred (create, update, or delete)
- $COMPANY_NAME = Name of the record's company (if present)
- $COMPANY_ID = Company ID (if present)
- $HUDU_COMPANY_URL = Link to the company in Hudu (if present)
- $ASSET_LAYOUT_ID = Asset layout ID (if present)
- $USER = Who made the change (a user, or the integration or automation that made it, matching the user shown in activity logs)
Here are some examples of WebHook payloads:
Expirations
{
"type": "home",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "There are *$EXPIRATIONS_COUNT* expirations expiring within *$TRIGGER_DAYS* days. View: $HUDU_URL"
}
}
]
}Websites
{
"type": "home",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*$RECORD_NAME* appears to be down. View: $HUDU_URL"
}
}
]
}Record created/updated/deleted
{
"type": "home",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "The *$RECORD_TYPE* record *$RECORD_NAME* was *$ACTIONd* by $USER. View: $HUDU_URL"
}
}
]
}
Testing WebHooks
- Navigate to your Hudu admin area → Alerts and find your created alert from the list.
- Click on Test WebHook.
We are only testing your connection and payload, not your variables; sample variables will be filled in.
Alternative guides
The guides below will serve to assist with setting up WebHook notifications to alternative common providers.