Update Resource
CRUD Operations
Update Resource
Replace an existing FHIR resource entirely
PUT
Update Resource
Replaces an existing resource with a new version. The entire resource must be provided (not partial updates - use PATCH for that).
Endpoint
The FHIR resource type (e.g.,
Patient, Observation, Encounter)The logical ID of the resource to update
Headers
Must be
application/fhir+json or application/fhir+xmlResponse format:
application/fhir+json (default) or application/fhir+xmlConditional update. Only update if current version matches this ETag. Example:
W/"5" - Prevents lost updates via optimistic lockingResponse style: -
return=representation (default) - Return full updated
resource - return=minimal - Return headers only - return=OperationOutcome- Return OperationOutcome
Query Parameters
For conditional update. Update the resource matching these search parameters.
Example:
?identifier=http://hospital.example/mrn|12345Request Body
The complete resource including the ID. Missing fields are removed (not preserved).Response
200 OK
Resource updated successfully.New version number (incremented from previous)
ISO 8601 timestamp of this update
201 Created
Resource created (update-as-create). Occurs when the resource doesn’t exist and server allows creation via PUT.Update-as-Create: Whether PUT can create resources (when they don’t exist)
depends on server configuration. Check the CapabilityStatement for
updateCreate support.400 Bad Request
Validation failed or malformed request.404 Not Found
Resource doesn’t exist and server doesn’t support update-as-create.409 Conflict
Version conflict or referential integrity violation.412 Precondition Failed
Conditional update matched multiple resources (ambiguous) or If-Match failed.Examples
Best Practices
ID Consistency: The
id in the request body must match the id in the
URL. The resourceType must also match.See Also
Patch Resource
Partial updates without replacing entire resource
Read Resource
Get current version before updating
Resource History
View update history
Learn FHIR CRUD
Understand FHIR update semantics
Authorizations
Bearer token authentication
Headers
For version-aware updates
Path Parameters
The FHIR resource type (e.g., Patient, Observation, Encounter)
The logical ID of the resource