Skip to main content
PATCH
Update a billable metric

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

metric_id
string<MeteroidId>
required

Metric ID

Example:

"bm_7n42DGM5Tflk9n8mt7Fhc7"

Body

application/json
description
string | null
filters
object[] | null

Absent = leave filters untouched; present (even empty) = replace them.

name
string | null
segmentation_matrix
object
unit_conversion
object | null

Converts the aggregated usage into the unit prices are set in, e.g. tokens priced per 1M. The usage is divided by factor, then rounded. Rounding applies to each priced group's total for the billing period: each group of a segmented or grouped metric, and each matrix cell, is rounded on its own, never each event.

unit_plural
string | null

What several units of the metric are called, e.g. tokens. See unit_singular.

Example:

"tokens"

unit_singular
string | null

What one unit of the metric is called, e.g. token. Send unit_singular and unit_plural together; omit both to leave the label unchanged, or send both as empty strings to remove it. Trimmed; at most 32 characters.

Example:

"token"

usage_breakdown_key
string | null

Omit to leave the breakdown key unchanged; send null to remove it.

Example:

"project_id"

Response

Metric updated

aggregation_type
enum<string>
required
Available options:
COUNT,
LATEST,
MAX,
MIN,
MEAN,
SUM,
COUNT_DISTINCT
code
string
required
created_at
string<date-time>
required
id
string<MeteroidId>
required
Example:

"bm_7n42DGM5Tflk9n8mt7Fhc7"

name
string
required
product_family_id
string<MeteroidId>
required
Example:

"pf_7n42DGM5Tflk9n8mt7Fhc7"

aggregation_key
string | null
archived_at
string<date-time> | null
description
string | null
filters
object[]
product_id
string<MeteroidId> | null
Example:

"prd_7n42DGM5Tflk9n8mt7Fhc7"

segmentation_matrix
object
unit_conversion
object | null

Converts the aggregated usage into the unit prices are set in, e.g. tokens priced per 1M. The usage is divided by factor, then rounded. Rounding applies to each priced group's total for the billing period: each group of a segmented or grouped metric, and each matrix cell, is rounded on its own, never each event.

unit_plural
string | null

What several units of the metric are called, e.g. tokens.

unit_singular
string | null

What one unit of the metric is called, e.g. token. Set together with unit_plural.

usage_breakdown_key
string | null

Event property, e.g. project_id, that breaks each invoice line down by value. The line is still priced on its total usage, and each value shows its quantity and share of the amount.

usage_group_key
string | null

Event property, e.g. cluster_id, whose values are billed as separate invoice lines, each priced on its own usage.