v52

latestOpenAPI 3.0.1AGPL-3.0raw.githubusercontent.com2026-08-01255473862.7 KB
Costs

Get combined revenue and cost analytics (V2)

Use when you need the same revenue/cost/ROI analytics but computed from the costsheet usage-tracking pipeline (e.g. for consistency with usage-based cost data).

post/costs/analytics-v2

Request body

end_timestring date-time
expandstring[]

Expand options - specify which entities to expand

external_customer_idstring

Optional - for specific customer

feature_idsstring[]

Additional filters

include_childrenboolean

IncludeChildren, when true and ExternalCustomerID belongs to a parent customer, aggregates every inherited-child customer's usage into the revenue and cost totals. Default (false) restricts the query to the customer's own usage — mirrors the meter-usage analytics contract.

limitinteger

Pagination

offsetinteger
property_filtersobject

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

start_timestring date-time

Time range fields (optional - defaults to last 7 days if not provided)

Response

OK

currencystring
end_timestring date-time
marginstring

Revenue - Cost

margin_percentstring

(Margin / Revenue) * 100

roistring

(Revenue - Cost) / Cost

roi_percentstring

ROI * 100

start_timestring date-time
total_coststring
total_revenuestring

Derived metrics