---
title: "Update Metric"
method: PATCH
path: "/api/v1/metrics/{metric_id}"
tags: ["metrics"]
---

# Update Metric

`PATCH /api/v1/metrics/{metric_id}`

## Request

- Base URL: `https://api.cohearence.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.cohearence.app/api/v1/metrics/{metric_id}`
- Auth: HTTP bearer

Partial update of a metric.

Accepts any subset of: name, unit, description, ordinal_map, value_min,
value_max, missing_policy, tracking_cadence, category_id, pinned, derived.

``kind`` is immutable: a source metric can't become calculated (or vice
versa) — delete and recreate instead. ``derived`` (calculated metrics only)
is a FULL replacement of the formula: fn + expr + inputs. The cycle check
walks the proposed inputs' closure and rejects a spec that reaches this
metric. ``data_type`` is likewise immutable — sending a different value is
a 400 (calculated metrics re-infer it when their formula changes). ``tracking_cadence`` is likewise rejected for calculated
metrics — they're never logged, so a reminder cadence is a meaningless state.

## Path parameters

- `metric_id` integer, required

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/cohearence/apis/health-agent-api.md) · [All operations](https://skmtc.dev/cohearence/apis/health-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cohearence/apis/health-agent-api/revisions/c7aee7d6ecf0?raw)
