---
title: "PATCH /v2/views/{view_id}"
method: PATCH
path: "/v2/views/{view_id}"
tags: ["views"]
---

# PATCH /v2/views/{view_id}

`PATCH /v2/views/{view_id}`

Update a single View

## Path parameters

- `view_id` string, required

## Headers

- `cloudzero-idempotency-key` string
- `cloudzero-test-key` string

## Request body

- ViewUpdate
  - `name` string — View name
  - `filter` ViewFilter — Filter mapping of dimension name to allowed values
  - `connections` ViewConnections — Contains the connections that will receive notifications for this view
    - `email` ViewConnectionsEmail — Email Connection
      - `addresses` string[] — List of email addresses to notify
      - `include_all_organizers` boolean — Whether or not to additionally notifiy all organizers in the organization
    - `slack` ViewConnectionsSlack[]
      - `id` string, required
      - `name` string, required
  - `principal_dimension` string — primary group by dimension for the view
  - `anomalies` ViewAnomalies — Anomalies configuration for the view. These fields are used to configure the anomaly detection for the view. Anomalies are detected by comparing the cost of a given day to the cost of the previous day. If the cost of the current day is greater than or equal to the threshold, an anomaly event will be generated. The anomaly event will be sent to the configured connections for the view. The following fields are used to configure the anomaly detection:
    - `enabled` boolean — Specifies whether or not to enable anomaly detection for the view. `true` (Default): anomaly detection is enabled for the view `false`: anomaly detection is disabled for the view
    - `threshold_type` 'Automatic' | 'Percent' — Type of threshold to use when detecting anomalies within this view. This field, combined with the `threshold_amount` field sets the threshold for anomalies detected within this view. The threshold is used to determine if a day to day cost spike is considered an anomaly. The cost spike must be greater or equal to the threshold in order generate an anomaly event. The following values are currently supported: `Automatic`: the threshold will be automatically calculated using a sliding scale based on the view's cost `Percent`: the threshold will be a percentage of the view's cost
    - `threshold_amount` integer — Value of the threshold to apply to anomalies for the specified view. The value is interpreted based on the `threshold_type`: `Automatic`: threshold_amount is ignored when the threshold type is `Automatic` `Percent`: threshold_amount is the percentage of the view's cost to use as the threshold
    - `min_cost_impact` number, double — Minimum dollar threshold for anomaly detection. This optional field sets a floor value that works alongside the percentage-based threshold (automatic or manual). Anomalies must exceed BOTH the percentage-based threshold AND this minimum cost impact to trigger a notification. The effective threshold is calculated as: `GREATEST(percentage_threshold, min_cost_impact)` For example, if a view has an automatic threshold of $10 and min_cost_impact is set to $50, only anomalies that cost at least $50 will trigger notifications, even if they exceed the $10 percentage-based threshold. This helps suppress low-dollar anomalies that meet the percentage threshold but are too small to investigate.

## Response `200`

Successful Operation

- ViewCreateUpdateResponse
  - `view` object
    - `name` string, required — View name
    - `filter` ViewFilter, required — Filter mapping of dimension name to allowed values
    - `connections` ViewConnections, required — Contains the connections that will receive notifications for this view
      - `email` ViewConnectionsEmail — Email Connection
        - `addresses` string[] — List of email addresses to notify
        - `include_all_organizers` boolean — Whether or not to additionally notifiy all organizers in the organization
      - `slack` ViewConnectionsSlack[]
        - `id` string, required
        - `name` string, required
    - `principal_dimension` string, required — primary group by dimension for the view
    - `anomalies` ViewAnomalies — Anomalies configuration for the view. These fields are used to configure the anomaly detection for the view. Anomalies are detected by comparing the cost of a given day to the cost of the previous day. If the cost of the current day is greater than or equal to the threshold, an anomaly event will be generated. The anomaly event will be sent to the configured connections for the view. The following fields are used to configure the anomaly detection:
      - `enabled` boolean — Specifies whether or not to enable anomaly detection for the view. `true` (Default): anomaly detection is enabled for the view `false`: anomaly detection is disabled for the view
      - `threshold_type` 'Automatic' | 'Percent' — Type of threshold to use when detecting anomalies within this view. This field, combined with the `threshold_amount` field sets the threshold for anomalies detected within this view. The threshold is used to determine if a day to day cost spike is considered an anomaly. The cost spike must be greater or equal to the threshold in order generate an anomaly event. The following values are currently supported: `Automatic`: the threshold will be automatically calculated using a sliding scale based on the view's cost `Percent`: the threshold will be a percentage of the view's cost
      - `threshold_amount` integer — Value of the threshold to apply to anomalies for the specified view. The value is interpreted based on the `threshold_type`: `Automatic`: threshold_amount is ignored when the threshold type is `Automatic` `Percent`: threshold_amount is the percentage of the view's cost to use as the threshold
      - `min_cost_impact` number, double — Minimum dollar threshold for anomaly detection. This optional field sets a floor value that works alongside the percentage-based threshold (automatic or manual). Anomalies must exceed BOTH the percentage-based threshold AND this minimum cost impact to trigger a notification. The effective threshold is calculated as: `GREATEST(percentage_threshold, min_cost_impact)` For example, if a view has an automatic threshold of $10 and min_cost_impact is set to $50, only anomalies that cost at least $50 will trigger notifications, even if they exceed the $10 percentage-based threshold. This helps suppress low-dollar anomalies that meet the percentage threshold but are too small to investigate.
    - `id` string, required
    - `last_updated` string, required — String representation of an epoch (UTC timestamp)
    - `last_edited` string, required — ISO 8601 datetime string (e.g., 2023-10-26T14:27:46+00:00)

## Other responses

- `400` — Bad Request Error
- `403` — Forbidden

---

[API](https://skmtc.dev/cloudzero/apis/cloudzero-api-v2-resources.md) · [All operations](https://skmtc.dev/cloudzero/apis/cloudzero-api-v2-resources/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudzero/cloudzero-api-v2-resources/revisions/fd805a0e75e5/schema)
