Create
Create a billable metric
Creates a new Billable Metric.
Body Parameters
The display name of the billable metric.
Specifies the type of aggregation performed on matching events. Required if sql is not provided.
Specifies the type of aggregation performed on matching events.
Custom fields to attach to the billable metric.
An optional filtering rule to match the 'event_type' property of an event.
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.
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.
The SQL query associated with the billable metric. This field is mutually exclusive with aggregation_type, event_type_filter, property_filters, aggregation_key, and group_keys. If provided, these other fields must be omitted.
Returns
curl https://api.metronome.com/v1/billable-metrics/create \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \
-d '{
"name": "CPU Hours"
}'
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}