Skip to main content
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

string
required
The FHIR resource type (e.g., Patient, Observation, Encounter)
string
required
The logical ID of the resource to update

Headers

string
required
Must be application/fhir+json or application/fhir+xml
string
Response format: application/fhir+json (default) or application/fhir+xml
string
Conditional update. Only update if current version matches this ETag. Example: W/"5" - Prevents lost updates via optimistic locking
string
Response style: - return=representation (default) - Return full updated resource - return=minimal - Return headers only - return=OperationOutcome
  • Return OperationOutcome

Query Parameters

string
For conditional update. Update the resource matching these search parameters. Example: ?identifier=http://hospital.example/mrn|12345

Request Body

The complete resource including the ID. Missing fields are removed (not preserved).
Total Replacement: PUT replaces the entire resource. Any fields not included in the request body are removed. Use PATCH for partial updates.

Response

200 OK

Resource updated successfully.
string
required
New version number (incremented from previous)
string
required
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

Always Use If-Match: Include the If-Match header with the current ETag to prevent lost updates in concurrent scenarios. Without it, last write wins.
Complete Resource Required: You must send the entire resource. Missing fields are removed. Common mistake:
Bad - Missing fields will be deleted
For partial updates, use PATCH instead.
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

Authorization
string
header
required

Bearer token authentication

Headers

If-Match
string

For version-aware updates

Path Parameters

resourceType
string
required

The FHIR resource type (e.g., Patient, Observation, Encounter)

id
string
required

The logical ID of the resource

Body

A FHIR resource. All resources have resourceType, id, and meta fields.

resourceType
string
required

The type of resource

id
string

Logical id of this artifact

meta
object

Metadata about a resource

Response

Resource updated

A FHIR resource. All resources have resourceType, id, and meta fields.

resourceType
string
required

The type of resource

id
string

Logical id of this artifact

meta
object

Metadata about a resource