v12

latestOpenAPI 3.0.1AGPL-3.0raw.githubusercontent.com2026-07-0971442569.2 KB
Events

Get usage analytics

Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.

post/events/analytics

Request body

breakdown_bucketboolean

BreakdownBucket when true augments each time-series point with BucketID/PriceID and appends a BucketSummaries rollup to each item. Requires WindowSize to be set and the item to be linked to a subscription line item that has CommitmentTimeBuckets. Default: false (opt-in, backward compatible).

end_timestring date-time
expandstring[]

allowed values: "price", "meter", "feature", "subscription_line_item","plan","addon"

external_customer_idstring

ExternalCustomerID is the single external customer ID. Optional when ExternalCustomerIDs is provided; required otherwise.

feature_idsstring[]
group_bystring[]

allowed values: "source", "feature_id", "properties.<field_name>"

include_childrenboolean

IncludeChildren when true folds child customers' usage into the single aggregated total. Default: false.

property_filtersobject

Property filters to filter the events by the keys in properties field of the event

sourcesstring[]
start_timestring date-time
window_size'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'

Response

OK

currencystring
subtotalstring
total_coststring

TotalCost is the final cost after discount (Subtotal - TotalDiscount)

total_discountstring