Method: fhirStores.importHistory

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

Import resource historical versions from Cloud Storage source to destination fhir store. 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 ImportResourcesResponse 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 import FHIR resources to, in the format of projects/{projectId}/locations/{locationId}/datasets/{datasetId}/fhirStores/{fhirStoreId}.

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

  • healthcare.fhirStores.import

Request body

The request body contains data with the following structure:

JSON representation
  "maxErrorCount": string,
  "contentStructure": enum(ContentStructure),

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

string (int64 format)

The maximum number of errors before the server cancels the operation. If not specified or set to 0, defaults to 100. -1 means no maximum, the server tries to process all input. Since the server executes the operation in parallel, it might not stop the operation after exactly this number of errors occur.



The content structure in the source location. If not specified, the server treats the input source files as BUNDLE.

Union field source. Specifies the import source and configuration.

To enable the Cloud Healthcare API to read from 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 Importing data from Cloud Storage. source can be only one of the following:



Cloud Storage source data location and import configuration.

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

The Healthcare Service Agent

Each Cloud Storage object should be a text file that contains the format specified in ContentStructure.

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.


The content structure of the input source files.

CONTENT_STRUCTURE_UNSPECIFIED If the content structure is not specified, the default value BUNDLE is used.
BUNDLE The source file contains one or more lines of newline-delimited JSON (ndjson). Each line is a bundle that contains one or more resources.
RESOURCE The source file contains one or more lines of newline-delimited JSON (ndjson). Each line is a single resource.
BUNDLE_PRETTY The entire file is one JSON bundle. The JSON can span multiple lines.
RESOURCE_PRETTY The entire file is one JSON resource. The JSON can span multiple lines.