> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up notifications

A scheduled check is an automated instance of a running drift or model quality computation over a range of data. You can view the results on the monitoring dashboard, and automated email notifications are sent if thresholds are breached.

This topic describes how to configure notifications.

## Prerequisites

Set up the SMTP server:

1. In the navigation pane, click **Model Monitor**.

2. Click **Settings** and then click **Notification Channels**.

3. Click **Edit**.

4. Type the SMTP details in the fields provided.

5. To use SMTPS instead of SMTP+STARTTLS, switch the **Enable TLS** toggle to the off position.

6. Click **Save Mail Config**.

## Configure global notification settings for monitored models

These notification settings are used for all monitored models that do not override them.

1. In the navigation pane, click **Model Monitor**.

2. Click the name of the model for which you want to set up notifications.

3. Click **Notifications**.

4. If you do not want to **Use email address from global settings**, switch the toggle to the off position. See [Notification Channels](/cloud/platform-capabilities/features/monitoring/7-monitor-settings/3-notification).

5. Click **Edit**.

6. In the **To Addresses** field, type or paste a comma- or semicolon-separated list of email addresses.

7. Click **Save Mail Config**.

## Override the global notification settings for a monitored model

To use different notification settings for specific models, you can override the global notification settings:

1. In the navigation pane, click **Model Monitor**.

2. Click **Settings** and then click **Notification Channels**.

3. Click **Edit**.

4. Type the SMTP details in the fields provided.

5. Type or paste a comma- or semicolon-separated list of email addresses.

6. To use SMTPS instead of SMTP+STARTTLS, switch the **Enable TLS** toggle to the off position.

7. Click **Save Mail Config**.

<Warning>
  The global list was set up by your administrator during installation. This procedure overrides the global default notifications for all Model Monitors.
</Warning>

## Send notifications with the API

In your project code, you can use the Domino API to send alerts or notifications. The `/api/metricAlerts/v1` REST API endpoint sends email when any of your monitoring metrics falls outside the thresholds you have defined in your code. Deploy the code in a [job](/cloud/platform-capabilities/core-concepts/jobs) (for one-time execution) or as a [scheduled job](/cloud/platform-capabilities/core-concepts/jobs/schedule-a-job) (for continuous evaluation) to compute your model’s metrics and send alerts.

Alerts are sent to the recipients configured in the global notification settings for monitored models, except for models that override those notification settings as described above.

<Note>
  When notifications are sent using the API, Domino uses the SMTP server for global notifications, *not* the server configured for model monitoring notifications.
</Note>

The code examples below show how to construct the [payload](/cloud/reference/api/domino-open-api#_sch_MetricAlertRequestV1) and send it to the `/api/metricAlerts/v1` endpoint.

<Note>
  You need your [API key](/cloud/reference/api/get-api-key) to access this endpoint.
</Note>

```python theme={null}
import requests
import json

url = "https://<DOMINO_HOST>/api/metricAlerts/v1"
api_key = "<DOMINO_API_KEY>"

payload = json.dumps({
  "modelMonitoringId": "62471956481e88a77ae91210",
  "metric": "testMetric",
  "value": 1.0,
  "targetRange": {
    "lowerLimit": 2.0,
    "upperLimit": 3.0,
    "condition": "between"
  }
})

headers = {
  'X-Domino-Api-Key': api_key,
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
response.ok
```

```curl theme={null}
curl --location --request POST 'https://<DOMINO_HOST>/api/metricAlerts/v1'
--header 'X-Domino-Api-Key: <DOMINO_API_KEY>'
--header 'Content-Type: application/json'
--data-raw '{
    "modelMonitoringId": "62471956481e88a77ae91210",
    "metric": "testMetric",
    "value": 1.0,
    "targetRange": {
        "lowerLimit": 2.0,
        "upperLimit": 3.0,
        "condition": "between"
    }
}'
```

The values for `condition` are:

* `lessThan`

* `lessThanEqual`

* `greaterThan`

* `greaterThanEqual`

* `between`

You can also add an optional `description` string to include in the notifications.

<Tip>
  Make sure that `modelMonitoringId` refers to the *monitoring* model ID and not the ID of the Domino endpoint. To find the monitoring model ID, select your model in the Model Monitor and scroll down on the model’s Overview page.
</Tip>
