diff --git a/content/vault/v1.21.x (rc)/content/api-docs/system/billing-pki-certificate-count.mdx b/content/vault/v1.21.x (rc)/content/api-docs/system/billing-pki-certificate-count.mdx new file mode 100644 index 0000000000..2ffb2f4499 --- /dev/null +++ b/content/vault/v1.21.x (rc)/content/api-docs/system/billing-pki-certificate-count.mdx @@ -0,0 +1,63 @@ +--- +layout: api +page_title: /sys/billing/certificates - HTTP API +description: >- + Use the `/sys/billing/certificates` endpoint to fetch data about the number of PKI certificates issued by Vault. +--- + +`# /sys/billing/certificates` + +Use the `/sys/billing/certificates` endpoint to fetch data about the +number of PKI certificates issued by Vault. for a cluster. + +## PKI Certificate Counts + +The Certificate Counts endpoint returns the number of PKI certificates issued by Vault, or an error, for each month of the given time range. +By default, the endpoint returns data for the current billing period. + +| Method | Path | +| :----- | :-------------------------- | +| `GET` | `/sys/billing/certificates` | + +### Request parameters + +- `start_time` `(string: "")` - The year and month indicating the first month of the +query range in format `YYYY-MM`. The `start_time` is required if an `end_time` is provided. + + +- `end_time` `(string: "")` - The year and month indicating the last month of the +query range in format `YYYY-MM`. The `end_time` is required if a `start_time` +is provided. + +### Sample payload + +```json +{ + "start_time": "2025-01-01T00:00:00Z", + "end_time": "2025-01-01T00:00:00Z" +} +``` + +### Sample request + +```shell-session +$ curl \ + --header "X-Vault-Token: ..." \ + --data @payload.json \ + http://127.0.0.1:8200/v1/sys/billing/certificates +``` + +### Sample response + +```json +{ + "months": [ + { + "timestamp": "2025-01-01T00:00:00Z", + "counts": { + "issued_certificates": 123 + } + } + ] +} +``` \ No newline at end of file