Get batched usage data
Retrieve aggregated usage data across multiple customers and billable metrics in a single query. This batch endpoint enables you to fetch usage patterns at scale, broken down by time windows, making it ideal for building analytics dashboards, generating reports, and monitoring platform-wide usage trends.
Use this endpoint to:
- Generate platform-wide usage reports for internal teams
- Monitor aggregate usage trends across your entire customer base
- Create comparative usage analyses between customers or time periods
- Support capacity planning with historical usage patterns
Key response fields:
An array of UsageBatchAggregate objects containing:
customer_id: The customer this usage belongs tobillable_metric_idandbillable_metric_name: What was measuredstart_timestampandend_timestamp: Time window for this data pointvalue: Aggregated usage amount for the periodgroups(optional): Usage broken down by group keys with valuesnext_page: Pagination cursor for large result sets
Usage guidelines:
- Time windows: Set
window_sizetohour,day, ornone(entire period) - Required parameters: Must specify
starting_on,ending_before, andwindow_size - Filtering options:
customer_ids: Limit to specific customers (omit for all customers)billable_metrics: Limit to specific metrics (omit for all metrics)
- Pagination: Use
next_pagecursor to retrieve large datasets - Null values: Group values may be null when no usage matches that group
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Cursor that indicates where the next page of results should start.
Body
The usage query to run
A window_size of "day" or "hour" will return the usage for the specified period segmented into daily or hourly aggregates. A window_size of "none" will return a single usage aggregate for the entirety of the specified period.
hour, day, none, HOUR, DAY, NONE, Hour, Day, None A list of Metronome customer IDs to fetch usage for. If absent, usage for all customers will be returned.
A list of billable metrics to fetch usage for. If absent, all billable metrics will be returned.