Get usage for a period
Usage broken into sections, with each row carrying the previous period’s figure beside it so a comparison needs one call. Every row’s key is what the drilldown endpoint takes as row_key.
Check freshness.state and load_state before showing the numbers as final: degraded means part of the answer came from a fallback source.
Authorizations
This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
Path Parameters
The numeric ID of the account
Query Parameters
Named reporting window. Defaults to month.
day, week, month, quarter, year, custom "month"
Start of a custom window, ISO-8601. Required when period=custom.
End of a custom window, ISO-8601. Required when period=custom.
Response
Success
Usage for a period, broken into sections, with the equivalent figures for the previous period alongside each row.
Version of this payload's shape. Branch on it rather than on field presence.
The account.
The window requested.
named for a preset window, custom for an explicit range.
ISO-8601 start of the window.
ISO-8601 end of the window.
Start of the comparison window.
End of the comparison window.
Timezone the windows are expressed in.
loaded, empty or degraded. degraded means some of it came from a fallback source.
Where this answer came from and how current it is. Billing reads several systems, so every response says which one it used — treat state other than fresh as a reason to be careful with the numbers rather than a failure.
Whether the analytics totals agree with what has been written to the ledger. status: "unknown" means the check could not run.
One entry per section — resolutions, channel_fees, and so on. Each has a title, a state and rows, and each row carries a key that the drilldown endpoint takes as row_key.