Get customer entitlement history
Changed onGet the balance and usage history of a metered entitlement. The queried range may span multiple usage periods.
windowed_history groups usage into windows of the requested size and reports the balance at the start of each window. burndown_history lists the periods in which grants were consumed in a fixed order, together with the usage taken from each grant.
Request
- Base URL: http://localhost:8888/api/v3
- URL: http://localhost:8888/api/v3/openmeter/customers/{customerId}/entitlements/{entitlementId}/history
- Auth: none declared
Path parameters
ULID (Universally Unique Lexicographically Sortable Identifier).
ULID (Universally Unique Lexicographically Sortable Identifier).
Query parameters
The start of the queried range. Defaults to the last reset. Truncated to the minute. The range may span at most 1000 windows.
The end of the queried range. Defaults to the current time. Truncated to the minute unless it is the current time.
The meter query granularities the usage history can be grouped into. Sub-hour windows are too expensive to compute and monthly windows are not supported.
The size of the windows the usage is grouped into.
The IANA time zone the windows are aligned to.
Response
EntitlementHistory response.
Example response
{
"windowed_history": [
{
"period": {
"from": "2023-01-01T01:01:01.001Z",
"to": "2023-01-01T01:01:01.001Z"
}
}
],
"burndown_history": [
{
"period": {
"from": "2023-01-01T01:01:01.001Z",
"to": "2023-01-01T01:01:01.001Z"
},
"grant_balances": {
"start": {
"01G65Z755AFWAKHE12NY0CQ9FH": "100"
},
"end": {
"01G65Z755AFWAKHE12NY0CQ9FH": "50"
}
},
"grant_usages": [
{
"grant_id": "01G65Z755AFWAKHE12NY0CQ9FH"
}
]
}
]
}Changes
- info
endpoint added
- info