Skip to main content
Margin is computed on revenue-linked projects (the default project type). On an internal project (tracked by key metrics, not revenue), this route returns a 400: use Get performance instead.

Get margin

Output:
customer is omitted when group_by isn’t set. Input params: passed in the request body.
"YYYY-MM-DD"
required
Start of the period, inclusive.
"YYYY-MM-DD"
End of the period, inclusive. Defaults to today.
"day" | "week" | "month" | "quarter" | "year" | "all"
default:"\"day\""
One row per period; "all" collapses the whole date range into a single row (per group_by, if set).
"customer"
Split each period into one row per customer. Omit for one row per period.
list[string]
Restrict to these customers. Omit for every customer’s. See Get customers.
list[string]
Restrict to customers who used any of these feature tags in the period (i.e. if a customer did not use the feature, all its rows are removed).
boolean
default:"false"
Apply free AI credits discounts to cost.
integer
default:"100"
Max number of rows to fetch. Max 1000.
string
The route is paginated: pass the previous page’s next_cursor to fetch the next page. PS: has_more from the output says whether another page exists.