Get batched usage data

POST {{baseUrl}}/usage?next_page=<string>

Fetch aggregated usage data for multiple customers and billable-metrics, broken into intervals of the specified length.

Request Params

KeyDatatypeRequiredDescription
next_pagestringCursor that indicates where the next page of results should start.

Request Body

{"window_size"=>"DAY", "starting_on"=>"<dateTime>", "ending_before"=>"<dateTime>", "customer_ids"=>["<uuid>", "<uuid>"], "billable_metrics"=>[{"id"=>"<uuid>", "group_by"=>{"key"=>"<string>", "values"=>["<string>"]}}, {"id"=>"<uuid>", "group_by"=>{"key"=>"<string>", "values"=>["<string>"]}}]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;data&quot;:[{&quot;customer_id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;billable_metric_id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;billable_metric_name&quot;:&quot;\u003cstring\u003e&quot;,&quot;start_timestamp&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;end_timestamp&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;value&quot;:&quot;\u003cnumber\u003e&quot;,&quot;groups&quot;:{&quot;do724&quot;:&quot;\u003cnumber\u003e&quot;}},{&quot;customer_id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;billable_metric_id&quot;:&quot;\u003cuuid\u003e&quot;,&quot;billable_metric_name&quot;:&quot;\u003cstring\u003e&quot;,&quot;start_timestamp&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;end_timestamp&quot;:&quot;\u003cdateTime\u003e&quot;,&quot;value&quot;:&quot;\u003cnumber\u003e&quot;,&quot;groups&quot;:{&quot;sintba6&quot;:&quot;\u003cnumber\u003e&quot;,&quot;eiusmod5&quot;:&quot;\u003cnumber\u003e&quot;}}],&quot;next_page&quot;:&quot;\u003cstring\u003e&quot;}