---
title: "Create Metric"
method: POST
path: "/api/v1/metrics"
tags: ["metrics"]
---

# Create Metric

`POST /api/v1/metrics`

## 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`
- Auth: HTTP bearer

Create a metric.

With a ``derived`` block ``{fn, expr?, inputs: [{metric_id, agg?, missing?}]}``
the metric is a calculated one: it holds no measurements, its ``data_type``
is inferred from the combiner, and its inputs are stored as
``metric_inputs`` edges. Without it, a plain source metric.

## Request body

- object

## Response `201`

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)
