---
title: Edit a monitor
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Monitors
---

# Edit a monitor{% #edit-a-monitor %}
Copy pageCopied
{% tab title="v1" %}

| Datadog site      | API endpoint                                                  |
| ----------------- | ------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v1/monitor/{monitor_id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v1/monitor/{monitor_id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v1/monitor/{monitor_id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v1/monitor/{monitor_id}      |
| us2.ddog-gov.com  | PUT https://api.us2.ddog-gov.com/api/v1/monitor/{monitor_id}  |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v1/monitor/{monitor_id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v1/monitor/{monitor_id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v1/monitor/{monitor_id} |

### Overview

Edit the specified monitor. This endpoint requires the `monitors_write` permission.

OAuth apps require the `monitors_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#monitors) to access this endpoint.



### Arguments

#### Path Parameters

| Name                         | Type    | Description            |
| ---------------------------- | ------- | ---------------------- |
| monitor_id [*required*] | integer | The ID of the monitor. |

### Request

#### Body Data (required)

Edit a monitor request body.

{% tab title="Model" %}

| Parent field         | Field                               | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------- | ----------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | assets                              | [object]        | The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| assets               | category [*required*]          | enum            | Indicates the type of asset this entity represents on a monitor. Allowed enum values: `runbook`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| assets               | name [*required*]              | string          | Name for the monitor asset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| assets               | resource_key                        | string          | Represents the identifier of the internal Datadog resource that this asset represents. IDs in this field should be passed in as strings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| assets               | resource_type                       | enum            | Type of internal Datadog resource associated with a monitor asset. Allowed enum values: `notebook`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| assets               | url [*required*]               | string          | URL link for the asset. For links with an internal resource type set, this should be the relative path to where the Datadog domain is appended internally. For external links, this should be the full URL path.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|                      | created                             | date-time       | Timestamp of the monitor creation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                      | creator                             | object          | Object describing the creator of the shared element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| creator              | email                               | string          | Email of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| creator              | handle                              | string          | Handle of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| creator              | name                                | string          | Name of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|                      | deleted                             | date-time       | Whether or not the monitor is deleted. (Always `null`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                      | draft_status                        | enum            | Indicates whether the monitor is in a draft or published state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `draft`: The monitor appears as Draft and does not send notifications. `published`: The monitor is active and evaluates conditions and notify as configured. | This field is in preview. The draft value is only available to customers with the feature enabled. Allowed enum values: `draft,published` |
|                      | id                                  | int64           | ID of this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|                      | message                             | string          | A message to include with notifications for this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|                      | modified                            | date-time       | Last timestamp when the monitor was edited.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|                      | multi                               | boolean         | Whether or not the monitor is broken down on different groups.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|                      | name                                | string          | The monitor name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | options                             | object          | List of options associated with your monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| options              | aggregation                         | object          | Type of aggregation performed in the monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| aggregation          | group_by                            | string          | Group to break down the monitor on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| aggregation          | metric                              | string          | Metric name used in the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| aggregation          | type                                | string          | Metric type used in the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| options              | device_ids                          | [string]        | **DEPRECATED**: IDs of the device the Synthetics monitor is running on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | enable_logs_sample                  | boolean         | Whether or not to send a log sample when the log monitor triggers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| options              | enable_samples                      | boolean         | Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | escalation_message                  | string          | We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify.md?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the `@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`.                                                                                                                                                                                                                                                                                                                                           |
| options              | evaluation_delay                    | int64           | Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.                                                                                                                                                                                                                                                                                                   |
| options              | group_retention_duration            | string          | The time span after which groups with missing data are dropped from the monitor state. The minimum value is one hour, and the maximum value is 72 hours. Example values are: "60m", "1h", and "2d". This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors.                                                                                                                                                                                                                                                                                                                          |
| options              | groupby_simple_monitor              | boolean         | **DEPRECATED**: Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| options              | include_tags                        | boolean         | A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | **Examples**                                                                                                                                                 |
| options              | locked                              | boolean         | **DEPRECATED**: Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | min_failure_duration                | int64           | How long the test should be in failure before alerting (integer, number of seconds, max 7200).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | min_location_failed                 | int64           | The minimum number of locations in failure at the same time during at least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1).                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | new_group_delay                     | int64           | Time (in seconds) to skip evaluations for new groups.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | For example, this option can be used to skip evaluations for new hosts while they initialize.                                                                | Must be a non negative integer.                                                                                                           |
| options              | new_host_delay                      | int64           | **DEPRECATED**: Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Use new_group_delay instead.                                                                                                                                 |
| options              | no_data_timeframe                   | int64           | The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks.                                                                                                                                                                                                                                                                                                                                                       |
| options              | notification_preset_name            | enum            | Toggles the display of additional content sent in the monitor notification. Allowed enum values: `show_all,hide_query,hide_handles,hide_all,hide_query_and_handles,show_only_snapshot,hide_handles_and_footer`                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | notify_audit                        | boolean         | A Boolean indicating whether tagged users is notified on changes to this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| options              | notify_by                           | [string]        | Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert.                                                                                            |
| options              | notify_no_data                      | boolean         | A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| options              | on_missing_data                     | enum            | Controls how groups or monitors are treated if an evaluation does not return any data points. The default option results in different behavior depending on the monitor query type. For monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to the threshold conditions. For monitors using any query type other than Count, for example Gauge, Measure, or Rate, the monitor shows the last known status. This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. Allowed enum values: `default,show_no_data,show_and_notify_no_data,resolve` |
| options              | renotify_interval                   | int64           | The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it's not resolved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| options              | renotify_occurrences                | int64           | The number of times re-notification messages should be sent on the current status at the provided re-notification interval.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | renotify_statuses                   | [string]        | The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | require_full_window                 | boolean         | A Boolean indicating whether this monitor needs a full window of data before it's evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. This setting only applies to metric monitors.                                                                                                                                                                                                                                                                                                                                                                                |
| options              | scheduling_options                  | object          | Configuration options for scheduling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| scheduling_options   | custom_schedule                     | object          | Configuration options for the custom schedule. **This feature is in private beta.**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| custom_schedule      | recurrences                         | [object]        | Array of custom schedule recurrences.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| recurrences          | rrule                               | string          | Defines the recurrence rule (RRULE) for a given schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| recurrences          | start                               | string          | Defines the start date and time of the recurring schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| recurrences          | timezone                            | string          | Defines the timezone the schedule runs on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| scheduling_options   | evaluation_window                   | object          | Configuration options for the evaluation window. If `hour_starts` is set, no other fields may be set. Otherwise, `day_starts` and `month_starts` must be set together.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| evaluation_window    | day_starts                          | string          | The time of the day at which a one day cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| evaluation_window    | hour_starts                         | int32           | The minute of the hour at which a one hour cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| evaluation_window    | month_starts                        | int32           | The day of the month at which a one month cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| evaluation_window    | timezone                            | string          | The timezone of the time of the day of the cumulative evaluation window start.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | silenced                            | object          | **DEPRECATED**: Information about the downtime applied to the monitor. Only shows v1 downtimes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| additionalProperties | <any-key>                           | int64           | UTC epoch timestamp in seconds when the downtime for the group expires.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | synthetics_check_id                 | string          | **DEPRECATED**: ID of the corresponding Synthetic check.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| options              | threshold_windows                   | object          | Alerting time window options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| threshold_windows    | recovery_window                     | string          | Describes how long an anomalous metric must be normal before the alert recovers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| threshold_windows    | trigger_window                      | string          | Describes how long a metric must be anomalous before an alert triggers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | thresholds                          | object          | List of the different monitor threshold available.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| thresholds           | critical                            | double          | The monitor `CRITICAL` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| thresholds           | critical_query                      | string          | Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| thresholds           | critical_recovery                   | double          | The monitor `CRITICAL` recovery threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| thresholds           | critical_recovery_query             | string          | Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| thresholds           | ok                                  | double          | The monitor `OK` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| thresholds           | unknown                             | double          | The monitor UNKNOWN threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| thresholds           | warning                             | double          | The monitor `WARNING` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| thresholds           | warning_recovery                    | double          | The monitor `WARNING` recovery threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| options              | timeout_h                           | int64           | The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | variables                           | [ <oneOf>] | List of requests that can be used in the monitor query. **This feature is currently in beta.**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| variables            | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| variables            | Option 2                            | object          | A formula and functions cost query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregation methods for metric queries. Allowed enum values: `avg,sum,max,min,last,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 2             | data_source [*required*]       | enum            | Data source for cost queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| variables            | Option 3                            | object          | A formula and functions data quality query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 3             | data_source [*required*]       | enum            | Data source for data quality queries. Allowed enum values: `data_quality_metrics`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 3             | filter [*required*]            | string          | Filter expression used to match on data entities. Uses Aastra query syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 3             | group_by                            | [string]        | Optional grouping fields for aggregation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 3             | measure [*required*]           | string          | The data quality measure to query. Common values include: `bytes`, `cardinality`, `custom`, `freshness`, `max`, `mean`, `min`, `nullness`, `percent_negative`, `percent_zero`, `row_count`, `stddev`, `sum`, `uniqueness`. Additional values may be supported.                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 3             | monitor_options                     | object          | Monitor configuration options for data quality queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| monitor_options      | crontab_override                    | string          | Crontab expression to override the default schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| monitor_options      | custom_sql                          | string          | Custom SQL query for the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| monitor_options      | custom_where                        | string          | Custom WHERE clause for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| monitor_options      | group_by_columns                    | [string]        | Columns to group results by.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| monitor_options      | model_type_override                 | enum            | Override for the model type used in anomaly detection. Allowed enum values: `freshness,percentage,any`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 3             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 3             | schema_version                      | string          | Schema version for the data quality query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Option 3             | scope                               | string          | Optional scoping expression to further filter metrics. Uses metrics filter syntax. This is useful when an entity has been configured to emit metrics with additional tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variables            | Option 4                            | object          | A formula and functions data jobs query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 4             | job_type [*required*]          | string          | The type of job being monitored. Valid values include: `databricks.job`, `spark.application`, `airflow.dag`, `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. Custom job types are supported with the `custom.ol.` prefix.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 4             | jobs_query [*required*]        | string          | Filter expression used to select the jobs to monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 4             | name [*required*]              | string          | Name of the query for use in formulas. Must be `run_query`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 4             | query_dialect [*required*]     | string          | Query dialect for data jobs queries. Currently only `metric` is supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variables            | Option 5                            | object          | A formula and functions aggregate augmented query. Used to enrich base query results with data from a reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 5             | augment_query [*required*]     |  <oneOf>   | Augment query for aggregate augmented queries. Can be an events query or a reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| augment_query        | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| augment_query        | Option 2                            | object          | A reference table query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | columns                             | [object]        | List of columns to retrieve from the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| columns              | alias                               | string          | Optional alias for the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| columns              | name [*required*]              | string          | Name of the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | data_source [*required*]       | enum            | Data source for reference table queries. Allowed enum values: `reference_table`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Option 2             | name                                | string          | Name of the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2             | query_filter                        | string          | Optional filter expression for the reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 2             | table_name [*required*]        | string          | Name of the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 5             | base_query [*required*]        |  <oneOf>   | Base query for aggregate queries. Can be an events query or a metrics query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| base_query           | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| base_query           | Option 2                            | object          | A formula and functions metrics query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregator for metrics queries. Allowed enum values: `avg,min,max,sum,last,mean,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 2             | data_source [*required*]       | enum            | Data source for metrics queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 2             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The metrics query definition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 5             | compute [*required*]           | [object]        | Compute options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 5             | data_source [*required*]       | enum            | Data source for aggregate augmented queries. Allowed enum values: `aggregate_augmented_query`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 5             | group_by [*required*]          | [object]        | Group by options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 5             | join_condition [*required*]    | object          | Join condition for aggregate augmented queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| join_condition       | augment_attribute [*required*] | string          | Attribute from the augment query to join on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| join_condition       | base_attribute [*required*]    | string          | Attribute from the base query to join on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| join_condition       | join_type [*required*]         | enum            | Join type for aggregate query join conditions. Allowed enum values: `inner,left`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Option 5             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| variables            | Option 6                            | object          | A formula and functions aggregate filtered query. Used to filter base query results using data from another source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 6             | base_query [*required*]        |  <oneOf>   | Base query for aggregate queries. Can be an events query or a metrics query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| base_query           | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| base_query           | Option 2                            | object          | A formula and functions metrics query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregator for metrics queries. Allowed enum values: `avg,min,max,sum,last,mean,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 2             | data_source [*required*]       | enum            | Data source for metrics queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 2             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The metrics query definition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 6             | compute                             | [object]        | Compute options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 6             | data_source [*required*]       | enum            | Data source for aggregate filtered queries. Allowed enum values: `aggregate_filtered_query`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 6             | filter_query [*required*]      |  <oneOf>   | Filter query for aggregate filtered queries. Can be an events query or a reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| filter_query         | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| filter_query         | Option 2                            | object          | A reference table query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | columns                             | [object]        | List of columns to retrieve from the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| columns              | alias                               | string          | Optional alias for the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| columns              | name [*required*]              | string          | Name of the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | data_source [*required*]       | enum            | Data source for reference table queries. Allowed enum values: `reference_table`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Option 2             | name                                | string          | Name of the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2             | query_filter                        | string          | Optional filter expression for the reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 2             | table_name [*required*]        | string          | Name of the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 6             | filters [*required*]           | [object]        | Filter conditions for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| filters              | base_attribute [*required*]    | string          | Attribute from the base query to filter on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| filters              | exclude                             | boolean         | Whether to exclude matching records instead of including them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| filters              | filter_attribute [*required*]  | string          | Attribute from the filter query to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 6             | group_by                            | [object]        | Group by options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 6             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                      | overall_state                       | enum            | The different states your monitor can be in. Allowed enum values: `Alert,Ignored,No Data,OK,Skipped,Unknown,Warn`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | priority                            | int64           | Integer from 1 (high) to 5 (low) indicating alert severity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|                      | query                               | string          | The monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                      | restricted_roles                    | [string]        | A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles.md#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies.md) to manage write authorization for individual monitors by teams and users, in addition to roles.                              |
|                      | state                               | object          | Wrapper object with the different monitor states.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| state                | groups                              | object          | Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| additionalProperties | <any-key>                           | object          | Monitor state for a single group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <any-key>            | last_nodata_ts                      | int64           | Latest timestamp the monitor was in NO_DATA state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <any-key>            | last_notified_ts                    | int64           | Latest timestamp of the notification sent for this monitor group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <any-key>            | last_resolved_ts                    | int64           | Latest timestamp the monitor group was resolved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <any-key>            | last_triggered_ts                   | int64           | Latest timestamp the monitor group triggered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <any-key>            | name                                | string          | The name of the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <any-key>            | status                              | enum            | The different states your monitor can be in. Allowed enum values: `Alert,Ignored,No Data,OK,Skipped,Unknown,Warn`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | tags                                | [string]        | Tags associated to your monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|                      | type                                | enum            | The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options.md) docs. Allowed enum values: `composite,event alert,log alert,metric alert,process alert,query alert,rum alert,service check,synthetics alert,trace-analytics alert`                                                                                                                                                                                                                                                                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "name": "My monitor-updated",
  "priority": null,
  "options": {
    "evaluation_delay": null,
    "new_group_delay": 600,
    "new_host_delay": null,
    "renotify_interval": null,
    "thresholds": {
      "critical": 2,
      "warning": null
    },
    "timeout_h": null
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Object describing a monitor.

| Parent field         | Field                               | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------- | ----------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | assets                              | [object]        | The list of monitor assets tied to a monitor, which represents key links for users to take action on monitor alerts (for example, runbooks).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| assets               | category [*required*]          | enum            | Indicates the type of asset this entity represents on a monitor. Allowed enum values: `runbook`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| assets               | name [*required*]              | string          | Name for the monitor asset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| assets               | resource_key                        | string          | Represents the identifier of the internal Datadog resource that this asset represents. IDs in this field should be passed in as strings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| assets               | resource_type                       | enum            | Type of internal Datadog resource associated with a monitor asset. Allowed enum values: `notebook`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| assets               | url [*required*]               | string          | URL link for the asset. For links with an internal resource type set, this should be the relative path to where the Datadog domain is appended internally. For external links, this should be the full URL path.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|                      | created                             | date-time       | Timestamp of the monitor creation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                      | creator                             | object          | Object describing the creator of the shared element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| creator              | email                               | string          | Email of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| creator              | handle                              | string          | Handle of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| creator              | name                                | string          | Name of the creator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|                      | deleted                             | date-time       | Whether or not the monitor is deleted. (Always `null`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                      | draft_status                        | enum            | Indicates whether the monitor is in a draft or published state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `draft`: The monitor appears as Draft and does not send notifications. `published`: The monitor is active and evaluates conditions and notify as configured. | This field is in preview. The draft value is only available to customers with the feature enabled. Allowed enum values: `draft,published` |
|                      | id                                  | int64           | ID of this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|                      | matching_downtimes                  | [object]        | A list of active v1 downtimes that match this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| matching_downtimes   | end                                 | int64           | POSIX timestamp to end the downtime.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| matching_downtimes   | id [*required*]                | int64           | The downtime ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| matching_downtimes   | scope                               | [string]        | The scope(s) to which the downtime applies. Must be in `key:value` format. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`).                                                                                                                                                                                                                                                                                                                                                          |
| matching_downtimes   | start                               | int64           | POSIX timestamp to start the downtime.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                      | message                             | string          | A message to include with notifications for this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|                      | modified                            | date-time       | Last timestamp when the monitor was edited.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|                      | multi                               | boolean         | Whether or not the monitor is broken down on different groups.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|                      | name                                | string          | The monitor name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | options                             | object          | List of options associated with your monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| options              | aggregation                         | object          | Type of aggregation performed in the monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| aggregation          | group_by                            | string          | Group to break down the monitor on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| aggregation          | metric                              | string          | Metric name used in the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| aggregation          | type                                | string          | Metric type used in the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| options              | device_ids                          | [string]        | **DEPRECATED**: IDs of the device the Synthetics monitor is running on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | enable_logs_sample                  | boolean         | Whether or not to send a log sample when the log monitor triggers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| options              | enable_samples                      | boolean         | Whether or not to send a list of samples when the monitor triggers. This is only used by CI Test and Pipeline monitors.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | escalation_message                  | string          | We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notify.md?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the `@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`.                                                                                                                                                                                                                                                                                                                                           |
| options              | evaluation_delay                    | int64           | Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.                                                                                                                                                                                                                                                                                                   |
| options              | group_retention_duration            | string          | The time span after which groups with missing data are dropped from the monitor state. The minimum value is one hour, and the maximum value is 72 hours. Example values are: "60m", "1h", and "2d". This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors.                                                                                                                                                                                                                                                                                                                          |
| options              | groupby_simple_monitor              | boolean         | **DEPRECATED**: Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. Use `notify_by` instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| options              | include_tags                        | boolean         | A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | **Examples**                                                                                                                                                 |
| options              | locked                              | boolean         | **DEPRECATED**: Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | min_failure_duration                | int64           | How long the test should be in failure before alerting (integer, number of seconds, max 7200).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | min_location_failed                 | int64           | The minimum number of locations in failure at the same time during at least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1).                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | new_group_delay                     | int64           | Time (in seconds) to skip evaluations for new groups.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | For example, this option can be used to skip evaluations for new hosts while they initialize.                                                                | Must be a non negative integer.                                                                                                           |
| options              | new_host_delay                      | int64           | **DEPRECATED**: Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Use new_group_delay instead.                                                                                                                                 |
| options              | no_data_timeframe                   | int64           | The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks.                                                                                                                                                                                                                                                                                                                                                       |
| options              | notification_preset_name            | enum            | Toggles the display of additional content sent in the monitor notification. Allowed enum values: `show_all,hide_query,hide_handles,hide_all,hide_query_and_handles,show_only_snapshot,hide_handles_and_footer`                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | notify_audit                        | boolean         | A Boolean indicating whether tagged users is notified on changes to this monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| options              | notify_by                           | [string]        | Controls what granularity a monitor alerts on. Only available for monitors with groupings. For instance, a monitor grouped by `cluster`, `namespace`, and `pod` can be configured to only notify on each new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned in `notify_by` must be a subset of the grouping tags in the query. For example, a query grouped by `cluster` and `namespace` cannot notify on `region`. Setting `notify_by` to `["*"]` configures the monitor to notify as a simple-alert.                                                                                            |
| options              | notify_no_data                      | boolean         | A Boolean indicating whether this monitor notifies when data stops reporting. Defaults to `false`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| options              | on_missing_data                     | enum            | Controls how groups or monitors are treated if an evaluation does not return any data points. The default option results in different behavior depending on the monitor query type. For monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to the threshold conditions. For monitors using any query type other than Count, for example Gauge, Measure, or Rate, the monitor shows the last known status. This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. Allowed enum values: `default,show_no_data,show_and_notify_no_data,resolve` |
| options              | renotify_interval                   | int64           | The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it's not resolved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| options              | renotify_occurrences                | int64           | The number of times re-notification messages should be sent on the current status at the provided re-notification interval.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | renotify_statuses                   | [string]        | The types of monitor statuses for which re-notification messages are sent. Default: **null** if `renotify_interval` is **null**. If `renotify_interval` is set, defaults to renotify on `Alert` and `No Data`.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | require_full_window                 | boolean         | A Boolean indicating whether this monitor needs a full window of data before it's evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false. This setting only applies to metric monitors.                                                                                                                                                                                                                                                                                                                                                                                |
| options              | scheduling_options                  | object          | Configuration options for scheduling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| scheduling_options   | custom_schedule                     | object          | Configuration options for the custom schedule. **This feature is in private beta.**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| custom_schedule      | recurrences                         | [object]        | Array of custom schedule recurrences.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| recurrences          | rrule                               | string          | Defines the recurrence rule (RRULE) for a given schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| recurrences          | start                               | string          | Defines the start date and time of the recurring schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| recurrences          | timezone                            | string          | Defines the timezone the schedule runs on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| scheduling_options   | evaluation_window                   | object          | Configuration options for the evaluation window. If `hour_starts` is set, no other fields may be set. Otherwise, `day_starts` and `month_starts` must be set together.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| evaluation_window    | day_starts                          | string          | The time of the day at which a one day cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| evaluation_window    | hour_starts                         | int32           | The minute of the hour at which a one hour cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| evaluation_window    | month_starts                        | int32           | The day of the month at which a one month cumulative evaluation window starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| evaluation_window    | timezone                            | string          | The timezone of the time of the day of the cumulative evaluation window start.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| options              | silenced                            | object          | **DEPRECATED**: Information about the downtime applied to the monitor. Only shows v1 downtimes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| additionalProperties | <any-key>                           | int64           | UTC epoch timestamp in seconds when the downtime for the group expires.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | synthetics_check_id                 | string          | **DEPRECATED**: ID of the corresponding Synthetic check.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| options              | threshold_windows                   | object          | Alerting time window options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| threshold_windows    | recovery_window                     | string          | Describes how long an anomalous metric must be normal before the alert recovers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| threshold_windows    | trigger_window                      | string          | Describes how long a metric must be anomalous before an alert triggers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| options              | thresholds                          | object          | List of the different monitor threshold available.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| thresholds           | critical                            | double          | The monitor `CRITICAL` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| thresholds           | critical_query                      | string          | Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| thresholds           | critical_recovery                   | double          | The monitor `CRITICAL` recovery threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| thresholds           | critical_recovery_query             | string          | Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| thresholds           | ok                                  | double          | The monitor `OK` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| thresholds           | unknown                             | double          | The monitor UNKNOWN threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| thresholds           | warning                             | double          | The monitor `WARNING` threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| thresholds           | warning_recovery                    | double          | The monitor `WARNING` recovery threshold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| options              | timeout_h                           | int64           | The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| options              | variables                           | [ <oneOf>] | List of requests that can be used in the monitor query. **This feature is currently in beta.**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| variables            | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| variables            | Option 2                            | object          | A formula and functions cost query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregation methods for metric queries. Allowed enum values: `avg,sum,max,min,last,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 2             | data_source [*required*]       | enum            | Data source for cost queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| variables            | Option 3                            | object          | A formula and functions data quality query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 3             | data_source [*required*]       | enum            | Data source for data quality queries. Allowed enum values: `data_quality_metrics`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 3             | filter [*required*]            | string          | Filter expression used to match on data entities. Uses Aastra query syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 3             | group_by                            | [string]        | Optional grouping fields for aggregation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 3             | measure [*required*]           | string          | The data quality measure to query. Common values include: `bytes`, `cardinality`, `custom`, `freshness`, `max`, `mean`, `min`, `nullness`, `percent_negative`, `percent_zero`, `row_count`, `stddev`, `sum`, `uniqueness`. Additional values may be supported.                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 3             | monitor_options                     | object          | Monitor configuration options for data quality queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| monitor_options      | crontab_override                    | string          | Crontab expression to override the default schedule.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| monitor_options      | custom_sql                          | string          | Custom SQL query for the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| monitor_options      | custom_where                        | string          | Custom WHERE clause for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| monitor_options      | group_by_columns                    | [string]        | Columns to group results by.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| monitor_options      | model_type_override                 | enum            | Override for the model type used in anomaly detection. Allowed enum values: `freshness,percentage,any`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 3             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 3             | schema_version                      | string          | Schema version for the data quality query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Option 3             | scope                               | string          | Optional scoping expression to further filter metrics. Uses metrics filter syntax. This is useful when an entity has been configured to emit metrics with additional tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variables            | Option 4                            | object          | A formula and functions data jobs query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 4             | job_type [*required*]          | string          | The type of job being monitored. Valid values include: `databricks.job`, `spark.application`, `airflow.dag`, `dbt.job`, `dbt.model`, `dbt.test`, `glue.job`. Custom job types are supported with the `custom.ol.` prefix.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 4             | jobs_query [*required*]        | string          | Filter expression used to select the jobs to monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 4             | name [*required*]              | string          | Name of the query for use in formulas. Must be `run_query`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 4             | query_dialect [*required*]     | string          | Query dialect for data jobs queries. Currently only `metric` is supported.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variables            | Option 5                            | object          | A formula and functions aggregate augmented query. Used to enrich base query results with data from a reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 5             | augment_query [*required*]     |  <oneOf>   | Augment query for aggregate augmented queries. Can be an events query or a reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| augment_query        | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| augment_query        | Option 2                            | object          | A reference table query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | columns                             | [object]        | List of columns to retrieve from the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| columns              | alias                               | string          | Optional alias for the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| columns              | name [*required*]              | string          | Name of the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | data_source [*required*]       | enum            | Data source for reference table queries. Allowed enum values: `reference_table`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Option 2             | name                                | string          | Name of the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2             | query_filter                        | string          | Optional filter expression for the reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 2             | table_name [*required*]        | string          | Name of the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 5             | base_query [*required*]        |  <oneOf>   | Base query for aggregate queries. Can be an events query or a metrics query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| base_query           | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| base_query           | Option 2                            | object          | A formula and functions metrics query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregator for metrics queries. Allowed enum values: `avg,min,max,sum,last,mean,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 2             | data_source [*required*]       | enum            | Data source for metrics queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 2             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The metrics query definition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 5             | compute [*required*]           | [object]        | Compute options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 5             | data_source [*required*]       | enum            | Data source for aggregate augmented queries. Allowed enum values: `aggregate_augmented_query`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 5             | group_by [*required*]          | [object]        | Group by options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 5             | join_condition [*required*]    | object          | Join condition for aggregate augmented queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| join_condition       | augment_attribute [*required*] | string          | Attribute from the augment query to join on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| join_condition       | base_attribute [*required*]    | string          | Attribute from the base query to join on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| join_condition       | join_type [*required*]         | enum            | Join type for aggregate query join conditions. Allowed enum values: `inner,left`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Option 5             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| variables            | Option 6                            | object          | A formula and functions aggregate filtered query. Used to filter base query results using data from another source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 6             | base_query [*required*]        |  <oneOf>   | Base query for aggregate queries. Can be an events query or a metrics query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| base_query           | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| base_query           | Option 2                            | object          | A formula and functions metrics query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | aggregator                          | enum            | Aggregator for metrics queries. Allowed enum values: `avg,min,max,sum,last,mean,area,l2norm,percentile,stddev`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 2             | data_source [*required*]       | enum            | Data source for metrics queries. Allowed enum values: `metrics,cloud_cost,datadog_usage`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Option 2             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 2             | query [*required*]             | string          | The metrics query definition.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Option 6             | compute                             | [object]        | Compute options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 6             | data_source [*required*]       | enum            | Data source for aggregate filtered queries. Allowed enum values: `aggregate_filtered_query`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Option 6             | filter_query [*required*]      |  <oneOf>   | Filter query for aggregate filtered queries. Can be an events query or a reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| filter_query         | Option 1                            | object          | A formula and functions events query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 1             | compute [*required*]           | object          | Compute options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | interval                            | int64           | A time interval in milliseconds.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | metric                              | string          | Measurable attribute to compute.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| compute              | name                                | string          | The name assigned to this aggregation, when multiple aggregations are defined for a query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| compute              | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | data_source [*required*]       | enum            | Data source for event platform-based queries. Allowed enum values: `rum,ci_pipelines,ci_tests,audit,events,logs,spans,database_queries,network,network_path`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 1             | group_by                            | [object]        | Group by options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | indexes                             | [string]        | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 1             | name [*required*]              | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Option 1             | search                              | object          | Search options.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| search               | query [*required*]             | string          | Events search string.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| filter_query         | Option 2                            | object          | A reference table query for use in aggregate queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Option 2             | columns                             | [object]        | List of columns to retrieve from the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| columns              | alias                               | string          | Optional alias for the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| columns              | name [*required*]              | string          | Name of the column.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Option 2             | data_source [*required*]       | enum            | Data source for reference table queries. Allowed enum values: `reference_table`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Option 2             | name                                | string          | Name of the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Option 2             | query_filter                        | string          | Optional filter expression for the reference table query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Option 2             | table_name [*required*]        | string          | Name of the reference table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Option 6             | filters [*required*]           | [object]        | Filter conditions for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| filters              | base_attribute [*required*]    | string          | Attribute from the base query to filter on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| filters              | exclude                             | boolean         | Whether to exclude matching records instead of including them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| filters              | filter_attribute [*required*]  | string          | Attribute from the filter query to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Option 6             | group_by                            | [object]        | Group by options for the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| group_by             | facet [*required*]             | string          | Event facet.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| group_by             | limit                               | int64           | Number of groups to return.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| group_by             | sort                                | object          | Options for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| sort                 | aggregation [*required*]       | enum            | Aggregation methods for event platform queries. Allowed enum values: `count,cardinality,median,pc75,pc90,pc95,pc98,pc99,sum,min`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sort                 | metric                              | string          | Metric used for sorting group by results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| sort                 | order                               | enum            | Direction of sort. Allowed enum values: `asc,desc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| group_by             | source                              | string          | Source reference for composite query payloads.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Option 6             | name                                | string          | Name of the query for use in formulas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|                      | overall_state                       | enum            | The different states your monitor can be in. Allowed enum values: `Alert,Ignored,No Data,OK,Skipped,Unknown,Warn`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | priority                            | int64           | Integer from 1 (high) to 5 (low) indicating alert severity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|                      | query [*required*]             | string          | The monitor query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                      | restricted_roles                    | [string]        | A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles.md#list-roles) and are located in the `data.id` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies.md) to manage write authorization for individual monitors by teams and users, in addition to roles.                              |
|                      | state                               | object          | Wrapper object with the different monitor states.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| state                | groups                              | object          | Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| additionalProperties | <any-key>                           | object          | Monitor state for a single group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <any-key>            | last_nodata_ts                      | int64           | Latest timestamp the monitor was in NO_DATA state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <any-key>            | last_notified_ts                    | int64           | Latest timestamp of the notification sent for this monitor group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <any-key>            | last_resolved_ts                    | int64           | Latest timestamp the monitor group was resolved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <any-key>            | last_triggered_ts                   | int64           | Latest timestamp the monitor group triggered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <any-key>            | name                                | string          | The name of the monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <any-key>            | status                              | enum            | The different states your monitor can be in. Allowed enum values: `Alert,Ignored,No Data,OK,Skipped,Unknown,Warn`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|                      | tags                                | [string]        | Tags associated to your monitor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|                      | type [*required*]              | enum            | The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options.md) docs. Allowed enum values: `composite,event alert,log alert,metric alert,process alert,query alert,rum alert,service check,synthetics alert,trace-analytics alert`                                                                                                                                                                                                                                                                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "assets": [
    {
      "category": "runbook",
      "name": "Monitor Runbook",
      "resource_key": "12345",
      "resource_type": "string",
      "url": "/notebooks/12345"
    }
  ],
  "created": "2019-09-19T10:00:00.000Z",
  "creator": {
    "email": "string",
    "handle": "string",
    "name": "string"
  },
  "deleted": "2019-09-19T10:00:00.000Z",
  "draft_status": "string",
  "id": "integer",
  "matching_downtimes": [
    {
      "end": 1412792983,
      "id": 1625,
      "scope": [
        "env:staging"
      ],
      "start": 1412792983
    }
  ],
  "message": "string",
  "modified": "2019-09-19T10:00:00.000Z",
  "multi": false,
  "name": "My monitor",
  "options": {
    "aggregation": {
      "group_by": "host",
      "metric": "metrics.name",
      "type": "count"
    },
    "device_ids": [],
    "enable_logs_sample": false,
    "enable_samples": false,
    "escalation_message": "string",
    "evaluation_delay": "integer",
    "group_retention_duration": "string",
    "groupby_simple_monitor": false,
    "include_tags": false,
    "locked": false,
    "min_failure_duration": "integer",
    "min_location_failed": "integer",
    "new_group_delay": "integer",
    "new_host_delay": "integer",
    "no_data_timeframe": "integer",
    "notification_preset_name": "string",
    "notify_audit": false,
    "notify_by": [],
    "notify_no_data": false,
    "on_missing_data": "string",
    "renotify_interval": "integer",
    "renotify_occurrences": "integer",
    "renotify_statuses": [],
    "require_full_window": false,
    "scheduling_options": {
      "custom_schedule": {
        "recurrences": [
          {
            "rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR",
            "start": "2023-08-31T16:30:00",
            "timezone": "Europe/Paris"
          }
        ]
      },
      "evaluation_window": {
        "day_starts": "04:00",
        "hour_starts": 0,
        "month_starts": 1,
        "timezone": "Europe/Paris"
      }
    },
    "silenced": {
      "<any-key>": "integer"
    },
    "synthetics_check_id": "string",
    "threshold_windows": {
      "recovery_window": "string",
      "trigger_window": "string"
    },
    "thresholds": {
      "critical": "number",
      "critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")",
      "critical_recovery": "number",
      "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")",
      "ok": "number",
      "unknown": "number",
      "warning": "number",
      "warning_recovery": "number"
    },
    "timeout_h": "integer",
    "variables": [
      {
        "compute": {
          "aggregation": "avg",
          "interval": 60000,
          "metric": "@duration",
          "name": "compute_result",
          "source": "filter_query"
        },
        "data_source": "rum",
        "group_by": [
          {
            "facet": "status",
            "limit": 10,
            "sort": {
              "aggregation": "avg",
              "metric": "string",
              "order": "string"
            },
            "source": "filter_query"
          }
        ],
        "indexes": [
          "days-3",
          "days-7"
        ],
        "name": "query_errors",
        "search": {
          "query": "service:query"
        }
      }
    ]
  },
  "overall_state": "string",
  "priority": "integer",
  "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100",
  "restricted_roles": [],
  "state": {
    "groups": {
      "<any-key>": {
        "last_nodata_ts": "integer",
        "last_notified_ts": "integer",
        "last_resolved_ts": "integer",
        "last_triggered_ts": "integer",
        "name": "string",
        "status": "string"
      }
    }
  },
  "tags": [],
  "type": "query alert"
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Authentication error
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Monitor Not Found error
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## default
# 
 \# Path parameters export monitor_id="6.66486743e+08" \# Curl command curl -X PUT "https://api.datadoghq.com/api/v1/monitor/${monitor_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "message": "Updated notification message for this monitor.",
  "name": "Updated monitor name",
  "options": {
    "no_data_timeframe": 20,
    "notify_no_data": true
  },
  "priority": 3,
  "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} \u003e 100",
  "tags": [
    "app:webserver",
    "frontend"
  ],
  "type": "query alert"
}
EOF 
                        
##### 

```go
// Edit a monitor returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	"strconv"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	// there is a valid "monitor" in the system
	MonitorID, _ := strconv.ParseInt(os.Getenv("MONITOR_ID"), 10, 64)

	body := datadogV1.MonitorUpdateRequest{
		Name:     datadog.PtrString("My monitor-updated"),
		Priority: *datadog.NewNullableInt64(nil),
		Options: &datadogV1.MonitorOptions{
			EvaluationDelay:  *datadog.NewNullableInt64(nil),
			NewGroupDelay:    *datadog.NewNullableInt64(datadog.PtrInt64(600)),
			NewHostDelay:     *datadog.NewNullableInt64(nil),
			RenotifyInterval: *datadog.NewNullableInt64(nil),
			Thresholds: &datadogV1.MonitorThresholds{
				Critical: datadog.PtrFloat64(2),
				Warning:  *datadog.NewNullableFloat64(nil),
			},
			TimeoutH: *datadog.NewNullableInt64(nil),
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewMonitorsApi(apiClient)
	resp, r, err := api.UpdateMonitor(ctx, MonitorID, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MonitorsApi.UpdateMonitor`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `MonitorsApi.UpdateMonitor`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Edit a monitor returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.MonitorsApi;
import com.datadog.api.client.v1.model.Monitor;
import com.datadog.api.client.v1.model.MonitorOptions;
import com.datadog.api.client.v1.model.MonitorThresholds;
import com.datadog.api.client.v1.model.MonitorUpdateRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    MonitorsApi apiInstance = new MonitorsApi(defaultClient);

    // there is a valid "monitor" in the system
    Long MONITOR_ID = Long.parseLong(System.getenv("MONITOR_ID"));
    String MONITOR_NAME = System.getenv("MONITOR_NAME");

    MonitorUpdateRequest body =
        new MonitorUpdateRequest()
            .name("My monitor-updated")
            .priority(null)
            .options(
                new MonitorOptions()
                    .evaluationDelay(null)
                    .newGroupDelay(600L)
                    .newHostDelay(null)
                    .renotifyInterval(null)
                    .thresholds(new MonitorThresholds().critical(2.0).warning(null))
                    .timeoutH(null));

    try {
      Monitor result = apiInstance.updateMonitor(MONITOR_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling MonitorsApi#updateMonitor");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Edit a monitor returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.monitors_api import MonitorsApi
from datadog_api_client.v1.model.monitor_options import MonitorOptions
from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds
from datadog_api_client.v1.model.monitor_update_request import MonitorUpdateRequest

# there is a valid "monitor" in the system
MONITOR_ID = environ["MONITOR_ID"]
MONITOR_NAME = environ["MONITOR_NAME"]

body = MonitorUpdateRequest(
    name="My monitor-updated",
    priority=None,
    options=MonitorOptions(
        evaluation_delay=None,
        new_group_delay=600,
        new_host_delay=None,
        renotify_interval=None,
        thresholds=MonitorThresholds(
            critical=2.0,
            warning=None,
        ),
        timeout_h=None,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = MonitorsApi(api_client)
    response = api_instance.update_monitor(monitor_id=int(MONITOR_ID), body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Edit a monitor returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::MonitorsAPI.new

# there is a valid "monitor" in the system
MONITOR_ID = ENV["MONITOR_ID"]
MONITOR_NAME = ENV["MONITOR_NAME"]

body = DatadogAPIClient::V1::MonitorUpdateRequest.new({
  name: "My monitor-updated",
  priority: nil,
  options: DatadogAPIClient::V1::MonitorOptions.new({
    evaluation_delay: nil,
    new_group_delay: 600,
    new_host_delay: nil,
    renotify_interval: nil,
    thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
      critical: 2,
      warning: nil,
    }),
    timeout_h: nil,
  }),
})
p api_instance.update_monitor(MONITOR_ID.to_i, body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```rust
// Edit a monitor returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_monitors::MonitorsAPI;
use datadog_api_client::datadogV1::model::MonitorOptions;
use datadog_api_client::datadogV1::model::MonitorThresholds;
use datadog_api_client::datadogV1::model::MonitorUpdateRequest;

#[tokio::main]
async fn main() {
    // there is a valid "monitor" in the system
    let monitor_id: i64 = std::env::var("MONITOR_ID").unwrap().parse().unwrap();
    let body = MonitorUpdateRequest::new()
        .name("My monitor-updated".to_string())
        .options(
            MonitorOptions::new()
                .evaluation_delay(None)
                .new_group_delay(Some(600))
                .new_host_delay(None)
                .renotify_interval(None)
                .thresholds(MonitorThresholds::new().critical(2.0 as f64).warning(None))
                .timeout_h(None),
        )
        .priority(None);
    let configuration = datadog::Configuration::new();
    let api = MonitorsAPI::with_config(configuration);
    let resp = api.update_monitor(monitor_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Edit a monitor returns "OK" response
 */

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.MonitorsApi(configuration);

// there is a valid "monitor" in the system
const MONITOR_ID = parseInt(process.env.MONITOR_ID as string);

const params: v1.MonitorsApiUpdateMonitorRequest = {
  body: {
    name: "My monitor-updated",
    priority: undefined,
    options: {
      evaluationDelay: undefined,
      newGroupDelay: 600,
      newHostDelay: undefined,
      renotifyInterval: undefined,
      thresholds: {
        critical: 2,
        warning: undefined,
      },
      timeoutH: undefined,
    },
  },
  monitorId: MONITOR_ID,
};

apiInstance
  .updateMonitor(params)
  .then((data: v1.Monitor) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
