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

# Preview

`POST /api/v1/alerts/preview`

## Request

- Base URL: `https://api.myaltimate.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.myaltimate.com/api/v1/alerts/preview`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

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

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-08-12** `a71fce1f5c26`: 1 info
  - added the new optional request property `metric_config/team_id`

[Operation history](https://skmtc.dev/myaltimate/apis/myaltimate-api/changes/api/v1/alerts/preview/post.md)

---

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