> [!WARNING]
>
> **Preview**
>
>
> This product or feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section
> of the [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA products and features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

This document describes how to edit a parameter template's metadata. You can update the labels of a parameter template. You can't edit the parameter template name
or value. To add a new value to your parameter template, you must [add a parameter
template version](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/add-parameter-template-version).

## Required roles


To get the permission that
you need to update a parameter template's metadata,

ask your administrator to grant you the
[Parameter Manager Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/parametermanager.md.txt#parametermanager.admin) (`roles/parametermanager.admin`) IAM role on the project, folder, or organization.


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).


This predefined role contains the
`parametermanager.templates.update`
permission,
which is required to
update a parameter template's metadata.


You might also be able to get
this permission
with [custom roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles.md.txt) or
other [predefined roles](https://docs.cloud.google.com/iam/docs/roles-overview.md.txt#predefined).

## Edit a parameter template

To edit a parameter template, use one of the following methods:

**Global parameters**

### Console

1. In the Google Cloud console, go to the **Parameter Manager** page.


   [Go to Parameter Manager](https://console.cloud.google.com/security/parametermanager/parameters)
2. Navigate to the **Templates** tab. You'll see a list of all the parameter templates in that project.

3. To edit a parameter template, use one of the following options:

   - Locate the parameter template in the list and click the **Actions**
     menu associated with that parameter template. In the **Actions** menu, click **Edit**.

   - Click the parameter template name to go to the parameter template details page. On the parameter template details page,
     click **Edit**.

4. On the **Edit parameter template** page, update the properties of the parameter template as required, and then click **Save**.

### REST


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID
- <var translate="no">TEMPLATE_ID</var>: the unique name of the parameter template
- <var translate="no">LABEL_KEY</var>: the unique name of the label
- <var translate="no">LABEL_VALUE</var>: the corresponding value of the label


HTTP method and URL:

```
PATCH https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID?update_mask=labels
```


Request JSON body:

```
{
  "labels": {
    "LABEL_KEY": "LABEL_VALUE"
  }
}
```

To send your request, choose one of these options:

#### curl

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


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://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID?update_mask=labels"
```

#### PowerShell

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


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://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/templates/TEMPLATE_ID?update_mask=labels" | Select-Object -Expand Content
```


The response returns the updated parameter.

**Regional parameters**

### Console

1. In the Google Cloud console, go to the **Parameter Manager** page.


   [Go to Parameter Manager](https://console.cloud.google.com/security/parametermanager/parameters)
2. Navigate to the **Templates** tab. You'll see a list of all the parameter templates in that project.

3. To edit a parameter template, use one of the following options:

   - Locate the parameter template in the list and click the **Actions**
     menu associated with that parameter template. In the **Actions** menu, click **Edit**.

   - Click the parameter template name to go to the parameter template details page. On the parameter template details page,
     click **Edit**.

4. On the **Edit parameter template** page, update the properties of the parameter template as required, and then click **Save**.

### REST


Before using any of the request data,
make the following replacements:

- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID
- <var translate="no">LOCATION</var>: the Google Cloud [location](https://docs.cloud.google.com/secret-manager/docs/locations.md.txt) of the parameter
- <var translate="no">TEMPLATE_ID</var>: the unique name of the parameter template
- <var translate="no">LABEL_KEY</var>: the unique name of the label
- <var translate="no">LABEL_VALUE</var>: the corresponding value of the label


HTTP method and URL:

```
PATCH https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID?update_mask=labels
```


Request JSON body:

```
{
  "labels": {
    "LABEL_KEY": "LABEL_VALUE"
  }
}
```

To send your request, choose one of these options:

#### curl

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


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://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID?update_mask=labels"
```

#### PowerShell

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


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://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/templates/TEMPLATE_ID?update_mask=labels" | Select-Object -Expand Content
```


The response returns the updated parameter.

## Edit labels for multiple parameter templates

1. In the Google Cloud console, go to the **Parameter Manager** page.


   [Go to Parameter Manager](https://console.cloud.google.com/security/parametermanager/parameters)
2. Navigate to the **Templates** tab. You'll see a list of all the parameter templates in that project.
3. Select the parameter templates for which you want to edit the labels.
4. Click **Labels**.
5. In the **Editing labels** side panel, update the labels as required.
6. Click **Save**.

## What's next

- [Delete a parameter template](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/delete-parameter-templates.md.txt)
- [List and view parameter template versions](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/list-parameter-template-versions.md.txt)