---
title: "Get Metric Definition"
method: GET
path: "/api/v1/metrics/{source}/{ref}"
tags: ["metrics"]
---

# Get Metric Definition

`GET /api/v1/metrics/{source}/{ref}`

Return the semantic definition of one metric — contract facts + prose (PR 32).

## Path parameters

- `source` string, required
- `ref` string, required

## Response `200`

Successful Response

- MetricDefinition — GET /metrics/{source}/{ref} -- the semantic definition of one metric (PR 32). Contract facts are generated from the PR-10 execution contract; the product shows the semantic definition, never raw SQL.
  - `source_kind` 'standard' | 'platform_calculation' | 'evaluated' | 'calculated', required
  - `ref` string, required
  - `label` string, required
  - `calculation_kind` string, nullable
  - `entity` string, nullable
  - `unit` UnitSpecOutput — A unit as a ``dimension → exponent`` vector plus an optional currency code. ``currency_code`` is meaningful only when a ``currency`` dimension is present. Two DIFFERENT codes are incompatible, and ``currency_code=None`` (unknown / resolved per query scope) is incompatible with EVERY coded currency — the mechanism that blocks summing an unknown-currency value into a known one (PR 14 leans on it).
    - `dimensions` object
    - `currency_code` string, nullable
    - `display_label` string, required — ``to_display_label()``, serialized (Agent-Native PR 12). Every surface that shows a raw value needs to say what unit it is IN — the audit panel prints an exact ``12,150`` directly beneath a formatted ``3.4 h``, and unlabelled that reads as hours and is wrong by a factor of 3,600. The renderer already exists here; exposing it means the client, the agent tools and the disclosures all say ``conversations · seconds`` rather than each inventing a name for the same vector from raw dimension keys.
  - `format` string, nullable
  - `time_dimension` string, nullable
  - `aggregation_behavior` string, nullable
  - `polarity` 'higher_is_better' | 'lower_is_better' | 'neutral', nullable
  - `grouping_behavior` string, nullable
  - `grouping` MetricGroupingDimension[]
    - `dimension` string, required
    - `contract` string, required
  - `drill_kind` string, nullable
  - `contribution_identifier` string, nullable
  - `source_entity` string, nullable
  - `scope_rules` string[]
  - `components` MetricComponentRef[]
    - `ref` string, required
    - `category` string, required
    - `role` string, required
    - `label` string, nullable
  - `display_expression` string, nullable
  - `expression` object, nullable
  - `disclosures` string[]
  - `zero_division` string, nullable
  - `status` string
  - `version` integer, nullable
  - `superseded_by` string, nullable
  - `explanatory` MetricExplanatory, required — Hand-authored prose (invariant 9) — NEVER an executable audit fact. Kept in its own block so the drawer renders business copy visually distinct from the machine-checkable contract facts; nothing here is ever read by the engine.
    - `description` string, required
    - `grain` string, nullable
    - `excluded_population` string, nullable
  - `used_in` MetricUsageRef[]
    - `widget_id` string, required
    - `dashboard_id` string, required
    - `widget_title` string, nullable
  - `change_history` MetricDefinitionChange[]
    - `version` integer, required
    - `date` string, nullable
    - `summary` string, required

## Other responses

- `401` — Tenant not identified
- `403` — Caller may not query this metric
- `404` — Unknown source or metric
- `422` — Validation Error

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/c0f54348e251/schema)
