# Billable Metrics ## Create **post** `/v1/billable-metrics/create` Creates a new Billable Metric. ### Returns - **data:** `ID` ## Retrieve **get** `/v1/billable-metrics/{billable_metric_id}` Get a billable metric. ### Returns - **data:** `object` - **id:** `string` ID of the billable metric - **name:** `string` The display name of the billable metric. - **aggregation\_key:** `string` A key that specifies which property of the event is used to aggregate data. This key must be one of the property filter names and is not applicable when the aggregation type is 'count'. - **aggregation\_type:** `"COUNT" OR "LATEST" OR "MAX" OR 2 more` Specifies the type of aggregation performed on matching events. - `"COUNT"` - `"LATEST"` - `"MAX"` - `"SUM"` - `"UNIQUE"` - **archived\_at:** `string` RFC 3339 timestamp indicating when the billable metric was archived. If not provided, the billable metric is not archived. - **custom\_fields:** `map[string]` - **event\_type\_filter:** `EventTypeFilter` An optional filtering rule to match the 'event_type' property of an event. - **group\_keys:** `array of array of string` Property names that are used to group usage costs on an invoice. Each entry represents a set of properties used to slice events into distinct buckets. - **property\_filters:** `array of PropertyFilter` A list of filters to match events to this billable metric. Each filter defines a rule on an event property. All rules must pass for the event to match the billable metric. - **sql:** `string` The SQL query associated with the billable metric ## List **get** `/v1/billable-metrics` List all billable metrics. ### Returns - **data:** `array of object` - **next\_page:** `string` ## Archive **post** `/v1/billable-metrics/archive` Archive an existing billable metric. ### Returns - **data:** `ID`