---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/taxonomies/{taxonomiesId}:replace"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/taxonomies/{taxonomiesId}:replace"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/taxonomies/{taxonomiesId}:replace

`POST /v1/projects/{projectsId}/locations/{locationsId}/taxonomies/{taxonomiesId}:replace`

## Request

- Base URL: `https://datacatalog.googleapis.com`
- URL: `https://datacatalog.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/taxonomies/{taxonomiesId}:replace`
- Auth: 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`
- TypeScript: <https://skmtc.dev/google/apis/datacatalog/docs/v1/projects/:projectsId/locations/:locationsId/taxonomies/:taxonomiesId:replace/post.ts> (a function with typed inputs; its response is checked against the schema)

Replaces (updates) a taxonomy and all its policy tags. The taxonomy and its entire hierarchy of policy tags must be represented literally by `SerializedTaxonomy` and the nested `SerializedPolicyTag` messages. This operation automatically does the following: - Deletes the existing policy tags that are missing from the `SerializedPolicyTag`. - Creates policy tags that don't have resource names. They are considered new. - Updates policy tags with valid resources names accordingly.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `taxonomiesId` string, required

## Request body

- GoogleCloudDatacatalogV1ReplaceTaxonomyRequest: Request message for ReplaceTaxonomy.
  - `serializedTaxonomy` GoogleCloudDatacatalogV1SerializedTaxonomy: A nested protocol buffer that represents a taxonomy and the hierarchy of its policy tags. Used for taxonomy replacement, import, and export.
    - `activatedPolicyTypes` string[]: A list of policy types that are activated per taxonomy.
    - `description` string: Description of the serialized taxonomy. At most 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description.
    - `displayName` string: Required. Display name of the taxonomy. At most 200 bytes when encoded in UTF-8.
    - `policyTags` GoogleCloudDatacatalogV1SerializedPolicyTag[]: Top level policy tags associated with the taxonomy, if any.
      - `childPolicyTags` GoogleCloudDatacatalogV1SerializedPolicyTag[]: Children of the policy tag, if any.
      - `description` string: Description of the serialized policy tag. At most 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description.
      - `displayName` string: Required. Display name of the policy tag. At most 200 bytes when encoded in UTF-8.
      - `policyTag` string: Resource name of the policy tag. This field is ignored when calling `ImportTaxonomies`.

## Response `200`

Successful response

- GoogleCloudDatacatalogV1Taxonomy: A taxonomy is a collection of hierarchical policy tags that classify data along a common axis. For example, a "data sensitivity" taxonomy might contain the following policy tags: ``` + PII + Account number + Age + SSN + Zipcode + Financials + Revenue ``` A "data origin" taxonomy might contain the following policy tags: ``` + User data + Employee data + Partner data + Public data ```
  - `activatedPolicyTypes` string[]: Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list.
  - `description` string: Optional. Description of this taxonomy. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns, and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
  - `displayName` string: Required. User-defined name of this taxonomy. The name can't start or end with spaces, must contain only Unicode letters, numbers, underscores, dashes, and spaces, and be at most 200 bytes long when encoded in UTF-8. The taxonomy display name must be unique within an organization.
  - `name` string: Identifier. Resource name of this taxonomy in URL format. Note: Policy tag manager generates unique taxonomy IDs.
  - `policyTagCount` integer: Output only. Number of policy tags in this taxonomy.
  - `service` GoogleCloudDatacatalogV1TaxonomyService: The source system of the Taxonomy.
    - `identity` string: The service agent for the service.
    - `name` 'MANAGING_SYSTEM_UNSPECIFIED' | 'MANAGING_SYSTEM_DATAPLEX' | 'MANAGING_SYSTEM_OTHER': The Google Cloud service name.
  - `taxonomyTimestamps` GoogleCloudDatacatalogV1SystemTimestamps: Timestamps associated with this resource in a particular system.
    - `createTime` string, google-datetime: Creation timestamp of the resource within the given system.
    - `expireTime` string, google-datetime: Output only. Expiration timestamp of the resource within the given system. Currently only applicable to BigQuery resources.
    - `updateTime` string, google-datetime: Timestamp of the last modification of the resource or its metadata within a given system. Note: Depending on the source system, not every modification updates this timestamp. For example, BigQuery timestamps every metadata modification but not data or permission changes.

---

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