---
title: "Update an usage meter"
method: PATCH
path: "/usage_meters/{usage_meter_id}"
tags: ["Usage Meters"]
---

# Update an usage meter

`PATCH /usage_meters/{usage_meter_id}`

This API lets you update an existing usage meter.

## Path parameters

- `usage_meter_id` string, required

## Request body

- UpdateUsageMeterRequest — Request to update usage meter
  - `name` string — Name of usage meter.
  - `billableName` string — Billable name of usage meter. Billable name takes precedence over name to display in invoice.
  - `description` string — Description of the usage meter
  - `eventSchemaName` string — Event Schema Identifier
  - `type` 'COUNTER' — Type of usage meter * COUNTER - Count usage
  - `aggregation` 'COUNT' | 'SUM' — Aggregation to be applied on usage meter result * COUNT - Counts number of events matching the usage meter * SUM - Sums up results of computation of all events matching usage meter
  - `computations` Computation[]
    - `id` string — Optional identifier describing the matcher and computation pair
    - `matcher` string — Condition to be applied on event. Upon matching it the corresponding computation will be considered for usage_meter unit calculation. The result of the matcher needs to be [truthy](https://jsonlogic.com/truthy.html) in order to be considered as a match.
    - `computation` string, required — Computation to be applied on an event if it matches the matcher. In case of a COUNT aggregation type, computation should be passed as '1'
    - `order` integer, required — The order in which multiple matched computations will get evaluated
  - `filters` UsageMeterFilterEntry[]
    - `field` string, required
    - `value` string, required

## Response `200`

Response for Create and Get usage event requests

- UsageMeter — Structure of usage meter
  - `id` string, required — Identifier of the usage meter
  - `name` string, required — Name of the usage meter
  - `billableName` string — Billable name of addon. Billable name takes precedence over name to display in invoice.
  - `displayName` string, required — Display name of usage meter. This is an auto-generated field which contains billableName of usage meter. If billableName is not provided, name will be used as display name.
  - `description` string
  - `filters` UsageMeterFilterEntry[]
    - `field` string, required
    - `value` string, required
  - `type` 'COUNTER', required — Type of usage meter
  - `status` 'DRAFT' | 'ACTIVE' | 'INACTIVE' | 'ARCHIVED' — Status of usage meter
  - `aggregation` 'COUNT' | 'SUM', required — Aggregation to be applied on usage meter result * COUNT - Counts number of events matching the usage meter * SUM - Sums up results of computation of all events matching usage meter
  - `computations` Computation[]
    - `id` string — Optional identifier describing the matcher and computation pair
    - `matcher` string — Condition to be applied on event. Upon matching it the corresponding computation will be considered for usage_meter unit calculation. The result of the matcher needs to be [truthy](https://jsonlogic.com/truthy.html) in order to be considered as a match.
    - `computation` string, required — Computation to be applied on an event if it matches the matcher. In case of a COUNT aggregation type, computation should be passed as '1'
    - `order` integer, required — The order in which multiple matched computations will get evaluated
  - `createdAt` string, date-time
  - `lastActivatedAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `400` — Error response
- `401` — Error response
- `403` — Error response
- `404` — Error response
- `429` — Error response
- `default` — Error response

---

[API](https://skmtc.net/togaihq/apis/togai-apis.md) · [All operations](https://skmtc.net/togaihq/apis/togai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/togaihq/togai-apis/versions/442f5d8f4aa0/schema)
