Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.Binary-update
Updates the entire contents of a Binary resource.
If the specified resource does not exist and the FHIR store has enableUpdateCreate set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.
This method can be used to update a Binary resource either by using one of the accepted FHIR JSON content types, or as a raw data stream. If a resource is updated with this method using the FHIR content type this method's behavior is the same as update. If a resource type other than Binary is used in the request it will be treated in the same way as non-FHIR data.
When a non-FHIR content type is used in the request, a Binary resource will be generated using the ID from the resource path, and the uploaded data will be stored in the content field(DSTU2 and STU3), or the data field(R4 and R5). The Binary resource's contentType will be filled in using the value of the Content-Type header, and the securityContext field (not present in DSTU2) will be populated from the X-Security-Context header if it exists. At this time securityContext has no special behavior in the Cloud Healthcare API.
Note: the limit on data ingested through this method is 2 GB. For best performance, use a non-FHIR data type instead of wrapping the data in a Binary resource.
Some of the Healthcare API features, such as exporting to BigQuery or Pub/Sub notifications with full resource content, do not support Binary resources that are larger than 10 MB. In these cases the resource's data field will be omitted. Instead, the "http://hl7.org/fhir/StructureDefinition/data-absent-reason" extension will be present to indicate that including the data is unsupported.
On success, an empty 200 OK response will be returned, or a 201 Created if the resource did not exit. The resource's ID and version are returned in the Location header. Using Prefer: representation=resource is not allowed for this method.
[[["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\u003eThis endpoint allows updating the entire contents of a Binary FHIR resource, or creating one if it doesn't exist and \u003ccode\u003eenableUpdateCreate\u003c/code\u003e is set in the FHIR store.\u003c/p\u003e\n"],["\u003cp\u003eThe method handles FHIR JSON content types and raw data streams, treating non-FHIR data by storing it in the \u003ccode\u003econtent\u003c/code\u003e or \u003ccode\u003edata\u003c/code\u003e field of a generated Binary resource.\u003c/p\u003e\n"],["\u003cp\u003eWhen using non-FHIR content, the Binary resource's \u003ccode\u003econtentType\u003c/code\u003e is derived from the \u003ccode\u003eContent-Type\u003c/code\u003e header, and the \u003ccode\u003esecurityContext\u003c/code\u003e from the \u003ccode\u003eX-Security-Context\u003c/code\u003e header, if present.\u003c/p\u003e\n"],["\u003cp\u003eThe maximum data size that can be ingested through this method is 2 GB, however Binary resources larger than 10 MB may not be supported by some API features.\u003c/p\u003e\n"],["\u003cp\u003eThe response on successful update is an empty 200 OK, or 201 Created if a resource was made, and the resource's ID and version are in the location header.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.Binary-update\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.Binary-update\n\nUpdates the entire contents of a Binary resource.\n\nIf the specified resource does not exist and the FHIR store has [enableUpdateCreate](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore.FIELDS.enable_update_create) set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.\n\nThis method can be used to update a Binary resource either by using one of the accepted FHIR JSON content types, or as a raw data stream. If a resource is updated with this method using the FHIR content type this method's behavior is the same as `update`. If a resource type other than Binary is used in the request it will be treated in the same way as non-FHIR data.\n\nWhen a non-FHIR content type is used in the request, a Binary resource will be generated using the ID from the resource path, and the uploaded data will be stored in the `content` field(`DSTU2` and `STU3`), or the `data` field(`R4` and `R5`). The Binary resource's `contentType` will be filled in using the value of the `Content-Type` header, and the `securityContext` field (not present in `DSTU2`) will be populated from the `X-Security-Context` header if it exists. At this time `securityContext` has no special behavior in the Cloud Healthcare API.\n\nNote: the limit on data ingested through this method is 2 GB. For best performance, use a non-FHIR data type instead of wrapping the data in a Binary resource.\n\nSome of the Healthcare API features, such as [exporting to BigQuery](https://cloud.google.com/healthcare-api/docs/how-tos/fhir-export-bigquery) or [Pub/Sub notifications](https://cloud.google.com/healthcare-api/docs/fhir-pubsub#behavior_when_a_fhir_resource_is_too_large_or_traffic_is_high) with full resource content, do not support Binary resources that are larger than 10 MB. In these cases the resource's `data` field will be omitted. Instead, the \"http://hl7.org/fhir/StructureDefinition/data-absent-reason\" extension will be present to indicate that including the data is `unsupported`.\n\nOn success, an empty 200 OK response will be returned, or a 201 Created if the resource did not exit. The resource's ID and version are returned in the Location header. Using `Prefer: representation=resource` is not allowed for this method.\n\nThe definition of the Binary REST API can be found at \u003chttps://hl7.org/fhir/binary.html#rest\u003e.\n\n### HTTP request\n\n`PUT https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/fhirStores/*/fhir/Binary/*}`\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)."]]