---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:deidentify"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:deidentify"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:deidentify

`POST /v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:deidentify`

## Request

- Base URL: `https://healthcare.googleapis.com`
- URL: `https://healthcare.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/datasets/{datasetsId}:deidentify`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-healthcare`
    - 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-healthcare`
  - 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/healthcare/docs/v1/projects/:projectsId/locations/:locationsId/datasets/:datasetsId:deidentify/post.ts> (a function with typed inputs; its response is checked against the schema)

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

- `projectsId` string, required
- `locationsId` string, required
- `datasetsId` 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.
    - `dicom` DicomConfig: Specifies the parameters needed for de-identification of DICOM stores.
      - `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.
      - `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".
      - `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
    - `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.
    - `image` ImageConfig: Specifies how to handle de-identification of image pixels.
      - `customRegexes` CustomRegex[]: Optional. Custom regex patterns to redact from the image.
        - `groupIndexes` integer[]: Optional. The capturing group indexes to redact.
        - `pattern` string: Optional. The regular expression pattern to match.
      - `textRedactionMode` 'TEXT_REDACTION_MODE_UNSPECIFIED' | 'REDACT_ALL_TEXT' | 'REDACT_SENSITIVE_TEXT' | 'REDACT_NO_TEXT': Optional. Determines how to redact text from image.
    - `text` TextConfig
      - `additionalTransformations` InfoTypeTransformation[]: Optional. Transformations to apply to the detected data, overridden by `exclude_info_types`.
        - `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 "*".
        - `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).
            - `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}`.
            - `wrappedKey` string, byte: Required. The wrapped data crypto key.
        - `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).
            - `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}`.
            - `wrappedKey` string, byte: Required. The wrapped data crypto key.
        - `infoTypes` string[]: Optional. InfoTypes to apply this transformation to. If this is not specified, the transformation applies to any info_type.
        - `redactConfig` RedactConfig: Define how to redact sensitive values. Default behaviour is erase. For example, "My name is Jane." becomes "My name is ."
        - `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.
      - `excludeInfoTypes` string[]: Optional. InfoTypes to skip transforming, overriding `additional_transformations`.
      - `transformations` InfoTypeTransformation[]: Optional. The transformations to apply to the detected data. Deprecated. Use `additional_transformations` instead.
        - `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 "*".
        - `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).
            - `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}`.
            - `wrappedKey` string, byte: Required. The wrapped data crypto key.
        - `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).
            - `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}`.
            - `wrappedKey` string, byte: Required. The wrapped data crypto key.
        - `infoTypes` string[]: Optional. InfoTypes to apply this transformation to. If this is not specified, the transformation applies to any info_type.
        - `redactConfig` RedactConfig: Define how to redact sensitive values. Default behaviour is erase. For example, "My name is Jane." becomes "My name is ."
        - `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.
    - `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.
  - `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.
  - `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.

## Response `200`

Successful response

- Operation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

## Changes

- **2026-10-30** `7027c0ced7f9`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-healthcare` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-healthcare` 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/healthcare/changes/v1/projects/:projectsId/locations/:locationsId/datasets/:datasetsId:deidentify/post.md)

---

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