> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Metric Versions

> Snapshot, list, and deploy versions of a metric's definition so changes can be reviewed and rolled back without losing history.

## Schema introspection

Every command below with arguments supports two read-only flags for tooling and AI agents:

* `--show-file-schema`: print the JSON Schema for the full request object (the format `--filename` accepts).
* `--show-argument-schema <flag-name>`: print the JSON Schema for one argument's value. Pass the kebab flag name **without** the leading `--` (e.g. `metric-id`, not `--metric-id`).

Both write pure JSON to stdout and never call the API. They cannot be combined with any other command-specific flag.

## `list`

List versions for a metric

Retrieve all snapshot versions of the metric's definition, ordered oldest-first. Returns the full version history unpaginated.

### Usage

```sh theme={null}
honeyhive metric-versions list [options]
```

**Accepted keys:** [Project API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

### Options

| Flag | Type | Required | Description |
| - | - | - | - |
| `--metric-id` | string | yes | The unique identifier of the metric whose versions are being listed |

Also supports `--show-file-schema`, `--show-argument-schema <flag-name>`, and `--filename`. See [Schema introspection](#schema-introspection) for details.

## `create`

Create a new metric version

Snapshot the supplied metric definition as a new version. By default the version is created as a draft (`deployed: false`); set `deploy_immediately: true` to also make it the live version in the same transaction.

### Usage

```sh theme={null}
honeyhive metric-versions create [options]
```

**Accepted keys:** [Project API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

### Options

| Flag | Type | Required | Description |
| - | - | - | - |
| `--content` | json | yes | Metric definition snapshot accepted by POST /v1/metrics/{metric_id}/versions. Five fields are optional and fall back to server-side defaults when omitted: - `description` → `""` - `return_type` → `"float"` - `enabled_in_prod` → `true` for HUMAN metrics, `false` otherwise - `sampling_percentage` → `10` - `filters` → `{ "filterArray": [] }` |
| `--message` | string | yes | message |
| `--metric-id` | string | yes | The unique identifier of the metric to version |
| `--deploy-immediately` / `--no-deploy-immediately` | boolean | no | deploy\_immediately |

Also supports `--show-file-schema`, `--show-argument-schema <flag-name>`, and `--filename`. See [Schema introspection](#schema-introspection) for details.

## `deploy`

Deploy a specific metric version

Mark the named version as the live version for the metric, unmarking any previously deployed version.

### Usage

```sh theme={null}
honeyhive metric-versions deploy [options]
```

**Accepted keys:** [Project API key](https://docs.honeyhive.ai/v2/workspace/api-keys.md#key-types)

### Options

| Flag | Type | Required | Description |
| - | - | - | - |
| `--metric-id` | string | yes | The unique identifier of the metric |
| `--version-name` | string | yes | The name of the version to deploy |

Also supports `--show-file-schema`, `--show-argument-schema <flag-name>`, and `--filename`. See [Schema introspection](#schema-introspection) for details.


## Related topics

- [Metric Versions Methods](https://docs.honeyhive.ai/v2/sdk-reference/typescript/ref/metric-versions/index.md)
- [List versions for a metric](https://docs.honeyhive.ai/v2/api-reference-autogen/metric-versions/list-versions-for-a-metric.md)
- [Deploy a specific metric version](https://docs.honeyhive.ai/v2/api-reference-autogen/metric-versions/deploy-a-specific-metric-version.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.