Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.Binary-create
Creates a FHIR Binary resource.
This method can be used to create a Binary resource either by using one of the accepted FHIR JSON content types, or as a raw data stream. If a resource is created with this method using the FHIR content type this method's behavior is the same as fhir.create. If a resource type other than Binary is used in the request it's treated in the same way as non-FHIR data (e.g., images, zip archives, pdf files, documents).
When a non-FHIR content type is used in the request, a Binary resource will be generated, 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 1 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 201 Created response is returned. The newly created 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 API method, \u003ccode\u003eprojects.locations.datasets.fhirStores.fhir.Binary-create\u003c/code\u003e, facilitates the creation of FHIR Binary resources, accommodating both FHIR JSON content types and raw data streams.\u003c/p\u003e\n"],["\u003cp\u003eWhen a non-FHIR content type is used, the uploaded data is stored in the \u003ccode\u003econtent\u003c/code\u003e or \u003ccode\u003edata\u003c/code\u003e field of a generated Binary resource, depending on the FHIR version, with the \u003ccode\u003econtentType\u003c/code\u003e and \u003ccode\u003esecurityContext\u003c/code\u003e fields filled accordingly.\u003c/p\u003e\n"],["\u003cp\u003eThere is a 1 GB size limit for data ingested through this method, and using a non-FHIR data type is recommended for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eBinary resources larger than 10 MB are not fully supported by certain features, such as exporting to BigQuery or Pub/Sub notifications, where the resource's data field will be omitted and replaced with an extension.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful creation, a \u003ccode\u003e201 Created\u003c/code\u003e response is returned, with the new resource's ID and version in the Location header, and it is not allowed to use \u003ccode\u003ePrefer: representation=resource\u003c/code\u003e for this method.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.Binary-create\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.Binary-create\n\nCreates a FHIR Binary resource.\n\nThis method can be used to create a Binary resource either by using one of the accepted FHIR JSON content types, or as a raw data stream. If a resource is created with this method using the FHIR content type this method's behavior is the same as [`fhir.create`](https://cloud.google.com/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.fhir/create). If a resource type other than Binary is used in the request it's treated in the same way as non-FHIR data (e.g., images, zip archives, pdf files, documents).\n\nWhen a non-FHIR content type is used in the request, a Binary resource will be generated, 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 1 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 `201 Created` response is returned. The newly created 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`POST https://healthcare.googleapis.com/v1/{parent=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)."]]