Construct a Bundle resource with resourceType 'Bundle' and type 'transaction'; each entry must include a resource and a request object.
Set entry[].request.method to 'POST' (create), 'PUT' (update), 'GET' (read), or 'DELETE' as needed; set entry[].request.url to the relative resource URL (e.g., 'Patient' for POST, 'Patient/[id]' for PUT).
Assign temporary client-side IDs using fullUrl with a URN (e.g., urn:uuid:[uuid]) so that intra-bundle references between new resources resolve correctly.
POST the entire Bundle to the server's base endpoint: POST [base]/ with Content-Type: application/fhir+json.
The server returns a transaction-response Bundle; inspect each entry[].response.status (e.g., '201 Created', '200 OK') to confirm each operation's outcome.
If any entry fails, the entire transaction is rolled back (atomicity guarantee); the server returns an OperationOutcome at the Bundle level or per-entry describing the failure.
Known gotchas
Transaction bundles require all-or-nothing semantics; if atomic behavior is not needed, use a 'batch' bundle instead, which processes entries independently and returns individual success/failure per entry.
Reference resolution for urn:uuid fullUrls is server-dependent; some servers require the urn:uuid prefix to exactly match the fullUrl value in the referencing resource.
Large transaction bundles (hundreds of entries) may be rejected or time out; break large loads into smaller bundles and sequence them rather than sending one giant bundle.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp