---
title: "Preview"
method: POST
path: "/api/v1/alerts/preview"
tags: ["ALERTS_V1"]
---

# Preview

`POST /api/v1/alerts/preview`

Preview what a metric config would produce (chart + markdown).

## Request body

- PreviewRequest
  - `metric_config` MetricConfig, required — 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
  - `rule_type` string, nullable — 'alert' or 'report' — reports may show resource-wise splits

## Response `200`

Successful Response

- unknown

## 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/versions/aab3fe5c9f05/schema)
