POST
/
v1
/
usage
Get batched usage data
curl --request POST \
  --url https://api.metronome.com/v1/usage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "window_size": "day",
  "starting_on": "2021-01-01T00:00:00Z",
  "ending_before": "2021-01-03T00:00:00Z"
}'
{
  "data": [
    {
      "customer_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
      "billable_metric_id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
      "billable_metric_name": "CPU hours",
      "start_timestamp": "2021-01-01T00:00:00Z",
      "end_timestamp": "2021-01-02T00:00:00Z",
      "value": 1234
    },
    {
      "customer_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
      "billable_metric_id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
      "billable_metric_name": "CPU hours",
      "start_timestamp": "2021-01-02T00:00:00Z",
      "end_timestamp": "2021-01-03T00:00:00Z",
      "value": 1234
    }
  ],
  "next_page": null
}

Authorizations

Authorization
string
header
required

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

Query Parameters

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.