---
title: "POST /v2/{+parent}/deidentifyTemplates"
method: POST
path: "/v2/{+parent}/deidentifyTemplates"
tags: ["organizations"]
---

# POST /v2/{+parent}/deidentifyTemplates

`POST /v2/{+parent}/deidentifyTemplates`

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid to learn more.

## Path parameters

- `parent` string, required

## Request body

- GooglePrivacyDlpV2CreateDeidentifyTemplateRequest — Request message for CreateDeidentifyTemplate.
  - `deidentifyTemplate` GooglePrivacyDlpV2DeidentifyTemplate — DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.
    - `displayName` string — Display name (max 256 chars).
    - `updateTime` string, google-datetime — Output only. The last update timestamp of an inspectTemplate.
    - `description` string — Short description (max 256 chars).
    - `name` string — Output only. The template name. The template will have one of the following formats: `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`
    - `createTime` string, google-datetime — Output only. The creation timestamp of an inspectTemplate.
    - `deidentifyConfig` GooglePrivacyDlpV2DeidentifyConfig — The configuration that controls how the data will change.
      - `infoTypeTransformations` GooglePrivacyDlpV2InfoTypeTransformations — A type of transformation that will scan unstructured text and apply various `PrimitiveTransformation`s to each finding, where the transformation is applied to only values that were identified as a specific info_type.
        - `transformations` GooglePrivacyDlpV2InfoTypeTransformation[] — Required. Transformation for each infoType. Cannot specify more than one for a given infoType.
          - `primitiveTransformation` GooglePrivacyDlpV2PrimitiveTransformation — A rule for transforming a value.
            - `redactConfig` GooglePrivacyDlpV2RedactConfig — Redact a given value. For example, if used with an `InfoTypeTransformation` transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the output would be 'My phone number is '.
            - `bucketingConfig` GooglePrivacyDlpV2BucketingConfig — Generalization function that buckets values based on ranges. The ranges and replacement values are dynamically provided by the user for custom behavior, such as 1-30 -> LOW, 31-65 -> MEDIUM, 66-100 -> HIGH. This can be used on data of type: number, long, string, timestamp. If the bound `Value` type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.
              - …
            - `cryptoHashConfig` GooglePrivacyDlpV2CryptoHashConfig — Pseudonymization method that generates surrogates via cryptographic hashing. Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs a base64 encoded representation of the hashed output (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). Currently, only string and integer values can be hashed. See https://cloud.google.com/sensitive-data-protection/docs/pseudonymization to learn more.
              - …
            - `timePartConfig` GooglePrivacyDlpV2TimePartConfig — For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a portion of the value.
              - …
            - `dateShiftConfig` GooglePrivacyDlpV2DateShiftConfig — Shifts dates by random number of days, with option to be consistent for the same context. See https://cloud.google.com/sensitive-data-protection/docs/concepts-date-shifting to learn more.
              - …
            - `replaceDictionaryConfig` GooglePrivacyDlpV2ReplaceDictionaryConfig — Replace each input value with a value randomly selected from the dictionary.
              - …
            - `cryptoReplaceFfxFpeConfig` GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig — Replaces an identifier with a surrogate using Format Preserving Encryption (FPE) with the FFX mode of operation; however when used in the `ReidentifyContent` API method, it serves the opposite function by reversing the surrogate back into the original identifier. The identifier must be encoded as ASCII. For a given crypto key and context, the same identifier will be replaced with the same surrogate. Identifiers must be at least two characters long. In the case that the identifier is the empty string, it will be skipped. See https://cloud.google.com/sensitive-data-protection/docs/pseudonymization to learn more. Note: We recommend using CryptoDeterministicConfig for all use cases which do not require preserving the input alphabet space and size, plus warrant referential integrity. FPE incurs significant latency costs.
              - …
            - `replaceWithInfoTypeConfig` GooglePrivacyDlpV2ReplaceWithInfoTypeConfig — Replace each matching finding with the name of the info_type.
            - `characterMaskConfig` GooglePrivacyDlpV2CharacterMaskConfig — Partially mask a string by replacing a given number of characters with a fixed character. Masking can start from the beginning or end of the string. This can be used on data of any type (numbers, longs, and so on) and when de-identifying structured data we'll attempt to preserve the original data's type. (This allows you to take a long like 123 and modify it to a string like **3.
              - …
            - `fixedSizeBucketingConfig` GooglePrivacyDlpV2FixedSizeBucketingConfig — Buckets values based on fixed size ranges. The Bucketing transformation can provide all of this functionality, but requires more configuration. This message is provided as a convenience to the user for simple bucketing strategies. The transformed value will be a hyphenated string of {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound = 20, all values that are within this bucket will be replaced with "10-20". This can be used on data of type: double, long. If the bound Value type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.
              - …
            - `replaceConfig` GooglePrivacyDlpV2ReplaceValueConfig — Replace each input value with a given `Value`.
              - …
            - `cryptoDeterministicConfig` GooglePrivacyDlpV2CryptoDeterministicConfig — Pseudonymization method that generates deterministic encryption for the given input. Outputs a base64 encoded representation of the encrypted output. Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
              - …
          - `infoTypes` GooglePrivacyDlpV2InfoType[] — InfoTypes to apply the transformation to. An empty list will cause this transformation to apply to all findings that correspond to infoTypes that were requested in `InspectConfig`.
            - `name` string — Name of the information type. Either a name of your choosing when creating a CustomInfoType, or one of the names listed at https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference when specifying a built-in type. When sending Cloud DLP results to Data Catalog, infoType names should conform to the pattern `[A-Za-z0-9$_-]{1,64}`.
            - `sensitivityScore` GooglePrivacyDlpV2SensitivityScore — Score is calculated from of all elements in the data profile. A higher level means the data is more sensitive.
              - …
            - `version` string — Optional version name for this InfoType.
      - `recordTransformations` GooglePrivacyDlpV2RecordTransformations — A type of transformation that is applied over structured data such as a table.
        - `fieldTransformations` GooglePrivacyDlpV2FieldTransformation[] — Transform the record by applying various field transformations.
          - `fields` GooglePrivacyDlpV2FieldId[] — Required. Input field(s) to apply the transformation to. When you have columns that reference their position within a list, omit the index from the FieldId. FieldId name matching ignores the index. For example, instead of "contact.nums[0].type", use "contact.nums.type".
            - `name` string — Name describing the field.
          - `infoTypeTransformations` GooglePrivacyDlpV2InfoTypeTransformations — A type of transformation that will scan unstructured text and apply various `PrimitiveTransformation`s to each finding, where the transformation is applied to only values that were identified as a specific info_type.
            - `transformations` GooglePrivacyDlpV2InfoTypeTransformation[] — Required. Transformation for each infoType. Cannot specify more than one for a given infoType.
              - …
          - `primitiveTransformation` GooglePrivacyDlpV2PrimitiveTransformation — A rule for transforming a value.
            - `redactConfig` GooglePrivacyDlpV2RedactConfig — Redact a given value. For example, if used with an `InfoTypeTransformation` transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the output would be 'My phone number is '.
            - `bucketingConfig` GooglePrivacyDlpV2BucketingConfig — Generalization function that buckets values based on ranges. The ranges and replacement values are dynamically provided by the user for custom behavior, such as 1-30 -> LOW, 31-65 -> MEDIUM, 66-100 -> HIGH. This can be used on data of type: number, long, string, timestamp. If the bound `Value` type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.
              - …
            - `cryptoHashConfig` GooglePrivacyDlpV2CryptoHashConfig — Pseudonymization method that generates surrogates via cryptographic hashing. Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs a base64 encoded representation of the hashed output (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). Currently, only string and integer values can be hashed. See https://cloud.google.com/sensitive-data-protection/docs/pseudonymization to learn more.
              - …
            - `timePartConfig` GooglePrivacyDlpV2TimePartConfig — For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a portion of the value.
              - …
            - `dateShiftConfig` GooglePrivacyDlpV2DateShiftConfig — Shifts dates by random number of days, with option to be consistent for the same context. See https://cloud.google.com/sensitive-data-protection/docs/concepts-date-shifting to learn more.
              - …
            - `replaceDictionaryConfig` GooglePrivacyDlpV2ReplaceDictionaryConfig — Replace each input value with a value randomly selected from the dictionary.
              - …
            - `cryptoReplaceFfxFpeConfig` GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig — Replaces an identifier with a surrogate using Format Preserving Encryption (FPE) with the FFX mode of operation; however when used in the `ReidentifyContent` API method, it serves the opposite function by reversing the surrogate back into the original identifier. The identifier must be encoded as ASCII. For a given crypto key and context, the same identifier will be replaced with the same surrogate. Identifiers must be at least two characters long. In the case that the identifier is the empty string, it will be skipped. See https://cloud.google.com/sensitive-data-protection/docs/pseudonymization to learn more. Note: We recommend using CryptoDeterministicConfig for all use cases which do not require preserving the input alphabet space and size, plus warrant referential integrity. FPE incurs significant latency costs.
              - …
            - `replaceWithInfoTypeConfig` GooglePrivacyDlpV2ReplaceWithInfoTypeConfig — Replace each matching finding with the name of the info_type.
            - `characterMaskConfig` GooglePrivacyDlpV2CharacterMaskConfig — Partially mask a string by replacing a given number of characters with a fixed character. Masking can start from the beginning or end of the string. This can be used on data of any type (numbers, longs, and so on) and when de-identifying structured data we'll attempt to preserve the original data's type. (This allows you to take a long like 123 and modify it to a string like **3.
              - …
            - `fixedSizeBucketingConfig` GooglePrivacyDlpV2FixedSizeBucketingConfig — Buckets values based on fixed size ranges. The Bucketing transformation can provide all of this functionality, but requires more configuration. This message is provided as a convenience to the user for simple bucketing strategies. The transformed value will be a hyphenated string of {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound = 20, all values that are within this bucket will be replaced with "10-20". This can be used on data of type: double, long. If the bound Value type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.
              - …
            - `replaceConfig` GooglePrivacyDlpV2ReplaceValueConfig — Replace each input value with a given `Value`.
              - …
            - `cryptoDeterministicConfig` GooglePrivacyDlpV2CryptoDeterministicConfig — Pseudonymization method that generates deterministic encryption for the given input. Outputs a base64 encoded representation of the encrypted output. Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
              - …
          - `condition` GooglePrivacyDlpV2RecordCondition — A condition for determining whether a transformation should be applied to a field.
            - `expressions` GooglePrivacyDlpV2Expressions — An expression, consisting of an operator and conditions.
              - …
        - `recordSuppressions` GooglePrivacyDlpV2RecordSuppression[] — Configuration defining which records get suppressed entirely. Records that match any suppression rule are omitted from the output.
          - `condition` GooglePrivacyDlpV2RecordCondition — A condition for determining whether a transformation should be applied to a field.
            - `expressions` GooglePrivacyDlpV2Expressions — An expression, consisting of an operator and conditions.
              - …
      - `imageTransformations` GooglePrivacyDlpV2ImageTransformations — A type of transformation that is applied over images.
        - `transforms` GooglePrivacyDlpV2ImageTransformation[] — List of transforms to make.
          - `allInfoTypes` GooglePrivacyDlpV2AllInfoTypes — Apply transformation to all findings.
          - `allText` GooglePrivacyDlpV2AllText — Apply to all text.
          - `selectedInfoTypes` GooglePrivacyDlpV2SelectedInfoTypes — Apply transformation to the selected info_types.
            - `infoTypes` GooglePrivacyDlpV2InfoType[] — Required. InfoTypes to apply the transformation to. Required. Provided InfoType must be unique within the ImageTransformations message.
              - …
          - `redactionColor` GooglePrivacyDlpV2Color — Represents a color in the RGB color space.
            - `blue` number, float — The amount of blue in the color as a value in the interval [0, 1].
            - `red` number, float — The amount of red in the color as a value in the interval [0, 1].
            - `green` number, float — The amount of green in the color as a value in the interval [0, 1].
      - `transformationErrorHandling` GooglePrivacyDlpV2TransformationErrorHandling — How to handle transformation errors during de-identification. A transformation error occurs when the requested transformation is incompatible with the data. For example, trying to de-identify an IP address using a `DateShift` transformation would result in a transformation error, since date info cannot be extracted from an IP address. Information about any incompatible transformations, and how they were handled, is returned in the response as part of the `TransformationOverviews`.
        - `throwError` GooglePrivacyDlpV2ThrowError — Throw an error and fail the request when a transformation error occurs.
        - `leaveUntransformed` GooglePrivacyDlpV2LeaveUntransformed — Skips the data without modifying it if the requested transformation would cause an error. For example, if a `DateShift` transformation were applied an an IP address, this mode would leave the IP address unchanged in the response.
  - `locationId` string — Deprecated. This field has no effect.
  - `templateId` string — The template id can contain uppercase and lowercase letters, numbers, and hyphens; that is, it must match the regular expression: `[a-zA-Z\d-_]+`. The maximum length is 100 characters. Can be empty to allow the system to generate one.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dlp.md) · [All operations](https://skmtc.net/google/apis/dlp/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dlp/versions/98ced13f7159/schema)
