Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.executeBundle
Executes all the requests in the given Bundle.
Implements the FHIR standard batch/transaction interaction (DSTU2, STU3, R4, R5).
Supports all interactions within a bundle, except search. This method accepts Bundles of type batch and transaction, processing them according to the batch processing rules (DSTU2, STU3, R4, R5) and transaction processing rules (DSTU2, STU3, R4, R5).
The request body must contain a JSON-encoded FHIR Bundle resource, and the request headers must contain Content-Type: application/fhir+json.
For a batch bundle or a successful transaction, the response body contains a JSON-encoded representation of a Bundle resource of type batch-response or transaction-response containing one entry for each entry in the request, with the outcome of processing the entry. In the case of an error for a transaction bundle, the response body contains a JSON-encoded OperationOutcome resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.
This method checks permissions for each request in the bundle. The executeBundle permission is required to call this method, but you must also grant sufficient permissions to execute the individual requests in the bundle. For example, if the bundle contains a request to create a FHIR resource, the caller must also have been granted the healthcare.fhirResources.create permission.
You can use audit logs to view the permissions for executeBundle and each request in the bundle. For more information, see Viewing Cloud Audit logs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-23 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eexecuteBundle\u003c/code\u003e method processes a FHIR Bundle containing multiple requests, supporting both \u003ccode\u003ebatch\u003c/code\u003e and \u003ccode\u003etransaction\u003c/code\u003e types according to FHIR standards (DSTU2, STU3, R4).\u003c/p\u003e\n"],["\u003cp\u003eThe method requires a JSON-encoded FHIR \u003ccode\u003eBundle\u003c/code\u003e in the request body with \u003ccode\u003eContent-Type: application/fhir+json\u003c/code\u003e in the headers and will respond with either a \u003ccode\u003ebatch-response\u003c/code\u003e or \u003ccode\u003etransaction-response\u003c/code\u003e Bundle upon successful completion.\u003c/p\u003e\n"],["\u003cp\u003eError responses for transaction bundles will be in a JSON-encoded \u003ccode\u003eOperationOutcome\u003c/code\u003e format, while batch bundles will show which actions failed or were successful in the response, and generic GCP errors may occur if the request is not a valid FHIR store method.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eexecuteBundle\u003c/code\u003e requires the \u003ccode\u003ehealthcare.fhirStores.executeBundle\u003c/code\u003e permission, along with sufficient permissions to execute each individual request within the bundle, such as \u003ccode\u003ehealthcare.fhirResources.create\u003c/code\u003e for creating FHIR resources.\u003c/p\u003e\n"],["\u003cp\u003eThe method uses an HTTP POST request to \u003ccode\u003ehttps://healthcare.googleapis.com/v1/{parent=projects/*/locations/*/datasets/*/fhirStores/*}/fhir\u003c/code\u003e and requires specific OAuth scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-healthcare\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.executeBundle\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.executeBundle\n\nExecutes all the requests in the given Bundle.\n\nImplements the FHIR standard batch/transaction interaction ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#transaction), [STU3](https://hl7.org/fhir/STU3/http.html#transaction), [R4](https://hl7.org/fhir/R4/http.html#transaction), [R5](https://hl7.org/fhir/R5/http.html#transaction)).\n\nSupports all interactions within a bundle, except search. This method accepts Bundles of type `batch` and `transaction`, processing them according to the batch processing rules ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#2.1.0.16.1), [STU3](https://hl7.org/fhir/STU3/http.html#2.21.0.17.1), [R4](https://hl7.org/fhir/R4/http.html#brules), [R5](https://hl7.org/fhir/R5/http.html#brules)) and transaction processing rules ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#2.1.0.16.2), [STU3](https://hl7.org/fhir/STU3/http.html#2.21.0.17.2), [R4](https://hl7.org/fhir/R4/http.html#trules), [R5](https://hl7.org/fhir/R5/http.html#trules)).\n\nThe request body must contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain `Content-Type: application/fhir+json`.\n\nFor a batch bundle or a successful transaction, the response body contains a JSON-encoded representation of a `Bundle` resource of type `batch-response` or `transaction-response` containing one entry for each entry in the request, with the outcome of processing the entry. In the case of an error for a transaction bundle, the response body contains a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.\n\nThis method checks permissions for each request in the bundle. The `executeBundle` permission is required to call this method, but you must also grant sufficient permissions to execute the individual requests in the bundle. For example, if the bundle contains a request to create a FHIR resource, the caller must also have been granted the `healthcare.fhirResources.create` permission.\n\nYou can use audit logs to view the permissions for `executeBundle` and each request in the bundle. For more information, see [Viewing Cloud Audit logs](https://cloud.google.com/healthcare-api/docs/how-tos/audit-logging).\n\nFor samples that show how to call `executeBundle`, see [Managing FHIR resources using FHIR bundles](https://cloud.google.com/healthcare/docs/how-tos/fhir-bundles).\n\n### HTTP request\n\n`POST https://healthcare.googleapis.com/v1/{parent=projects/*/locations/*/datasets/*/fhirStores/*}/fhir`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains an instance of [HttpBody](/healthcare-api/docs/reference/rest/Shared.Types/HttpBody).\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-healthcare`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]