---
title: "Update a meter"
method: PATCH
path: "/v1/meters/{id}"
tags: ["Meters"]
---

# Update a meter

`PATCH /v1/meters/{id}`

## Request

- Base URL: `https://api.creem.io`
- URL: `https://api.creem.io/v1/meters/{id}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/creem/apis/creem-api/docs/v1/meters/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Rename a meter and/or revise its definition. A rename is always allowed — the name is a label no aggregate depends on — but it must stay unique within the store (409 meter_name_taken). Definition changes (filter, aggregation, aggregation_property) are only accepted while the meter has processed no usage and has no associated purchase; otherwise the request is rejected with 409, because editing the definition would silently rewrite what already-recorded usage means. Send aggregation_property as null to clear it; omit it to leave it unchanged.

## Path parameters

- `id` string, required

## Request body

- UpdateMeterApiRequestDto
  - `name` string: New meter name. Renaming is allowed even after the meter has processed usage — the name is a label, not part of the definition. Must stay unique within the store. Omit to leave unchanged; `null` is rejected.
  - `aggregation` 'count' | 'sum' | 'average' | 'min' | 'max' | 'unique': New aggregation. Part of the meter definition, so it is only editable while the meter has processed no usage and has no associated purchase. Omit to leave unchanged; `null` is rejected.
  - `aggregation_property` string, nullable: New aggregation property. Omit to leave unchanged; send `null` to clear it (only valid when the resulting aggregation is "count").
  - `filter` MeterFilterApiRequestDto
    - `conjunction` 'and' | 'or', required: How the clauses combine
    - `clauses` FilterClauseApiRequestDto[], required: Filter clauses. An empty list means the meter counts every event with the given event name.
      - `property` string, required: Event property to test — a key of the event's `properties` bag, unprefixed.
      - `operator` 'equals' | 'not_equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'not_contains', required: Comparison operator
      - `value` union, required: Value to compare against. Auto-parsed (number → boolean → string) on both sides before comparison, so "10" and 10 behave the same — which is why a raw number or boolean is accepted here as well as a string.
        - string
        - number
        - boolean

## Response `200`

Meter updated

- MeterApiResponseDto
  - `id` string, required: Meter ID
  - `store_id` string, required: Store ID
  - `name` string, required: Meter name
  - `event_name` string, required: Usage event name the meter consumes
  - `aggregation` 'count' | 'sum' | 'average' | 'min' | 'max' | 'unique', required: Aggregation applied to matching events
  - `aggregation_property` string, nullable, required: Property the aggregation reduces; null for "count"
  - `filter` MeterFilterApiResponseDto, required
    - `conjunction` 'and' | 'or', required: How the clauses combine
    - `clauses` FilterClauseApiResponseDto[], required: Filter clauses; empty means the meter counts every event
      - `property` string, required: Event property tested
      - `operator` string, required: Comparison operator
      - `value` union, required: Value compared against, as stored after parsing
        - string
        - number
        - boolean
  - `unit_label` string, required: Display unit
  - `status` 'active' | 'archived', required: Whether the meter is active or archived
  - `created_at` string, required: Creation timestamp (ISO 8601)
  - `updated_at` string, required: Last update timestamp (ISO 8601)

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Invalid or missing API key
- `404`: Not Found - Resource does not exist
- `409`: The name is already taken, or the definition can no longer be edited
- `422`: The revised definition is not satisfiable

## Changes

- **2026-09-15** `071301350724`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/creem/apis/creem-api/changes/v1/meters/:id/patch.md)

---

[API](https://skmtc.dev/creem/apis/creem-api.md) - [All operations](https://skmtc.dev/creem/apis/creem-api/llms.txt) - [OpenAPI document](https://skmtc.dev/creem/apis/creem-api/revisions/3f39a8f266c3?raw)
