---
title: "POST /v1/{+sourceDataset}:deidentify"
method: POST
path: "/v1/{+sourceDataset}:deidentify"
tags: ["projects"]
---

# POST /v1/{+sourceDataset}:deidentify

`POST /v1/{+sourceDataset}:deidentify`

Creates a new dataset containing de-identified data from the source dataset. The metadata field type is OperationMetadata. If the request is successful, the response field type is DeidentifySummary. If errors occur, error is set. The LRO result may still be successful if de-identification fails for some DICOM instances. The new de-identified dataset will not contain these failed resources. Failed resource totals are tracked in Operation.metadata. Error details are also logged to Cloud Logging. For more information, see [Viewing error logs in Cloud Logging](https://cloud.google.com/healthcare/docs/how-tos/logging).

## Path parameters

- `sourceDataset` string, required

## Request body

- DeidentifyDatasetRequest — Redacts identifying information from the specified dataset.
  - `config` DeidentifyConfig — Configures de-id options specific to different types of content. Each submessage customizes the handling of an https://tools.ietf.org/html/rfc6838 media type or subtype. Configs are applied in a nested manner at runtime.
    - `text` TextConfig
      - `transformations` InfoTypeTransformation[] — Optional. The transformations to apply to the detected data. Deprecated. Use `additional_transformations` instead.
        - `replaceWithInfoTypeConfig` ReplaceWithInfoTypeConfig — When using the INSPECT_AND_TRANSFORM action, each match is replaced with the name of the info_type. For example, "My name is Jane" becomes "My name is [PERSON_NAME]." The TRANSFORM action is equivalent to redacting.
        - `redactConfig` RedactConfig — Define how to redact sensitive values. Default behaviour is erase. For example, "My name is Jane." becomes "My name is ."
        - `cryptoHashConfig` CryptoHashConfig — Pseudonymization method that generates surrogates via cryptographic hashing. Uses SHA-256. Outputs a base64-encoded representation of the hashed output (for example, `L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=`).
          - `cryptoKey` string, byte — An AES 128/192/256 bit key. Causes the hash to be computed based on this key. A default key is generated for each Deidentify operation and is used when neither `crypto_key` nor `kms_wrapped` is specified. Must not be set if `kms_wrapped` is set.
          - `kmsWrapped` KmsWrappedCryptoKey — Include to use an existing data crypto key wrapped by KMS. The wrapped key must be a 128-, 192-, or 256-bit key. The key must grant the Cloud IAM permission `cloudkms.cryptoKeyVersions.useToDecrypt` to the project's Cloud Healthcare Service Agent service account. For more information, see [Creating a wrapped key] (https://cloud.google.com/dlp/docs/create-wrapped-key).
            - `wrappedKey` string, byte — Required. The wrapped data crypto key.
            - `cryptoKey` string — Required. The resource name of the KMS CryptoKey to use for unwrapping. For example, `projects/{project_id}/locations/{location_id}/keyRings/{keyring}/cryptoKeys/{key}`.
        - `infoTypes` string[] — Optional. InfoTypes to apply this transformation to. If this is not specified, the transformation applies to any info_type.
        - `dateShiftConfig` DateShiftConfig — Shift a date forward or backward in time by a random amount which is consistent for a given patient and crypto key combination.
          - `cryptoKey` string, byte — An AES 128/192/256 bit key. The date shift is computed based on this key and the patient ID. If the patient ID is empty for a DICOM resource, the date shift is computed based on this key and the study instance UID. If `crypto_key` is not set, then `kms_wrapped` is used to calculate the date shift. If neither is set, a default key is generated for each de-identify operation. Must not be set if `kms_wrapped` is set.
          - `kmsWrapped` KmsWrappedCryptoKey — Include to use an existing data crypto key wrapped by KMS. The wrapped key must be a 128-, 192-, or 256-bit key. The key must grant the Cloud IAM permission `cloudkms.cryptoKeyVersions.useToDecrypt` to the project's Cloud Healthcare Service Agent service account. For more information, see [Creating a wrapped key] (https://cloud.google.com/dlp/docs/create-wrapped-key).
            - `wrappedKey` string, byte — Required. The wrapped data crypto key.
            - `cryptoKey` string — Required. The resource name of the KMS CryptoKey to use for unwrapping. For example, `projects/{project_id}/locations/{location_id}/keyRings/{keyring}/cryptoKeys/{key}`.
        - `characterMaskConfig` CharacterMaskConfig — Mask a string by replacing its characters with a fixed character.
          - `maskingCharacter` string — Optional. Character to mask the sensitive values. If not supplied, defaults to "*".
      - `excludeInfoTypes` string[] — Optional. InfoTypes to skip transforming, overriding `additional_transformations`.
      - `additionalTransformations` InfoTypeTransformation[] — Optional. Transformations to apply to the detected data, overridden by `exclude_info_types`.
        - `replaceWithInfoTypeConfig` ReplaceWithInfoTypeConfig — When using the INSPECT_AND_TRANSFORM action, each match is replaced with the name of the info_type. For example, "My name is Jane" becomes "My name is [PERSON_NAME]." The TRANSFORM action is equivalent to redacting.
        - `redactConfig` RedactConfig — Define how to redact sensitive values. Default behaviour is erase. For example, "My name is Jane." becomes "My name is ."
        - `cryptoHashConfig` CryptoHashConfig — Pseudonymization method that generates surrogates via cryptographic hashing. Uses SHA-256. Outputs a base64-encoded representation of the hashed output (for example, `L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=`).
          - `cryptoKey` string, byte — An AES 128/192/256 bit key. Causes the hash to be computed based on this key. A default key is generated for each Deidentify operation and is used when neither `crypto_key` nor `kms_wrapped` is specified. Must not be set if `kms_wrapped` is set.
          - `kmsWrapped` KmsWrappedCryptoKey — Include to use an existing data crypto key wrapped by KMS. The wrapped key must be a 128-, 192-, or 256-bit key. The key must grant the Cloud IAM permission `cloudkms.cryptoKeyVersions.useToDecrypt` to the project's Cloud Healthcare Service Agent service account. For more information, see [Creating a wrapped key] (https://cloud.google.com/dlp/docs/create-wrapped-key).
            - `wrappedKey` string, byte — Required. The wrapped data crypto key.
            - `cryptoKey` string — Required. The resource name of the KMS CryptoKey to use for unwrapping. For example, `projects/{project_id}/locations/{location_id}/keyRings/{keyring}/cryptoKeys/{key}`.
        - `infoTypes` string[] — Optional. InfoTypes to apply this transformation to. If this is not specified, the transformation applies to any info_type.
        - `dateShiftConfig` DateShiftConfig — Shift a date forward or backward in time by a random amount which is consistent for a given patient and crypto key combination.
          - `cryptoKey` string, byte — An AES 128/192/256 bit key. The date shift is computed based on this key and the patient ID. If the patient ID is empty for a DICOM resource, the date shift is computed based on this key and the study instance UID. If `crypto_key` is not set, then `kms_wrapped` is used to calculate the date shift. If neither is set, a default key is generated for each de-identify operation. Must not be set if `kms_wrapped` is set.
          - `kmsWrapped` KmsWrappedCryptoKey — Include to use an existing data crypto key wrapped by KMS. The wrapped key must be a 128-, 192-, or 256-bit key. The key must grant the Cloud IAM permission `cloudkms.cryptoKeyVersions.useToDecrypt` to the project's Cloud Healthcare Service Agent service account. For more information, see [Creating a wrapped key] (https://cloud.google.com/dlp/docs/create-wrapped-key).
            - `wrappedKey` string, byte — Required. The wrapped data crypto key.
            - `cryptoKey` string — Required. The resource name of the KMS CryptoKey to use for unwrapping. For example, `projects/{project_id}/locations/{location_id}/keyRings/{keyring}/cryptoKeys/{key}`.
        - `characterMaskConfig` CharacterMaskConfig — Mask a string by replacing its characters with a fixed character.
          - `maskingCharacter` string — Optional. Character to mask the sensitive values. If not supplied, defaults to "*".
    - `dicom` DicomConfig — Specifies the parameters needed for de-identification of DICOM stores.
      - `keepList` TagFilterList — List of tags to be filtered.
        - `tags` string[] — Optional. Tags to be filtered. Tags must be DICOM Data Elements, File Meta Elements, or Directory Structuring Elements, as defined at: https://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,. They may be provided by "Keyword" or "Tag". For example "PatientID", "00100010".
      - `filterProfile` 'TAG_FILTER_PROFILE_UNSPECIFIED' | 'MINIMAL_KEEP_LIST_PROFILE' | 'ATTRIBUTE_CONFIDENTIALITY_BASIC_PROFILE' | 'KEEP_ALL_PROFILE' | 'DEIDENTIFY_TAG_CONTENTS' — Tag filtering profile that determines which tags to keep/remove.
      - `removeList` TagFilterList — List of tags to be filtered.
        - `tags` string[] — Optional. Tags to be filtered. Tags must be DICOM Data Elements, File Meta Elements, or Directory Structuring Elements, as defined at: https://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,. They may be provided by "Keyword" or "Tag". For example "PatientID", "00100010".
      - `skipIdRedaction` boolean — Optional. If true, skip replacing StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID, and MediaStorageSOPInstanceUID and leave them untouched. The Cloud Healthcare API regenerates these UIDs by default based on the DICOM Standard's reasoning: "Whilst these UIDs cannot be mapped directly to an individual out of context, given access to the original images, or to a database of the original images containing the UIDs, it would be possible to recover the individual's identity." https://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.9.html
    - `useRegionalDataProcessing` boolean — Optional. Ensures in-flight data remains in the region of origin during de-identification. The default value is false. Using this option results in a significant reduction of throughput, and is not compatible with `LOCATION` or `ORGANIZATION_NAME` infoTypes. `LOCATION` must be excluded within TextConfig, and must also be excluded within ImageConfig if image redaction is required.
    - `image` ImageConfig — Specifies how to handle de-identification of image pixels.
      - `textRedactionMode` 'TEXT_REDACTION_MODE_UNSPECIFIED' | 'REDACT_ALL_TEXT' | 'REDACT_SENSITIVE_TEXT' | 'REDACT_NO_TEXT' — Optional. Determines how to redact text from image.
    - `fhir` FhirConfig — Specifies how to handle de-identification of a FHIR store.
      - `defaultKeepExtensions` boolean — Optional. The behaviour for handling FHIR extensions that aren't otherwise specified for de-identification. If true, all extensions are preserved during de-identification by default. If false or unspecified, all extensions are removed during de-identification by default.
      - `fieldMetadataList` FieldMetadata[] — Optional. Specifies FHIR paths to match and how to transform them. Any field that is not matched by a FieldMetadata is passed through to the output dataset unmodified. All extensions will be processed according to `default_keep_extensions`.
        - `action` 'ACTION_UNSPECIFIED' | 'TRANSFORM' | 'INSPECT_AND_TRANSFORM' | 'DO_NOT_TRANSFORM' — Optional. Deidentify action for one field.
        - `paths` string[] — Optional. List of paths to FHIR fields to be redacted. Each path is a period-separated list where each component is either a field name or FHIR type name, for example: Patient, HumanName. For "choice" types (those defined in the FHIR spec with the form: field[x]) we use two separate components. For example, "deceasedAge.unit" is matched by "Deceased.Age.unit". Supported types are: AdministrativeGenderCode, Base64Binary, Boolean, Code, Date, DateTime, Decimal, HumanName, Id, Instant, Integer, LanguageCode, Markdown, Oid, PositiveInt, String, UnsignedInt, Uri, Uuid, Xhtml.
  - `gcsConfigUri` string — Cloud Storage location to read the JSON cloud.healthcare.deidentify.DeidentifyConfig from, overriding the default config. Must be of the form `gs://{bucket_id}/path/to/object`. The Cloud Storage location must grant the Cloud IAM role `roles/storage.objectViewer` to the project's Cloud Healthcare Service Agent service account. Only one of `config` and `gcs_config_uri` can be specified.
  - `destinationDataset` string — Required. The name of the dataset resource to create and write the redacted data to. * The destination dataset must not exist. * The destination dataset must be in the same location as the source dataset. De-identifying data across multiple locations is not supported.

## Response `200`

Successful response

---

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