# Method: datasets.deidentify

**Full name**: projects.locations.datasets.deidentify

Creates a new dataset containing de-identified data from the source dataset. The `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.metadata` field type is `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/OperationMetadata`. If the request is successful, the `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.response` field type is `DeidentifySummary`. The LRO result may still be successful if de-identification fails for some resources. The new de-identified dataset will not contain these failed resources. The number of resources processed are tracked in `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation.FIELDS.metadata`. Error details are logged to Cloud Logging. For more information, see [Viewing error logs in Cloud Logging](https://cloud.google.com/healthcare/docs/how-tos/logging).

### HTTP request

`POST https://healthcare.googleapis.com/v1beta1/{sourceDataset=projects/*/locations/*/datasets/*}:deidentify`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `sourceDataset` | `string` Required. Source dataset resource name. For example, `projects/{projectId}/locations/{locationId}/datasets/{datasetId}`. R5 FHIR stores are not supported and will be skipped. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "destinationDataset": string, "config": { object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.fhirStores#DeidentifyConfig`) }, "gcsConfigUri": string } ``` |

| Fields ||
|---|---|
| `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. |
| `config` | ``object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.fhirStores#DeidentifyConfig`)`` Deidentify configuration. Only one of `config` and `gcsConfigUri` can be specified. |
| `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 `gcsConfigUri` can be specified. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-healthcare`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).