---
title: "Update a billable metric"
method: PATCH
path: "/api/v1/metrics/{metric_id}"
tags: ["Metrics"]
---

# Update a billable metric

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

Partially update metric fields. Code and aggregation_type are immutable.

## Path parameters

- `metric_id` string, MeteroidId, required

## Request body

- UpdateMetricRequest
  - `description` string, nullable
  - `name` string, nullable
  - `segmentation_matrix` union
    - MetricDimension
      - `key` string, required
      - `values` string[], required
    - DoubleSegmentationMatrix
      - `dimension1` MetricDimension, required
        - `key` string, required
        - `values` string[], required
      - `dimension2` MetricDimension, required
        - `key` string, required
        - `values` string[], required
    - LinkedSegmentationMatrix
      - `dimension1_key` string, required
      - `dimension2_key` string, required
      - `values` object, required
  - `unit_conversion` UnitConversion
    - `factor` integer, required
    - `rounding` 'UP' | 'DOWN' | 'NEAREST' | 'NEAREST_HALF' | 'NEAREST_DECILE' | 'NONE', required

## Response `200`

Metric updated

- Metric
  - `aggregation_key` string, nullable
  - `aggregation_type` 'COUNT' | 'LATEST' | 'MAX' | 'MIN' | 'MEAN' | 'SUM' | 'COUNT_DISTINCT', required
  - `archived_at` string, date-time, nullable
  - `code` string, required
  - `created_at` string, date-time, required
  - `description` string, nullable
  - `id` string, MeteroidId, required
  - `name` string, required
  - `product_family_id` string, MeteroidId, required
  - `product_id` string, MeteroidId
  - `segmentation_matrix` union
    - MetricDimension
      - `key` string, required
      - `values` string[], required
    - DoubleSegmentationMatrix
      - `dimension1` MetricDimension, required
        - `key` string, required
        - `values` string[], required
      - `dimension2` MetricDimension, required
        - `key` string, required
        - `values` string[], required
    - LinkedSegmentationMatrix
      - `dimension1_key` string, required
      - `dimension2_key` string, required
      - `values` object, required
  - `unit_conversion` UnitConversion
    - `factor` integer, required
    - `rounding` 'UP' | 'DOWN' | 'NEAREST' | 'NEAREST_HALF' | 'NEAREST_DECILE' | 'NONE', required
  - `usage_group_key` string, nullable

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Metric not found
- `429` — Too many requests

## Changes

- **2026-03-31** (v1) `ee465c53a423` — 2 breaking, 6 info
  - removed `subschema #2, subschema #3` from the `segmentation_matrix/oneOf[#/components/schemas/MetricSegmentationMatrix]/` request property `oneOf` list
  - added `#/components/schemas/DoubleSegmentationMatrix, #/components/schemas/LinkedSegmentationMatrix` to the `segmentation_matrix/oneOf[#/components/schemas/MetricSegmentationMatrix]/` response property `oneOf` list for the response status `200`
  - added `DOUBLE, LINKED` discriminator mapping keys to the `segmentation_matrix/oneOf[#/components/schemas/MetricSegmentationMatrix]/` request property
  - request discriminator property name changed for `segmentation_matrix/oneOf[#/components/schemas/MetricSegmentationMatrix]/` request property from `discriminator` to `type`
  - …4 more
- **2026-03-27** (v1) `de35c02bb0d2` — 3 warning, 1 info
  - added the new `TOO_MANY_REQUESTS` enum value to the `code` response property for the response status `400`
  - added the new `TOO_MANY_REQUESTS` enum value to the `code` response property for the response status `401`
  - added the new `TOO_MANY_REQUESTS` enum value to the `code` response property for the response status `404`
  - added the non-success response with the status `429`
- **2026-03-20** (v1) `51c7018cc5ef` — 1 info
  - endpoint added
- **2025-07-09** (v1) `dece17f86f99` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/meteroid-oss/apis/meteroid/changes/api/v1/metrics/:metric_id/patch.md)

---

[API](https://skmtc.dev/meteroid-oss/apis/meteroid.md) · [All operations](https://skmtc.dev/meteroid-oss/apis/meteroid/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/meteroid-oss/meteroid/revisions/03f9d8ae5c5e/schema)
