post
https://api.umbrellacost.io/api/v2/invoices/cost-and-usage
Pagination informationWhen there is additional information to show, the nextToken field will be included in the response.
The value should be used in the token parameter of the next call.
Data source - cloud, Kubernetes or both
Define the data scope of your query by using the filter costglobaltype.
*Mentioned below in the body param as well
| Scope | Send | Returns |
|---|---|---|
| Cloud Only | filters[costglobaltype]=cloud | Cloud charges. Kubernetes rows are filtered out. |
| K8s Only | filters[costglobaltype]=k8s | Kubernetes charges only. |
| Cloud + K8s | omit the filter | Both. This is the default. |
Measures - cost, usage, rate and unit-economics KPIs
| Measure | What to send | What to read |
|---|---|---|
| Cost | costType=cost&costType=discount - the default | total_cost |
| Usage | filters[quantitytype]=Hours to pin the unit (optional) | total_usage_quantity |
| Rate - cost per unit | isRateUsageBased: true + filters[quantitytype] | total_cost ÷ total_usage_quantity |
| Rate - usage per usage | isRateUsageBased: true + two quantitytype values | total_usage_quantity_secondary ÷ total_usage_quantity |
| Unit-economics KPI | unitEconomics: {"type":"kpi","value":"<kpiId>"} | total_cost - carries the KPI value |
| Pipeline metric | unitEconomics: {"type":"metric","value":"<pipelineId>-<metricColumn>"} | total_cost - carries the metric value |
Unit economics on the POST form
unitEconomics names what to measure in place of cost, and the dimensions of the pipeline behind it become available to groupBy and to every filter family.
| Field | Type | Notes |
|---|---|---|
type | string | metric - a single pipeline metric; kpi - a saved KPI; kpi_preview- an inline formula, nothing saved. |
value | string | For metric, <pipelineId>-<metricColumn>, e.g. pipe_1d6ba6230251-m_3. For kpi, the KPI id. |
200