Skip to main content
POST
Batch or Transaction

Transaction

Execute multiple FHIR operations as a single atomic transaction. All operations succeed or all fail together.

Endpoint

Request Body

The request body is a Bundle with type set to transaction:

Request Methods

Each entry in the transaction can use different HTTP methods:
  • POST - Create a new resource
  • PUT - Update a resource (must include full resource)
  • PATCH - Patch a resource
  • DELETE - Delete a resource
  • GET - Read a resource

Request URL

The url in each request can be:
  • Absolute: Patient/123 - References a specific resource
  • Relative: Patient - Creates a new resource of that type
  • Conditional: Patient?identifier=http://example.org/mrn|12345 - Conditional operation

Response

Success (200 OK)

Returns a Bundle with type set to transaction-response:

Error (400 Bad Request)

If any operation fails, the entire transaction is rolled back:

Response Status Codes

Each entry’s response includes a status code:
  • 200 OK - Successful read or update
  • 201 Created - Resource created
  • 204 No Content - Successful delete
  • 400 Bad Request - Invalid request (transaction fails)
  • 404 Not Found - Resource not found (transaction fails)
  • 409 Conflict - Version conflict (transaction fails)

Conditional Operations

You can use conditional URLs in transactions:

Ordering

Operations in a transaction are processed in order. Later operations can reference resources created earlier:
The server resolves references to resources created in the same transaction.

Notes

  • All operations are atomic - either all succeed or all fail
  • Operations are processed sequentially
  • Resources created in the transaction can be referenced by later operations
  • The transaction response includes the results of all operations
  • Use transactions to ensure data consistency across multiple operations

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

A container for a collection of resources

resourceType
enum<string>
required

Resource type

Available options:
Bundle
type
enum<string>
required

Indicates the purpose of this bundle

Available options:
document,
message,
transaction,
transaction-response,
batch,
batch-response,
history,
searchset,
collection
total
integer

If search, the total number of matches

Links related to this Bundle

entry
object[]

Entry in the bundle

Response

Batch or transaction response

A container for a collection of resources

resourceType
enum<string>
required

Resource type

Available options:
Bundle
type
enum<string>
required

Indicates the purpose of this bundle

Available options:
document,
message,
transaction,
transaction-response,
batch,
batch-response,
history,
searchset,
collection
total
integer

If search, the total number of matches

Links related to this Bundle

entry
object[]

Entry in the bundle