---
title: "List metric conditions"
method: GET
path: "/metric-conditions"
tags: ["Metric conditions"]
---

# List metric conditions

`GET /metric-conditions`

## Request

- Base URL: `https://api.spectate.net/v1`
- URL: `https://api.spectate.net/v1/metric-conditions`
- Auth: HTTP bearer

Returns the team's metric conditions, oldest first.

## Query parameters

- `filter[host_id]` string, uuid
- `filter[project_id]` string, uuid
- `page` integer
- `per_page` integer

## Response `200`

Paginated set of `MetricCondition`

- object
  - `current_page` integer, required
  - `data` MetricCondition[], required
    - `id` string, uuid, required: Metric condition ID
    - `metric` 'cpu_usage' | 'system.cpu.user' | 'system.cpu.system' | 'system.cpu.iowait' | 'system.cpu.stolen' | 'system.cpu.idle' | 'system.cpu.guest' | 'system.cpu.interrupt' | 'memory_usage' | 'system.memory.total' | 'system.memory.used' | 'system.memory.free' | 'system.memory.available' | 'system.memory.available_percent' | 'system.swap.total' | 'system.swap.used' | 'system.swap.free' | 'system.swap.free_percent' | 'system.swap.in' | 'system.swap.out' | 'disk_usage' | 'system.disk_usage.total' | 'system.disk_usage.used' | 'system.disk_usage.free' | 'system.disk_usage.inodes_total' | 'system.disk_usage.inodes_used' | 'system.disk_usage.inodes_free' | 'system.disk_usage.inodes_used_percent' | 'load_average' | 'system.load.1' | 'system.load.5' | 'system.load.15' | 'network_in' | 'network_out' | 'system.net.packets_recv' | 'system.net.packets_sent' | 'system.net.err_in' | 'system.net.err_out' | 'system.net.drop_in' | 'system.net.drop_out' | 'system.net.fifo_in' | 'system.net.fifo_out' | 'system.uptime' | 'system.io.busy_percent' | 'system.io.await_ms' | 'system.pressure.cpu.some' | 'system.pressure.memory.some' | 'system.pressure.io.some' | 'system.net.tcp.established' | 'system.net.tcp.time_wait' | 'system.files.used_percent', required: A host metric the agent reports. `cpu_usage`, `memory_usage`, `disk_usage`, `load_average`, `network_in` and `network_out` are the summaries the dashboard charts; the `system.*` metrics are the agent's raw values.
    - `condition` MetricCondition, required (recursive)
    - `threshold` number, required: Compared with the metric's value as the agent reports it, in the unit the host's charts show (percent for `cpu_usage`, `memory_usage` and `disk_usage`)
    - `duration_minutes` integer, required: Minutes the condition must hold before the alert fires; 0 fires on the first breach
    - `severity` 'critical' | 'high' | 'medium' | 'low', required: How urgent an alert or incident is. Escalation paths can branch on it. | | |---| | `critical` <br/> Customers are affected right now. | | `high` <br/> Serious, needs attention soon. | | `medium` <br/> Should be looked at. | | `low` <br/> Informational. |
    - `hosts` HostReference[], required: Hosts it applies to
      - `id` string, uuid, required: Host ID
      - `label` string, nullable, required: Host name shown in the dashboard; `null` until set or reported
    - `projects` ProjectReference[], required: Projects whose hosts it applies to
      - `id` string, uuid, required: Project ID
      - `name` string, required: Project name
  - `first_page_url` string, nullable, required
  - `from` integer, nullable, required
  - `last_page_url` string, nullable, required
  - `last_page` integer, required
  - `links` object[], required: Generated paginator links.
    - `url` string, nullable, required
    - `label` string, required
    - `active` boolean, required
  - `next_page_url` string, nullable, required
  - `path` string, nullable, required: Base path for paginator generated URLs.
  - `per_page` integer, required: Number of items shown per page.
  - `prev_page_url` string, nullable, required
  - `to` integer, nullable, required: Number of the last item in the slice.
  - `total` integer, required: Total number of items being paginated.

## Other responses

- `401`: `UNAUTHENTICATED`: no token was sent. `INVALID_TOKEN`: the token is unknown or revoked. `TOKEN_EXPIRED`: the token has expired.
- `403`: `FORBIDDEN`: the token lacks an ability this endpoint requires (listed in `details.required_abilities`). `TEAM_PENDING_DELETION`: the team is scheduled for deletion. `TEAM_SUSPENDED`: Spectate suspended the team.
- `429`: `RATE_LIMITED`: too many requests for this token. Wait for the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spectate/apis/spectate-api.md) - [All operations](https://skmtc.dev/spectate/apis/spectate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spectate/apis/spectate-api/revisions/9b1a233997de?raw)
