Creates a monitor. Set detection_type to choose how the monitor raises incidents: anomaly when spend is unusual for its own history, threshold when total spend over evaluation_basis goes above or below threshold_trigger_value, trend when spend grows by more than trend_growth_pct over trend_basis, or forecast when spend is projected to go above threshold_trigger_value by the end of the month. Each type takes its own settings; the request examples show one body for each. detection_type defaults to anomaly and can't be changed after the monitor is created. A forecast monitor takes no group_by.
A threshold monitor with comparison_operator above can also set warning_levels: up to five whole percentages of threshold_trigger_value, each from 1 to 99, to warn before spend reaches the amount. They must be integers with no repeats, and default to [] (no warnings). The amount itself always alerts at 100%. A monitor with warning levels keeps one incident per series per window: it opens when spend crosses the lowest level and notifies again at each higher level crossed. Warning levels on a below monitor return 422, and so does warning_levels on any other type.
Threshold, Trend, and Forecast monitors are in preview. If your organization doesn't have the preview for a type, creating or updating a monitor of that type returns 422.
Fields left out take their defaults; cost_type defaults to REAL_COST. For what each cost type measures, see Cost Types. CUSTOM_COST is a cost calculation defined for your organization.
If another monitor in your organization already has the same detection_type and type settings, filter_set, group_by, threshold, and cost_type, the call returns 409 without creating a monitor, and error.existing_id names the existing one. A client that retries after a lost response can use that ID to pick up the monitor its first call created. Paused monitors count as a match and deleted monitors don't. The order of values in filter_set and group_by doesn't matter, and monitor_name, description, and is_enabled aren't compared.
group_by accepts at most one Dimension. Notification channels aren't set here; set them afterward with Update monitor notifications. Field validation failures return 422 with a details list.
CloudZero records the change in the activity log, attributed to "Set via API", after saving it. If that log write fails, the monitor is still created.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||

