---
title: "Update monitor"
method: PATCH
path: "/v1/projects/{projectSlug}/monitors/{monitorSlug}"
tags: ["Monitors"]
---

# Update monitor

`PATCH /v1/projects/{projectSlug}/monitors/{monitorSlug}`

Updates a monitor's metadata and incident severity. Target, trigger, metric, and conditions are fixed after creation. System monitor edits are restricted.

## Path parameters

- `projectSlug` string, required — Project slug (human-readable identifier)
- `monitorSlug` string, required — Monitor slug (human-readable identifier within the project).

## Request body

- UpdateMonitorBody
  - `name` string — New name. Renaming may regenerate the slug — re-read the response or rely on `id`.
  - `description` string — New description.
  - `severity` 'low' | 'medium' | 'high' — Replacement incident severity.

## Response `200`

Updated monitor

- Monitor
  - `id` string, required — Stable monitor identifier.
  - `organizationId` string, required — Organization that owns this monitor.
  - `projectId` string, required — Project this monitor belongs to.
  - `slug` string, required — URL-safe slug derived from `name`. Unique within the project.
  - `name` string, required — Human-readable name.
  - `description` string, required — Free-form description. Empty string when not set.
  - `system` boolean, required — `true` for auto-provisioned system monitors, which cannot be deleted or edited; `false` otherwise.
  - `target` MonitorTarget, required — Entity or filter set watched by this monitor.
    - `type` 'savedSearch' | 'tool' | 'user' | 'session', required — Product target category: `savedSearch`, `tool`, `user`, or `session`.
    - `id` string, nullable, required — Target entity id, or `null` for project-wide targets.
    - `filterSet` MonitorFilterSet — Additional filters applied when evaluating the monitor.
    - `query` string, nullable — Semantic query applied when evaluating inline trace targets.
    - `kind` 'savedSearch' | 'tool' | 'user' | 'session' — Normalized target kind returned on persisted monitors.
    - `stream` 'traces' | 'spans' | 'sessions' — Telemetry stream evaluated by the monitor.
    - `savedSearchId` string, nullable — Saved-search id for saved-search monitors, or `null` for inline targets.
    - `metric` union
      - object — Default metric evaluated for this target.
        - `kind` 'count', required — Count matching events in each evaluation bucket.
      - object — Default metric evaluated for this target.
        - `kind` 'errorRate', required — Measure the fraction of matching events that errored.
      - object — Default metric evaluated for this target.
        - `kind` 'cacheHitRate', required — Token-weighted prompt-cache hit rate (cache-read tokens over total input-side tokens), a 0..1 fraction.
      - object — Default metric evaluated for this target.
        - `kind` 'avg', required — Average a numeric field over matching events.
        - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
      - object — Default metric evaluated for this target.
        - `kind` 'sum', required — Sum a numeric field over matching events.
        - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
      - object — Default metric evaluated for this target.
        - `kind` 'min', required — Find the minimum numeric field value over matching events.
        - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
      - object — Default metric evaluated for this target.
        - `kind` 'max', required — Find the maximum numeric field value over matching events.
        - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
      - object — Default metric evaluated for this target.
        - `kind` 'median', required — Find the median numeric field value over matching events.
        - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
  - `rule` MonitorRule, required — Single rule evaluated by this monitor.
    - `trigger` 'match' | 'threshold' | 'escalating', required — When the monitor opens incidents: `match`, `threshold`, or `escalating`.
    - `config` MonitorConfig, required — Rule configuration used when the monitor is evaluated.
      - `filterSet` object — Filters applied by the monitor rule.
      - `query` string, nullable — Semantic query applied by inline monitor targets.
      - `metric` union
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'count', required — Count matching events in each evaluation bucket.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'errorRate', required — Measure the fraction of matching events that errored.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'cacheHitRate', required — Token-weighted prompt-cache hit rate (cache-read tokens over total input-side tokens), a 0..1 fraction.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'avg', required — Average a numeric field over matching events.
          - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'sum', required — Sum a numeric field over matching events.
          - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'min', required — Find the minimum numeric field value over matching events.
          - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'max', required — Find the maximum numeric field value over matching events.
          - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
        - object — Metric evaluated by threshold and escalating monitor rules.
          - `kind` 'median', required — Find the median numeric field value over matching events.
          - `field` 'duration' | 'cost' | 'tokens', required — Numeric field to aggregate.
      - `condition` union — Condition that controls threshold or escalating incidents.
        - AlertThresholdCondition
          - `trigger` 'threshold', required — Opens once the measured value crosses the threshold.
          - `metric` union, required — Metric measured over the monitor target.
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `threshold` union, required — How the metric is compared.
            - object
              - …
            - object
              - …
            - object
              - …
          - `direction` 'above' | 'below' — Direction that opens the incident. Defaults to `above` when omitted.
        - AlertEscalatingCondition
          - `trigger` 'escalating', required — Opens when the monitor target is escalating or sustained.
          - `metric` union, required — Metric measured over the monitor target.
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
          - `threshold` union
            - object — How the metric is compared when threshold-based.
              - …
            - object — How the metric is compared when threshold-based.
              - …
            - object — How the metric is compared when threshold-based.
              - …
          - `direction` 'above' | 'below' — Direction that opens the incident. Defaults to `above` when omitted.
          - `sensitivity` integer — Detector sensitivity from 1 (noisiest) to 6 (strictest). Defaults to 3 when omitted.
          - `window` object, required — Sustained-condition window.
            - `minutes` integer, required — How long the threshold must stay crossed before the incident opens. Minimum 5.
    - `severity` 'low' | 'medium' | 'high', required — Severity of incidents this monitor opens: `low`, `medium`, or `high`.
  - `mutedAt` string, nullable, required — ISO-8601 timestamp at which the monitor was muted, or `null` when active.
  - `deletedAt` string, nullable, required — ISO-8601 timestamp at which the monitor was deleted, or `null`.
  - `createdAt` string, required — ISO-8601 timestamp of creation.
  - `updatedAt` string, required — ISO-8601 timestamp of the last update.

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `403` — System monitors cannot be edited
- `404` — Not found

---

[API](https://skmtc.net/latitude-dev/apis/latitude.md) · [All operations](https://skmtc.net/latitude-dev/apis/latitude/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/latitude-dev/latitude/versions/6a8789c59a5c/schema)
