post/metrics/query/datapoints

Request

  • Base URL: https://api.greentally.ai/v1
  • URL: https://api.greentally.ai/v1/metrics/query/datapoints
  • Auth: HTTP bearer

Request body

dimension'month' | 'year' | 'period' required

month and year split each emission row over the calendar months or years it covers, by its UTC days, and count only the days of the requested range: SUM is weighted by days, COUNT counts the rows overlapping a bucket, AVG, MIN and MAX read those rows unweighted. period is one bucket for the whole range, labelled "<startMonth>/<endMonth>" (e.g. "2025-01/2025-12"): its SUM equals the month buckets' sum, and its COUNT, AVG, MIN and MAX see each row with a day in the range once (a 12-month bill counts once, not 12 times). Use it for whole-period totals of non-SUM measures.

endMonthstring required
groupByMetricsLabelField[]
startMonthstring required
supplierLimitinteger

Applies only when groupBy includes supplier; defaults to 50 then. Suppliers are ranked by the requested measure and aggregation over the whole requested range with every filter applied (highest first, ties by name; the empty "no supplier" value is ranked like any other). The first supplierLimit keep their own groups; every other supplier's rows are folded into one group per remaining group-key combination, whose supplier value is "Other suppliers" and which carries "supplierOther": true. Folding happens before aggregation, so AVG, MIN and MAX of the folded group are over its underlying rows. Other group fields (such as the unit forced for raw and spend) do not split the ranking. A value outside 1..200 is a 400.

Example request

{
  "endMonth": "2025-12",
  "startMonth": "2025-01"
}

Response

OK

Changes

    • info

      added the optional property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the new site enum value to the request property //

    • info

      added the new site enum value to the request property /