Get customer entitlement history
Changed onPre-release Endpoint This endpoint is currently in beta and is subject to change.
Get 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: https://global.api.konghq.com
- URL: https://global.api.konghq.com/v3/openmeter/customers/{customerId}/entitlements/{entitlementId}/history
- Auth: one of:
- HTTP bearer
- HTTP bearer
- HTTP bearer
- HTTP bearer
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"
},
"usage": "100",
"balance_at_start": "100"
}
],
"burndown_history": [
{
"period": {
"from": "2023-01-01T01:01:01.001Z",
"to": "2023-01-01T01:01:01.001Z"
},
"usage": "100",
"overage": "0",
"balance": {
"start": "100",
"end": "50"
},
"grant_balances": {
"start": {
"01G65Z755AFWAKHE12NY0CQ9FH": "100"
},
"end": {
"01G65Z755AFWAKHE12NY0CQ9FH": "50"
}
},
"grant_usages": [
{
"grant_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"usage": "50"
}
]
}
]
}Changes
- breaking
added to the
/response propertyoneOflist for the response status - warning
added the new
key_invalidenum value to the//////response property for the response status - warning
added the new
uniqueenum value to the//////response property for the response status
- breaking
- info
endpoint added
- info