Skip to main content
POST
Typescript (SDK)
Returns a customer’s balance of a feature over time, for a chart: one bin point at each UTC hour or day of the range, and one change point at each entry other than a track, such as a plan change or a reset. A change point’s entry_id is its entry in List Balance Ledger. The range defaults to the last seven days. It can cover up to 400 days, and up to 14 days with bin_size: "hour". bin_size defaults to hour for ranges up to seven days and day above.
Balance history is rolling out and isn’t available for every customer yet; coverage says whether it is for this one.
A point’s exact is false where it is an estimate, for example before coverage.since, where some history is missing, or across an adjustment Autumn couldn’t place. adjustment on a change point marks such an adjustment; the matching adjustment entry in List Balance Ledger says what made it. An adjustment Autumn placed has a change point of its own and leaves the points around it exact; that change point alone is an estimate when usage in the same bin came both before and after it.
Known limit: rarely, when a customer’s id is changed, two changes to their balance recorded in the same millisecond can be placed in the wrong order here, so a point beside them can show exact: true while it is off. List Balance Ledger orders them correctly.

Body Parameters

Response

Authorizations

Authorization
string
header
required

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

Headers

x-api-version
string
default:2.6.0
required

Body

application/json
customer_id
string
required

The customer whose balance to chart.

Minimum string length: 1
feature_id
string
required

The feature whose balance to chart.

Minimum string length: 1
entity_id
string

Chart this entity's own balance of the feature. For an entity with no balance of its own, the customer's balance is charted.

Minimum string length: 1
custom_range
object

The range to chart: at most 400 days, and at most 14 days with bin_size hour.

bin_size
enum<string>

A point per UTC hour or per UTC day. Defaults to hour for ranges up to seven days and day above.

Available options:
hour,
day

Response

200 - application/json

OK

start
number
required

The first point's time (epoch milliseconds).

end
number
required

The last point's time (epoch milliseconds).

bin_size
enum<string>
required
Available options:
hour,
day
entity_id
string | null
required

The entity whose own balance is charted, or null for the customer's.

coverage
object
required

How much of this customer's balance history Autumn holds. Balance history is rolling out and isn't available for every customer yet; coverage says whether it is for this one.

current
object | null
required

The balance now, where the chart starts walking back from; null for an unlimited balance or none, with no points.

points
object[]
required

Oldest first.