This page describes how to update a regional secret backup. You can add, edit, or delete the labels of a backup.
Required roles
To get the permission that you need to update a secret backup, ask your administrator to grant you the following IAM roles on the project, folder, or organization:
- Secret Manager Editor (
roles/secretmanager.editor) - Secret Manager Admin (
roles/secretmanager.admin)
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the
secretmanager.backups.update
permission,
which is required to
update a secret backup.
You might also be able to get this permission with custom roles or other predefined roles.
Update a secret backup
To update a secret backup, use one of the following methods:
Console
-
In the Google Cloud console, go to the Secret Manager page.
-
Navigate to the Backups tab to view the list of all the backups in the project.
-
Locate the backup in the list and click the Actions menu associated with that backup. In the Actions menu, click Update backup.
-
On the Update backup page, you can add, remove, or modify the labels associated with the backup.
- To add a label, click Add label and enter a Key and a Value for the label.
- To remove a label, click the Delete icon next to the label you want to remove.
- To modify the value of a label, update the Value field.
-
After making the necessary changes, click Update.
REST
Before using any of the request data, make the following replacements:
- BACKUP_LOCATION: the Google Cloud supported region where the backup is stored.
- PROJECT_ID: the Google Cloud project ID where the backup is stored.
- BACKUP_ID: the ID of the backup.
- KEY: the key of the label.
- VALUE: the value of the label.
This request replaces all existing labels on the backup. Include every
label that you want to keep. To remove a label, omit it from the
labels object. The backup must be in the ACTIVE
state.
HTTP method and URL:
PATCH https://secretmanager.BACKUP_LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/BACKUP_LOCATION/backups/BACKUP_ID?updateMask=labels
Request JSON body:
{
"labels": {
"KEY": "VALUE"
}
}
To send your request, choose one of these options:
curl
Save the request body in a file named request.json,
and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://secretmanager.BACKUP_LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/BACKUP_LOCATION/backups/BACKUP_ID?updateMask=labels"
PowerShell
Save the request body in a file named request.json,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://secretmanager.BACKUP_LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/BACKUP_LOCATION/backups/BACKUP_ID?updateMask=labels" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{
"name": "projects/PROJECT_ID/locations/BACKUP_LOCATION/operations/OPERATION_ID",
"metadata": {
"@type": "type.googleapis.com/google.cloud.secretmanager.v1.OperationMetadata",
"createTime": "2026-03-25T08:24:13.153705Z",
"target": "projects/PROJECT_ID/locations/BACKUP_LOCATION/backups/BACKUP_ID",
"verb": "update",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
What's next
- Learn how to delete a regional secret backup.
- Learn how to restore a regional secret backup.