---
title: Notification channels and policies
description: Admins with permission can create, edit, and delete notification channels, view logs, and create, edit, enable, disable, or delete notification policies.

---

# Notification channels and policies {: #notification-channels-and-policies }

Although notifications are visible to all users, their configuration is limited to system and organization admins with permission to manage policies.

* System-level admins are exclusive to Self-Managed AI Platform users.

* Organization admins are exclusive to managed AI Platform users.

This page describes how to configure various webhook, email, and Slack elements.

For notification channels, you can:

* Create a notification channel.
* Edit a notification channel.
* View notification logs.
* Delete a notification channel.

For notification policies, you can:

* Create a notification policy.
* Edit a notification policy.
* Enable or disable a notification policy.
* Delete a notification policy.

Before proceeding, review the [considerations](webhooks/index#considerations).

##  Create a channel {: #create-a-channel }

Notification channels are mechanisms for delivering notifications created by admins. DataRobot supports email, webhook, and Slack notifications. You may want to set up several channels for each type of notification; for example, a webhook with a URL for deployment-related events, and a webhook for all project-related events.

To create a notification channel:

Click on your user icon and navigate to the **Notification Channels** dashboard. This page is also accessible from the app administrator page.

![](images/webhooks-1.png)

Select **Add channel**. Before proceeding, select the channel type: [webhook](#add-a-webhook-channel), [email](#add-an-email-channel), or [Slack](#add-a-slack-channel). Then, fill out the corresponding fields.

###  Add a webhook channel {: #add-a-webhook-channel }

A dialog box prompts you to provide information about the new webhook channel.

![](images/webhooks-2.png)

| Field | Description |
|-------|-------------|
| Channel name | The name of the notification channel being added.      |
| Payload URL | The URL of the server that will receive the webhook POST requests. For example: http://localhost:3527/payload     |
| Content type | Method for serializing the payload. Webhooks can be sent as different content types: **json** delivers the JSON payload directly as the body of the POST request **form** sends the JSON payload as a form parameter called payload.   |
| [Secret token](#secret-token) |  A hashed secret token used to secure the connection of the webhook. It ensures that POST requests sent to the payload URL are from DataRobot.                                                                                           |
| Enable SSL verification |  Toggle on for DataRobot to validate SSL certificates against a certificate authority. Toggle off to allow unvalidated (or “self-signed”) certificates.                                                                                     |


Note that these settings can be configured at a later time after the channel is saved.

Select **Show advanced options** to add a custom header. Custom headers allow you to describe the event type that triggered the webhook delivery, provide a way to identify the delivery, and more. Select **Add header** and provide a name and value for the header you want to add.

![](images/webhooks-3.png)

For example, you can use a custom header to detail a specific dataset with loan information being shared. The header would be formatted as:

`loan-dataset-shared: 1`

When your fields are completed, click the **Test connection** link. DataRobot tests the webhook connection and allows you to view the results before saving the completed fields. For the connection test, the body of the POST serves as the event template merged with placeholder values; you are unable to modify this content. The webhook will not be saved until it is successfully called in the test.

When you have completed the required fields and passed the connection test, click **Add channel**. Your channel is available for use in the **Notification Channels** dashboard.

#### Secret tokens {: #secret-tokens }

Secret tokens help verify that notification requests are authentic and coming from DataRobot. To use secret tokens for your notification channel:

1. Create a secret key that will be known only to DataRobot and the client-side (where you need to make sure notifications are coming from DataRobot).
2. Add the created token to your notification channel configuration in DataRobot.
3. Implement additional logic on the client-side to implement HMAC digest creation using the SHA-1 hash function and the digest function ([`hexdigest()`](https://docs.python.org/3/library/hmac.html#hmac.HMAC.hexdigest){ target=_blank } if you use python) that returns hexadecimal digits as a result.
4. When a notification comes in, the new algorithm takes the secret token and the content of the received message, and passes them to the HMAC digest method. 
5. Compare the result of the digest method with the `DR-Signature` header that comes with the notification. It should be done with the recommended function of HMAC ([`compare_digest()`](https://docs.python.org/3/library/hmac.html#hmac.compare_digest){ target=_blank } if you use Python) instead of standard boolean operators to reduce the vulnerability to timing attacks. If they match, that means the notification was sent by DataRobot.

!!! example
    If you use Python, you can use the `hmac` module and the following code example: 

    ```python
    import hmac
    import hashlib

    hexdigest = hmac.new(string_to_bytes(secret_token), string_to_bytes(msg), hashlib.sha1).hexdigest()
    result = hmac.compare_digest(hexdigest, dr_signature):
    ```

    You must convert `secret_token` and `msg` to bytes before using `hmac.new`.

###  Add an email channel {: #add-an-email-channel }

Select the **Email** tab and a dialog box prompts you to provide information about the new email channel.

![](images/webhooks-14.png)

| Field | Description |
|-------|-------------|
| Channel name  | The name of the notification channel being added.      |
| Email address |  The email address that receives notifications. Only one email address can be entered into this field. If you need to send notifications to multiple emails, you must set up separate notification channels for each address. |


You must verify the recipient email address. Click **Send verification code to email**.

![](images/webhooks-16.png)

After receiving the email with the verification code, enter it in the corresponding field and click **Verify**.

![](images/webhooks-15.png)

When you have completed the required fields and verified the email address, click **Add channel**. Your channel is available for use in the **Notification Channels** dashboard.

###  Add a Slack channel {: #add-a-slack-channel }

Select the **Slack** tab. A dialog box prompts you to provide information about the new Slack notification channel.

![](images/slack-1.png)

| Field | Description |
|-------|-------------|
| Channel name                | The name of the notification channel being added.     |
| Slack Incoming Webhook URL  |  A URL generated by Slack, found on Slack's workspace settings page, that DataRobot uses to send notifications to a specific workspace. On Slack's workplace settings, indicate a Slack app and a Slack channel where DataRobot will send notifications. Reference the <a target="_blank" href="https://api.slack.com/messaging/webhooks">Slack documentation</a> for more information. |


When your fields are completed, click the **Test connection** link. DataRobot tests the Slack workspace connection and allows you to view the results before saving the completed fields. If configured successfully, DataRobot delivers a Slack notification (`connection test`) to the channel you configured on the Slack workplace settings page.. The channel does not save until the connection test successfully passes. If the test fails, verify that the Webhook URL is correct and verify the Slack workspace settings.

When the connection test notification is successful, click **Add channel**. Your channel is available for use in the **Notification Channels** dashboard.

###  Edit a channel {: #edit-a-channel }

You can edit the fields for an existing channel by selecting it and navigating to the **Configuration** tab. Make the desired changes and either retest your connection (for webhook notifications) or verify the new email address (for email notifications). When your test passes, click **Save Changes**.

![](images/webhooks-4.png)

###  View notification logs {: #view-notification-logs }

Notification logs allow you to view the status of any system using a specific webhook, the number of times the system transmitted an event, and whether the transmission was successful. Notification logs are essential for debugging webhooks. Note that notification logs are not available for email notification channels. The notification logs list the 25 most recent [trigger](#choose-a-trigger) events with their send date and time. Logs also include a copy of the HTTP request, the response code, and time to delivery.

You can view notification logs for a channel by selecting it and navigating to the **Logs** tab. This tab lists every policy using the channel (1), the last 25 notification deliveries (2), and the header and payload for requests (3) and responses (4). If you have a failed delivery, you can choose to redeliver that notification (5).

![](images/webhooks-10.png)

###  Delete a channel {: #delete-a-channel }

If you no longer wish to use a notification channel, you can remove it from the dashboard. Locate the channel you want to remove and select the trash can icon ![](images/icon-delete.png) to delete it.

##  Create a notification policy {: #create-a-notification-policy }

A notification policy is a group of one or more alert conditions. A policy has two settings that apply to all of its conditions—incident preference and notification channels. Order of activity is as follows:

1. Create a notification channel.
2. Create a notification policy.
3. Add policy conditions.

Policies can be organized by:

* **Architecture**: Organizational-based policy structure. For example, Production website, Staging website, Production databases.

* **Teams**: Team-based policy structure. For example, Team: Data Scientists, Team: IT Ops, Team: Model Validators.

* **Individuals**: Notification policies set up for specific individuals. This configuration is useful for when users want to personally track a particular resource or metric.

To create a notification policy:

Click on your user icon and navigate to the **Notification Channels** dashboard. This page is also accessible from the app administrator page.

![](images/webhooks-5.png)

Select **Add policy**. A dialog box prompts you to provide information to configure the new policy.

#### Choose a trigger {: #choose-a-trigger }

Choose a single event or a group of events that will trigger a notification.

* The **Event group** tab displays groups of events organized by type. Select a group if you want the notification policy to be triggered by any of the events that belong to it. For example, the event group "Dataset-related events" consists of dataset creation, dataset sharing, and dataset deletion events.

![](images/webhooks-6.png)

* The **Single event** tab displays every individual event available as a trigger for the notification policy. You can only select one.

![](images/webhooks-7.png)

Once you have selected the event group or single event you wish to use to configure the notification policy, click **Next**.

#### Choose a channel {: #choose-a-channel }

Select the [notification channel](#add-a-webhook-channel) for the policy to use from the dropdown. All notification channels that have been created or shared with you are available for selection (1). You can use the search bar (2) to find specific channels.

![](images/webhooks-8.png)

When you have selected the channel you want to use, click **Next**.

#### Name and review a policy {: #name-and-review-a-policy }

Review the selected trigger and channel for the policy you are creating. If you want to go back and edit either of the selections, click the edit icon (![](images/icon-rename.png)) next to each selection. Then provide a name for your new policy.

![](images/webhooks-9.png)

When you are satisfied with your policy configuration, click **Create policy**. Your policy is available for use in the **Notification Channels** dashboard.

### Edit a policy {: #edit-a-policy }

You can edit an existing policy to re-configure the trigger and channel it uses, or to rename it. Locate the policy in the **Notification Policies** dashboard, and select the edit icon (![](images/icon-rename.png)). You can make any desired edits from the dialog box that appears.

### Enable or disable a policy {: #enable-or-disable-a-policy }

Policies can be enabled or disabled at any time, allowing you to prevent notification fatigue, or bring attention to additional events. Locate the policy in the **Notification Policies** dashboard. Select the play icon to enable a policy and the pause icon to disable it.

### Delete a policy {: #delete-a-policy }

If you no longer wish to use a policy, you can remove it from the dashboard. Locate the policy you want to remove and select the trash can icon ![](images/icon-delete.png) to delete it.
