Skip to main content
GET
Get usage for a period

Authorizations

api_access_token
string
header
required

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

id
integer
required

The numeric ID of the account

Query Parameters

period
enum<string>

Named reporting window. Defaults to month.

Available options:
day,
week,
month,
quarter,
year,
custom
Example:

"month"

from
string

Start of a custom window, ISO-8601. Required when period=custom.

to
string

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.

schema_version
string

Version of this payload's shape. Branch on it rather than on field presence.

account_id
integer

The account.

period
string

The window requested.

range_type
string

named for a preset window, custom for an explicit range.

period_start
string

ISO-8601 start of the window.

period_end
string

ISO-8601 end of the window.

previous_period_start
string

Start of the comparison window.

previous_period_end
string

End of the comparison window.

timezone
string

Timezone the windows are expressed in.

load_state
string

loaded, empty or degraded. degraded means some of it came from a fallback source.

freshness
object

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.

reconciliation
object

Whether the analytics totals agree with what has been written to the ledger. status: "unknown" means the check could not run.

sections
object

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.