---
title: "List Rules"
method: GET
path: "/api/v1/alerts/rules"
tags: ["ALERTS_V1"]
---

# List Rules

`GET /api/v1/alerts/rules`

Paginated list of alert/report rules.

## Query parameters

- `rule_type` string, nullable — 'alert' or 'report'
- `platform` string, nullable — 'snowflake' or 'databricks'
- `status` string, nullable
- `category` string, nullable
- `source` string, nullable — 'metric' or 'playground_report'
- `search` string, nullable
- `page` integer — Page number
- `size` integer — Page size

## Response `200`

Successful Response

- PageRuleResponse
  - `items` RuleResponse[], required
    - `id` integer, required
    - `name` string, required
    - `description` string, nullable
    - `rule_type` string, required
    - `source` string
    - `platform` string, nullable
    - `category` string, nullable
    - `entity_type` string, nullable
    - `metric_config` MetricConfig — Typed representation of the metric_config JSON stored in alert rules.
      - `metric_name` string, required — Metric identifier, e.g. 'warehouse_daily_cost'
      - `params` MetricParams — Evaluation parameters within a metric config.
        - `comparison_type` string — 'absolute_value' or 'relative_value'
        - `threshold_type` string — 'exceeds', 'below', 'changes_by', or 'changes_by_percent'
        - `threshold_value` number — Threshold to compare against
        - `aggregation` string — 'sum', 'mean', 'max', or 'min'
        - `date_range` string — 'previous_day', 'previous_week', 'previous_month', or 'previous_year'
        - `is_percentage` boolean, nullable — Derived from threshold_type; included by templates
      - `filters` MetricFilter[]
        - `key` string, required — Filter dimension name, e.g. 'warehouse'
        - `value` string[] — Filter values, e.g. ['WH1', 'WH2'], ['all'], or ['ANY']
        - `order` integer — Display order of this filter
      - `category` string, nullable — Entity type echo; included by templates
      - `team_id` integer, nullable — RBAC team (user_group) whose resources this rule is scoped to. Stamped from the x-user-group-id header at create/update; used at fire time to scope evaluation. None = unscoped.
    - `session_id` string, nullable
    - `content_scope` string, nullable
    - `delivery` object, nullable
    - `alert_message` string, nullable
    - `status` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `created_by` integer, required
    - `last_run` RunResponse
      - `id` integer, required
      - `rule_id` integer, required
      - `status` string, required
      - `result` object, nullable
      - `error` object, nullable
      - `message` string, nullable
      - `executed_at` string, date-time, nullable
      - `created_at` string, date-time, required
      - `destinations` object, nullable, required — Recipients this run was delivered to, snapshotted at run time (lifted from ``result.destinations``) so the run-history "Destination" column doesn't have to reach into the result blob. Computed (not an input field) so it's never read off the ORM row, which has no such column. Playground reports write ``{"emails": [...], "slack_webhook_id": ...}``; metric rules leave it unset (None).
    - `recent_runs` RecentRunResponse[]
      - `id` integer, required
      - `status` string, required
      - `executed_at` string, date-time, nullable
      - `message` string, nullable
    - `summary` string, nullable
  - `total` integer, nullable, required
  - `page` integer, nullable, required
  - `size` integer, nullable, required
  - `pages` integer, nullable

## Other responses

- `422` — Validation Error

---

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