Bundle. In a single transaction request, the client can submit multiple delete entries for unified processing by the server. In transaction mode, delete operations are executed as a whole. If any one of the delete entries fails, the entire transaction rolls back, and the other deletions do not take effect.Parameter Name | Type | Required | Description |
HTTP Method | String | Yes | Fixed to POST. |
URL | String | Yes | The Bundle submission URL, usually [baseUrl]. |
Authorization | String | Yes | The authentication token, in the format Bearer <AccessToken>. The AccessToken is obtained via the GetAccessToken API in Calling Methods (or via the GetWebAccessToken API in the instance console scenario). |
Content-Type | String | No | The MIME type of the request body. For write-type requests, it is typically application/fhir+json; if not specified, the server will automatically infer it based on the request content. |
Request Body | JSON Object | Yes | A transaction Bundle containing deletion entries. |
Field | Type | Required | Description |
resourceType | String | Yes | Fixed as Bundle. |
type | String | No | Processing mode. Valid values are transaction (transaction mode, where all entries are executed as an atomic transaction, and the entire operation is rolled back if any entry fails) or batch (batch mode, where each entry is executed independently without affecting others). If not specified, it defaults to transaction. |
entry | Array | Yes | A list of deletion entries. |
entry[].request.method | String | Yes | Fixed as DELETE. |
entry[].request.url | String | Yes | The path of the resource to be deleted, in the format [resourceType]/[id], for example, Patient/A0. |
200 OK is returned. The response headers contain the content type and request trace information, and the response body is a result Bundle of type transaction-response, which includes the execution status of each delete entry. Note that the response status code for each individual delete entry is 204 No Content, not the 200 OK of the overall response.Parameter Name | Type | Description |
Status Code | Integer | Returns 200 OK when successful. |
Location | String | The URL of the Bundle response resource, in the format [baseUrl]/Bundle/[bundleId]. |
Content-Location | String | The URL of the current version of the Bundle response resource. |
Content-Type | String | The MIME type of the response body, typically application/fhir+json. |
x-request-id | String | Request trace ID. |
Field | Type | Description |
resourceType | String | Returns the resource type, usually Bundle. |
id | String | Unique identifier of the Bundle resource. |
type | String | The type of the response Bundle. It returns transaction-response in transaction mode and batch-response in batch mode. |
link | Array | A list of link information, containing navigation links related to the current Bundle. |
link[].relation | String | The type of link relation, such as self (pointing to the current request address). |
link[].url | String | Link address. |
entry | Array | Execution results of the deletion entries. |
entry[].response.status | String | The execution status of the deletion. It is 204 No Content when successful. |
entry[].response.location | String | Location of the resource version after deletion. |
entry[].response.etag | String | Resource version identifier. |
entry[].response.outcome | Object | Details of the operation outcome, containing the OperationOutcome resource, which describes the specific result information of the entry execution. |
POST /INSTANCE_ID/fhir HTTP/1.1Host: HOSTNAMEAuthorization: Bearer YOUR_ACCESS_TOKENContent-Type: application/fhir+json
{"resourceType": "Bundle","type": "transaction","entry": [{"request": {"method": "DELETE","url": "Patient/A0"}},{"request": {"method": "DELETE","url": "Patient/A1"}}]}
HTTP/1.1 200 OKLocation: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/<BUNDLE_ID>Content-Location: https://HOSTNAME/INSTANCE_ID/fhir/Bundle/<BUNDLE_ID>Content-Type: application/fhir+jsonx-request-id: <REQUEST_ID>
{"resourceType": "Bundle","id": "<BUNDLE_ID>","type": "transaction-response","link": [{"relation": "self","url": "https://HOSTNAME/INSTANCE_ID/fhir"}],"entry": [{"response": {"status": "204 No Content","location": "Patient/A0/_history/2","etag": "2","outcome": {"resourceType": "OperationOutcome","issue": [{"severity": "information","code": "informational","details": {"coding": [{"system": "https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code","code": "SUCCESSFUL_DELETE","display": "Delete succeeded."}]},"diagnostics": "Successfully deleted 1 resource(s). Took 87ms."}]}}},{"response": {"status": "204 No Content","location": "Patient/A1/_history/2","etag": "2","outcome": {"resourceType": "OperationOutcome","issue": [{"severity": "information","code": "informational","details": {"coding": [{"system": "https://hapifhir.io/fhir/CodeSystem/hapi-fhir-storage-response-code","code": "SUCCESSFUL_DELETE","display": "Delete succeeded."}]},"diagnostics": "Successfully deleted 1 resource(s). Took 87ms."}]}}}]}
Error Code | Description |
400 Bad Request | The deletion entry is malformed, or the resource path is invalid. |
401 Unauthorized | Not authenticated, and valid credentials are missing. |
403 Forbidden | Authenticated but not authorized to perform the delete operation. |
404 Not Found | The target resource in the entry does not exist. |
409 Conflict | A deletion entry failure caused a transaction rollback. |
500 Internal Server Error | Internal server processing exception. |
フィードバック