Updating secret version metadata
With IBM Cloud® Secrets Manager, you can also update an existing secret's version custom metadata.
Updating a secret version metadata in the UI
- In the row for the secret that you want to update, click the Actions menu
> Version history.
- Select the version to update its custom metadata.
Updating a secret version metadata using CLI
To update a secret version by using the Secrets Manager CLI plug-in, run the ibmcloud secrets-manager secret-version-metadata-update
command. For example, the following command updates a secret's name, description, labels, custom metadata, and expiration date.
ibmcloud secrets-manager secret-version-metadata-update \
--secret-id 0b5571f7-21e6-42b7-91c5-3f5ac9793a46 \
--id eb4cf24d-9cae-424b-945e-159788a5f535 \
--version-custom-metadata '{"anyKey": "anyValue"}'
Updating a secret version metadata using API
To update a secret version metadata by using the API, execute the following request. In this example the request updates a secret version's custom metadata.
curl -X PATCH --location --header "Authorization: Bearer {iam_token}" \
--header "Accept: application/json" \
--header "Content-Type: application/merge-patch+json" \
--data ''
"https://{instance_ID}.{region}.secrets-manager.appdomain.cloud/api/v2/secrets/{secret_id}/versions/{id}/metadata""
When you call the API, replace the region
, secret_id
, secret version id
variables, and IAM token with the values that are specific to your Secrets Manager instance.