---
title: "GET /v2/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}"
method: GET
path: "/v2/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}"
tags: ["projects"]
---

# GET /v2/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}

`GET /v2/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}`

## Request

- Base URL: `https://bigquerydatapolicy.googleapis.com`
- URL: `https://bigquerydatapolicy.googleapis.com/v2/projects/{projectsId}/locations/{locationsId}/dataPolicies/{dataPoliciesId}`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/bigquery`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/bigquery`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Gets the data policy specified by its resource name.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `dataPoliciesId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Response `200`

Successful response

- DataPolicy: Represents the label-policy binding.
  - `dataGovernanceTag` DataGovernanceTag: 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}`.
  - `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.
  - `dataPolicyType` 'DATA_POLICY_TYPE_UNSPECIFIED' | 'DATA_MASKING_POLICY' | 'RAW_DATA_ACCESS_POLICY' | 'COLUMN_LEVEL_SECURITY_POLICY': Required. Type of data policy.
  - `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.
  - `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.
  - `matchingCondition` string: Optional. Matching condition specified as a SQL expression string. Data Governance Tag matcher functions are: `COLUMN_HAS_TAG_KEY(keyName STRING) -> BOOL` `COLUMN_MATCH_TAG(keyName STRING, valueShortName STRING) -> BOOL` For example: `COLUMN_HAS_TAG_KEY('project-id/pii') AND COLUMN_MATCH_TAG('project-id/pii', 'ssn')`
  - `name` string: Identifier. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
  - `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.
  - `version` 'VERSION_UNSPECIFIED' | 'V1' | 'V2': Output only. The version of the Data Policy resource.

## Changes

- **2026-10-29** `035459a78c1c`: 4 info
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/bigquerydatapolicy/changes/v2/projects/:projectsId/locations/:locationsId/dataPolicies/:dataPoliciesId/get.md)

---

[API](https://skmtc.dev/google/apis/bigquerydatapolicy.md) - [All operations](https://skmtc.dev/google/apis/bigquerydatapolicy/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/bigquerydatapolicy/revisions/035459a78c1c?raw)
