---
title: "A billable metric has been updated"
method: POST
path: "billable_metric_updated"
---

# A billable metric has been updated

`POST billable_metric_updated` (webhook)

A billable metric has been updated

## Headers

- `X-Lago-Signature` string, required
- `X-Lago-Signature-Algorithm` 'jwt' | 'hmac', required
- `X-Lago-Unique-Key` string, uuid, required

## Payload

- object
  - `webhook_type` 'billable_metric.updated', required
  - `object_type` 'billable_metric', required
  - `organization_id` string, uuid, required: Unique identifier of the organization, created by Lago.
  - `billable_metric` BillableMetricObject, required
    - `lago_id` string, uuid, required: Unique identifier of the billable metric created by Lago.
    - `name` string, required: Name of the billable metric.
    - `code` string, required: Unique code used to identify the billable metric associated with the API request. This code associates each event with the correct metric.
    - `description` string, nullable, required: Internal description of the billable metric.
    - `recurring` boolean, required: Defines if the billable metric is persisted billing period over billing period. - If set to `true`: the accumulated number of units calculated from the previous billing period is persisted to the next billing period. - If set to `false`: the accumulated number of units is reset to 0 at the end of the billing period. - If not defined in the request, default value is `false`.
    - `rounding_function` 'ceil' | 'floor' | 'round' | 'null', nullable, required: Rounding applied to the aggregated number of units. Possible values are `round`, `ceil` and `floor`. When it is not set, the units are not rounded.
    - `rounding_precision` integer, nullable, required: Number of decimal places kept when `rounding_function` is applied. It can be a positive or negative value, and it defaults to 0.
    - `created_at` string, date-time, required: Creation date of the billable metric.
    - `expression` string, nullable, required: Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units.
    - `field_name` string, nullable, required: Property of the billable metric used for aggregating usage data. It is `null` when `aggregation_type` is `count_agg`.
    - `aggregation_type` 'count_agg' | 'sum_agg' | 'max_agg' | 'unique_count_agg' | 'weighted_sum_agg' | 'latest_agg', required: Aggregation method used to compute usage for this billable metric.
    - `weighted_interval` 'seconds' | 'null', nullable, required: Parameter exclusively utilized in conjunction with the `weighted_sum_agg` aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals.
    - `filters` BillableMetricFilterObject[], required
      - `key` string, required: Filter key to add to the event properties payload
      - `values` string[], required: List of possible filter values

## Acknowledgement `200`

Return a 200 status to indicate that the data was received successfully

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) - [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/getlago/apis/lago-api-documentation/revisions/b216574b9612?raw)
