/sys/billing/config
The /sys/billing/config endpoint allows you to configure how long Vault retains /sys/billing/overview data.
By default, Vault retains sys/billing/overview data for 37 months, including the current month. You can configure the retention period to be between 13 months (minimum) and 72 months (maximum).
Vault does not restore historical data when you increase the retention period. Instead, Vault accumulates new data up to the new retention period before advancing the retention window. For example, if you increase your retention window from 13 months to 37 months, Vault does not advance the retention window until it accumulates 37 months of data.
Read billing configuration
Return the current billing data retention configuration.
| Method | Path |
|---|---|
GET | /sys/billing/config |
Sample request
$ curl --header "X-Vault-Token: ${VAULT_TOKEN}" \
"${VAULT_ADDR}/v1/sys/billing/config"
Sample response
{
"data": {
"retention_months": 37
}
}
Update billing configuration
Update the billing data retention configuration.
| Method | Path |
|---|---|
POST | /sys/billing/config |
Request parameters
retention_months(int: required)- The number of months to retain billing data, including the current month. Must be between 13 and 72 months.
Sample request
$ curl --header "X-Vault-Token: ${VAULT_TOKEN}" \
--request POST \
--data @payload.json \
"${VAULT_ADDR}/v1/sys/billing/config"
Sample payload
{
"retention_months": 48
}
Sample response
If you increase the retention period above the current value, the response includes a warning:
{
"warnings": [
"Retention period increased from 37 to 48 months. Historical data will only be available for months within the previous retention period. Data for months older than 37 months ago will not be restored."
]
}
Vault does not return warnings when you decrease or maintain the existing retention period.