---
title: "Metrics Dry Run"
method: POST
path: "/api/v1/sdk/metrics/dry-run"
tags: ["public-api", "public-metrics"]
---

# Metrics Dry Run

`POST /api/v1/sdk/metrics/dry-run`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/sdk/metrics/dry-run`
- Auth: none declared

Dry-run a metric threshold against historical snapshots.

Tests how often a proposed threshold would have triggered alerts based on
historical metric values.

**SDK Usage:**
```python
from anomalyarmor import Client
client = Client()
result = client.metrics.dry_run(
    asset_id="asset-uuid",
    metric_id="metric-uuid",
    threshold_type="upper",
    threshold_value=1000,
    lookback_days=7,
)
print(f"Alert rate: {result.alert_rate_percent}%")
print(f"Recommendation: {result.recommendation}")
```

## Headers

- `Authorization` string

## Request body

- MetricsDryRunRequest: Request to dry-run metric threshold alert.
  - `asset_id` string, required: Asset UUID or qualified name
  - `metric_id` string, required: Metric UUID to test
  - `threshold_type` string, required: Type of threshold: 'upper', 'lower', 'deviation'
  - `threshold_value` number, required: Threshold value to test (absolute or percent deviation)
  - `lookback_days` integer: Days of history to analyze

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
