Update the label or retention period of an existing audit logs subscription for a Vultr organization using the Vultr API, without recreating the subscription.
Updating an audit logs subscription changes its label or retention period without recreating the subscription. Because an account can have only one subscription, this is the only way to adjust retention after initial setup.
This guide explains how to update an audit logs subscription using the Vultr Console or the Vultr API.
Log in to the Vultr Console.
Click the organization name in the top navigation bar.
Click Manage Organization.
Click Audit Logs under the Logs section.
Click the edit icon next to the subscription summary.
In the Audit Log Subscription panel, under Retention Period, select a preset (3 months, 6 months, 1 year, 2 years, 5 years, or 10 years), or select Custom and enter a value in Custom Retention Period (days).
The Audit Log Subscription Cost Estimation section updates to show the ingestion and retention cost for the new period.
Click Change Subscription.
Send a GET request to the List Audit Logs Subscriptions endpoint to find the id of your subscription.
$ curl "https://api.vultr.com/v2/logs/audit-logs" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the subscription's id for the next step.
Send a PUT request to the Update Audit Logs Subscription endpoint to increase the retention period. Replace {subscription-id} with the id from the previous step, SUBSCRIPTION-LABEL with a new label, and EXPIRATION-DAYS with the new retention period in days (up to 3,653 days, or 10 years).
$ curl "https://api.vultr.com/v2/logs/audit-logs/{subscription-id}" \
-X PUT \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"label": "SUBSCRIPTION-LABEL",
"expiration_days": EXPIRATION-DAYS
}'
A successful request returns an HTTP 200 OK response with the updated subscription details.