Skip to main content
POST
report a lease's usage, and extend or close it

Authorizations

Authorization
string
header
required

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

Body

application/json

The report

key
string
required

The budget's key, chosen by you and unique within the project. Up to 128 letters, digits, and : / _ . @ -, starting with a letter or digit.

Pattern: ^[A-Za-z0-9][A-Za-z0-9:/_.@-]{0,127}$
Example:

"customer:acme"

leaseKey
string
required

Up to 256 characters, one per lease, chosen by the client. Retrying a grant with the same key, amount, and ttlMs replays it; another amount or ttlMs returns 409. Lease keys and idempotency keys are separate.

Required string length: 1 - 256
Example:

"lease_01J9Z3"

seq
integer
required

1 for the first report on a lease, then one more each time. Resending the last seq with the same body replays its answer; any other seq returns 409.

Required range: x > 0
Example:

1

captured
string
required

Usage spent from the lease so far, cumulative: never below the last report and never above the grant. A lost report is covered by the next.

Pattern: ^\d{1,19}(\.\d{1,8})?$
Example:

"0.05"

final
enum<boolean>
required
Available options:
false
extend
string
required

More capacity to add to the lease. Near a hard limit less is granted, and the capture still applies.

Pattern: ^\d{1,19}(\.\d{1,8})?$
Example:

"0.05"

Response

The lease after the report

lease
object
required
terms
object
required

The budget's hold TTL bounds and close time, so holds spent locally follow them

extension
object
required
released
string
required

A final report's unused grant, returned; 0 otherwise

crossed
string[]
required

Limit ids whose consumed amount first exceeded the limit's amount. A hard limit crosses only after recorded usage took its room. Reservations do not trigger crossings. Replays preserve the original result.

replayed
boolean
required

True when this answer replays an earlier request instead of applying it again

balance
object
required