---
title: "Update a cluster monitor"
method: PATCH
path: "/v1/clusters/{clusterId}/monitors/{alertId}"
tags: ["Clusters"]
---

# Update a cluster monitor

`PATCH /v1/clusters/{clusterId}/monitors/{alertId}`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/clusters/{clusterId}/monitors/{alertId}`
- Auth: HTTP bearer

Updates the rule, destination, or status and reprovisions the monitor. Requires `monitors:write` and organization admin privileges.

## Path parameters

- `clusterId` string, required
- `alertId` string, uuid, required

## Headers

- `X-Org-Name` string

## Request body

- object
  - `name` string
  - `description` string, nullable
  - `status` 'active' | 'disabled'
  - `templateId` 'cluster_cpu' | 'cluster_memory' | 'cluster_availability'
  - `spec` ClusterMonitorSpec
    - `op` 'GT' | 'GEQ' | 'LT' | 'LEQ' | 'EQ' | 'NEQ', required
    - `threshold` number, required
    - `window` '1m' | '5m' | '15m' | '30m' | '1h'
    - `sustainSecs` integer
    - `severity` 'warn' | 'critical'
    - `dataset` string
    - `column` string
    - `value` union
      - string
      - number
    - `datasets` string[]
    - `conditions` object[]
      - `dataset` string, required
      - `column` string, required
      - `op` 'EQ' | 'NEQ' | 'GT' | 'GEQ' | 'LT' | 'LEQ' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'IS_NULL' | 'IS_NOT_NULL', required
      - `value` union
        - string
        - number
    - `queryLanguage` 'cypher' | 'gql'
    - `returnFields` object[]: Dataset fields returned by generated row-match queries. Include identity and all monitored fields.
      - `dataset` string, required
      - `columns` string[], required
    - `query` string
    - `includeDetails` boolean
  - `target` union: A notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
    - EmailSinkInput
      - `type` 'email', required
      - `recipientUserIds` integer[]: Organization members to email, by user ID.
      - `emails` string[]
    - HttpSinkInput
      - `type` 'http', required
      - `url` string, uri, required: The URL each notification is sent to, using `method`. Must be https and must resolve to a public address.
      - `method` 'POST' | 'PUT' | 'PATCH': A create that omits it uses POST. An update that omits it keeps the stored method.
      - `token` string: Bearer token sent with each delivery. Stored encrypted and never returned.
    - SlackSinkInput
      - `type` 'slack', required
      - `channelId` string, required: Slack conversation id. The organization must already have Slack connected.
      - `channelName` string
  - `targets` ClusterMonitorTarget[]: Full destination set. When present, replaces the stored sinks. Omit to keep them.
    - union: A notification sink in a create or update request. Cluster monitors, project monitors and data reactions accept the same shape.
      - EmailSinkInput
        - `type` 'email', required
        - `recipientUserIds` integer[]: Organization members to email, by user ID.
        - `emails` string[]
      - HttpSinkInput
        - `type` 'http', required
        - `url` string, uri, required: The URL each notification is sent to, using `method`. Must be https and must resolve to a public address.
        - `method` 'POST' | 'PUT' | 'PATCH': A create that omits it uses POST. An update that omits it keeps the stored method.
        - `token` string: Bearer token sent with each delivery. Stored encrypted and never returned.
      - SlackSinkInput
        - `type` 'slack', required
        - `channelId` string, required: Slack conversation id. The organization must already have Slack connected.
        - `channelName` string
  - `recipientUserIds` integer[]

## Response `200`

Monitor updated

## Other responses

- `400`: Invalid request or monitor ID
- `401`: Unauthorized
- `403`: Insufficient scope or role
- `404`: Cluster or monitor not found
- `409`: Duplicate monitor name or monitor changed during update
- `413`: Request body too large
- `422`: Destination is unavailable
- `500`: Internal server error
- `502`: Monitor backend update failed; the saved rule may be pending and the request can be retried

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
