POST
/
v1
/
usage
/
groups
Get usage data with paginated groupings
curl --request POST \
  --url https://api.metronome.com/v1/usage/groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customer_id": "04ca7e72-4229-4a6e-ab11-9f7376fccbcb",
  "billable_metric_id": "222796fd-d29c-429e-89b2-549fabda4ed6",
  "starting_on": "2021-01-01T00:00:00Z",
  "ending_before": "2021-01-03T00:00:00Z",
  "window_size": "day",
  "group_by": {
    "key": "region",
    "values": [
      "US-East",
      "US-West",
      "EU-Central"
    ]
  }
}'
{
  "data": [
    {
      "starting_on": "2021-01-01T00:00:00Z",
      "ending_before": "2021-01-02T00:00:00Z",
      "group_key": null,
      "group_value": null,
      "value": 1234
    },
    {
      "starting_on": "2021-01-02T00:00:00Z",
      "ending_before": "2021-01-03T00:00:00Z",
      "group_key": "region",
      "group_value": "US-East",
      "value": 567
    }
  ],
  "next_page": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer

Max number of results that should be returned

Required range: 1 <= x <= 100
next_page
string

Cursor that indicates where the next page of results should start.

Body

application/json

The usage query to run

The body is of type object.

Response

200 - application/json

Success

The response is of type object.