---
title: Create monitor dependencies
description: >-
  Create alerting trees by using webhook notifications with downtime API calls
  to mute dependent alerts automatically.
breadcrumbs: Docs > Monitors > Monitor Guides > Create monitor dependencies
---

# Create monitor dependencies

While Datadog does fully support [composite monitors](https://docs.datadoghq.com/monitors/types/composite/), there is not an official way to create alerting trees.

Some Datadog users have combined webhook notifications with downtime scoping via the Datadog API to achieve a similar result.

At a high level, the setup for this is as follows:

- Alert A triggers and has an `@webhook-notification`.
- Notification reaches out to the [Datadog downtime API](https://docs.datadoghq.com/api/v1/downtimes/) by `$scope` to mute any other alerts.
- When Alert A resolves, use a different @webhook-notification to remove the downtimes from the same $scope. It should be noted that this can impact previously scheduled downtimes if you have an active downtime overlapping with the defined [$scope](https://docs.datadoghq.com/api/v1/downtimes/#cancel-downtimes-by-scope).

First, [create the webhooks](https://app.datadoghq.com/account/settings#integrations/webhooks):

{% image
   source="https://datadog-docs.imgix.net/images/monitors/guide/mute_demo_webhook.84a700e22d9afa6d719232db8ec20965.png?auto=format"
   alt="mute_demo_webhook" /%}



Full text for API endpoints (2nd input box for each in the left column):

Mute: `https://api.datadoghq.com/api/v1/downtime?api_key=XXX&application_key=XXX`

Unmute: `https://api.datadoghq.com/api/v1/downtime/cancel/by_scope?api_key=XXX&application_key=XXX`

And the webhook content for both:

```json
{"scope": "$ALERT_SCOPE"}
```

Then, create "Alert A" - for example- a no-data alert for a grouped percentage of hosts for each Availability zone.

{% image
   source="https://datadog-docs.imgix.net/images/monitors/guide/alert_exammple.26e67f2d3cfad587d6c352af629d05b7.png?auto=format"
   alt="alert_example" /%}



Then, in the alert message, you'll want to use the @notify webhook to mute all subsequent hosts in that Availability Zone when it triggers, and unmute when the alert resolves:

{% image
   source="https://datadog-docs.imgix.net/images/monitors/guide/mute_demo_msg.c49dd75918678db63469f5640b4c77b1.png?auto=format"
   alt="mute_demo_msg" /%}



Here is that full sample markup:

```text
That's alot of missing data - check first to see if there is an AWS outage?
{{#is_alert}}
{{availability-zone.name}} is missing 50% of data!! ALL OTHER ALERTS FOR {{availability-zone.name}} WILL BE AUTOMUTED
@webhook-mute-ALL-monitor-scope
{{/is_alert}}

{{#is_alert_recovery}}
{{availability-zone.name}} is NO LONGER missing 50% of data!! ALL OTHER ALERTS FOR {{availability-zone.name}} ARE UNMUTED
@webhook-unmute-ALL-monitor-scope
{{/is_alert_recovery}}
```

- [Learn how to create a monitor](https://docs.datadoghq.com/monitors/)
- [Configure your monitor notifications](https://docs.datadoghq.com/monitors/notify/)
- [Schedule a downtime to mute a monitor](https://docs.datadoghq.com/monitors/downtimes/)
