---
title: "PATCH /v2/{+name}"
method: PATCH
path: "/v2/{+name}"
tags: ["projects"]
---

# PATCH /v2/{+name}

`PATCH /v2/{+name}`

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

## Path parameters

- `name` string, required

## Query parameters

- `allowMissing` boolean
- `updateMask` string

## Request body

- DataPolicy — Represents the label-policy binding.
  - `grantees` string[] — Optional. The list of IAM principals that have Fine Grained Access to the underlying data goverened by this data policy. Uses the [IAM V2 principal syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2) Only supports principal types users, groups, serviceaccounts, cloudidentity. This field is supported in V2 Data Policy only. In case of V1 data policies (i.e. verion = 1 and policy_tag is set), this field is not populated.
  - `version` 'VERSION_UNSPECIFIED' | 'V1' | 'V2' — Output only. The version of the Data Policy resource.
  - `policyTag` string — Output only. Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. policy_tag is supported only for V1 data policies.
  - `etag` string — The etag for this Data Policy. This field is used for UpdateDataPolicy calls. If Data Policy exists, this field is required and must match the server's etag. It will also be populated in the response of GetDataPolicy, CreateDataPolicy, and UpdateDataPolicy calls.
  - `dataGovernanceTag` DataGovernanceTag — Data Governance tag This is a namespaced name specifying the key and the value. For example: `project-id/pii/sensitive`.
    - `key` string — Optional. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example `parent-id/pii` where `parent-id` is the ID of the parent organization or project resource for this tag key.
    - `value` string — Optional. Specifies the tag value as the short name, for example `sensitive`.
  - `dataMaskingPolicy` DataMaskingPolicy — The policy used to specify data masking rule.
    - `predefinedExpression` 'PREDEFINED_EXPRESSION_UNSPECIFIED' | 'SHA256' | 'ALWAYS_NULL' | 'DEFAULT_MASKING_VALUE' | 'LAST_FOUR_CHARACTERS' | 'FIRST_FOUR_CHARACTERS' | 'EMAIL_MASK' | 'DATE_YEAR_MASK' | 'RANDOM_HASH' — Optional. A predefined masking expression.
    - `routine` string — Optional. The name of the BigQuery routine that contains the custom masking routine, in the format of `projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`.
  - `dataPolicyType` 'DATA_POLICY_TYPE_UNSPECIFIED' | 'DATA_MASKING_POLICY' | 'RAW_DATA_ACCESS_POLICY' | 'COLUMN_LEVEL_SECURITY_POLICY' — Required. Type of data policy.
  - `name` string — Identifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
  - `dataPolicyId` string — Output only. User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/bigquerydatapolicy.md) · [All operations](https://skmtc.dev/google/apis/bigquerydatapolicy/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/bigquerydatapolicy/revisions/ba449e6c274a/schema)
