Create billable metrics programmatically with this endpoint—an essential step in configuring your pricing and packaging in Metronome.
A billable metric is a customizable query that filters and aggregates events from your event stream. These metrics are continuously tracked as usage data enters Metronome through the ingestion pipeline. The ingestion process transforms raw usage data into actionable pricing metrics, enabling accurate metering and billing for your products.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The details of the billable metric to create.
The display name of 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.
An optional filtering rule to match the 'event_type' property of an event.
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.
Specifies the type of aggregation performed on matching events.
count, Count, COUNT, latest, Latest, LATEST, max, Max, MAX, sum, Sum, SUM, unique, Unique, UNIQUE Specifies the type of aggregation performed on matching events. Required if sql is not provided.
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.
Custom fields to attach to the billable metric.
Success