Update monitor

Send only the fields you want to change; omitted fields keep their stored values. For example, {"is_enabled": false} pauses a monitor and leaves everything else as is. null clears description. null for a setting that belongs only to other detection types is accepted and changes nothing; null on any other field returns 422. group_by accepts at most one Dimension. System monitors accept only threshold, is_enabled, and cost_type. For what each cost_type value measures, see Cost Types.
A monitor's type is fixed when it's created, so detection_type isn't accepted here and sending it returns 422; to change the type, create a new monitor. Updating a Threshold, Trend, or Forecast monitor needs the preview for its type, as on create; without it the call returns 422.
On a Threshold monitor, warning_levels replaces the stored levels, follows the same rules as on create (whole numbers from 1 to 99, no repeats, at most five, above only), and [] clears them. null for warning_levels returns 422 on a Threshold monitor and changes nothing on other types; levels on any other type return 422. Changing threshold_trigger_value on a monitor with warning levels doesn't open a new incident; without warning levels, it does.
Returns 404 if the monitor does not exist or belongs to another organization. Returns 409 if the change would give the monitor the same detection_type and type settings, filter_set, group_by, threshold, and cost_type as another monitor; error.existing_id names that monitor. Paused monitors count as a match and deleted monitors don't. A change to only monitor_name, description, or is_enabled never returns 409. Also returns 409, without existing_id, if another save changed the monitor while this one was in progress; re-read the monitor and retry. This can happen only when the update changes threshold_trigger_value on a Threshold monitor with warning levels.
CloudZero records the change in the activity log, attributed to "Set via API", after saving it. If that log write fails, the update still applies.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The ID of the monitor

Body Params

Fields to change on a monitor. Fields left out keep their stored values. description accepts
null (to clear it). A detection field of a type other than the monitor's also accepts null, a no-op.
Every other field is either a value or left out.

enum

Threshold and Forecast monitors only: alert when spend goes above or below the trigger value. Forecast monitors support only above.

string
enum

The type of cost to monitor.

length ≤ 1000

Optional human-readable description for the monitor

enum

Threshold monitors only: the window whose total spend is compared to the trigger value.

filter_set
object

Cost filters for the monitor: each key is a dimension and its value the list of values to include. An empty object is valid and watches all spend. Keys may be Dimension IDs (for example CZ:Service or User:Defined:Owner) or partition keys (for example services or costcontext:<dimension name>). Prefix a key with ! to exclude its values, & for a case-insensitive partial match, or both. On create/update, a non-empty filter_set must match cost in the last 30 days (422 otherwise).

Forecast monitors only: the period whose projected total spend is compared to the trigger value.

0 to 100

Forecast monitors only: how far, in percent, the projection must fall back below the trigger value before an open incident counts as recovered.

group_by
array of strings
length ≤ 1

Dimensions to group by, as Dimension IDs or partition keys. Empty means no grouping; create/update requests are capped to a single dimension.

Group By
boolean

Whether the monitor is running. When false the monitor will not be sent for evaluation.

string
length between 1 and 255

Human-readable name for the monitor

threshold
object

Optional significance threshold: an anomaly is surfaced as an incident only if its cost impact
meets it. Leave both min_cost_impact and percentage unset to surface every anomaly.

0.01 to 1000000000000

Threshold and Forecast monitors only: the dollar amount spend is compared to. On a Threshold monitor it is the amount warning_levels are percentages of, and it always alerts at 100%.

enum

Trend monitors only: the spend compared. week_over_week and month_over_month compare the latest completed week (starting Monday) or month (by average daily spend) with the one before; rolling_30d measures the trend across the last 30 days.

0 to 1000000000000

Trend monitors only: the growth in spend, in percent, over trend_basis that raises an incident. 0 alerts on the dollar change alone and requires a threshold.min_cost_impact of at least 0.01. Otherwise at least 0.01.

array | null

Threshold monitors only, with comparison_operator above: whole percentages (1 to 99, at most 5, no repeats) of threshold_trigger_value at which to warn before the alert at 100%. Returned in ascending order; an empty list means no warnings. On update, an empty list clears them and null is a 422 on a Threshold monitor (ignored on other types).

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json