---
title: "List monitors for target"
method: POST
path: "/v1/projects/{projectSlug}/monitors/for-target"
tags: ["Monitors"]
---

# List monitors for target

`POST /v1/projects/{projectSlug}/monitors/for-target`

Returns live monitors matching the supplied target type and/or filter subset.

## Path parameters

- `projectSlug` string, required — Project slug (human-readable identifier)

## Request body

- ListMonitorsForTargetBody
  - `targetType` 'savedSearch' | 'tool' | 'user' | 'session' — Optional target type to match.
  - `filterSetContains` object, required — Filter subset to match against monitor targets. For one user use `userId`; for one tool use `operation = execute_tool` and `toolName`.

## Response `200`

Matching monitors

- MonitorList
  - `items` Monitor[], required — Matching monitors.
    - `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.
              - …
            - `threshold` union, required — How the metric is compared.
              - …
            - `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.
              - …
            - `threshold` union
              - …
            - `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.
              - …
      - `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
- `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)
