Method: fhirStores.exportHistory

Full name: projects.locations.datasets.fhirStores.exportHistory

Export resources including historical versions from the FHIR store to the specified destination. The exported resource, along with previous versions, will be exported in one or more FHIR history bundles.

This method returns an Operation that can be used to track the status of the export by calling operations.get.

Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see Viewing error logs in Cloud Logging). Otherwise, when the operation finishes, a detailed response of type ExportResourcesResponse is returned in the response field. The metadata field type for this operation is OperationMetadata.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The name of the FHIR store to export resource from, in the format projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}.

Authorization requires the following IAM permission on the specified resource name:

  • healthcare.fhirStores.export

Request body

The request body contains data with the following structure:

JSON representation
  "maxResourceVersions": string,
  "_since": string,
  "_type": string,

  // Union field destination can be only one of the following:
  "gcsDestination": {
  // End of list of possible types for union field destination.

string (int64 format)

If provided and non-zero, places a limit on the number of resource versions that are returned for a given resource. For example, if the limit is 100 and a resource has over 100 versions, only the 100 most recent versions will be returned. Must be positive.



If provided, only resources versions updated after this time are exported. The time uses the format YYYY-MM-DDThh:mm:ss.sss+zz:zz. For example, 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z. The time must be specified to the second and include a time zone.



String of comma-delimited FHIR resource types. If provided, only resources of the specified resource type(s) are exported.

Union field destination. The output destination of the export.

To enable the Cloud Healthcare API to write to resources in your project such as Cloud Storage buckets, you must grant the Healthcare Service Agent account the required permissions. For steps to assign the permissions, see Exporting data to Cloud Storage. destination can be only one of the following:



The Cloud Storage output destination.

The Healthcare Service Agent account requires the roles/storage.objectAdmin role on the Cloud Storage location.

The exported outputs are organized by FHIR resource types. The server creates one or more objects per resource type depending on the volume of the resources exported. When there is only one object per resource type, the object name is in the form of {operation_id})_history_{resourceType}. When there are multiple objects for a given resource type, the object names are in the form of {operation_id}_history_{resourceType}-{index}-of-{total}.

Each object contains newline delimited JSON, and each line is a FHIR history bundle containing the history for a single resource.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.