Data deletion and purge operations
Guidance for permanently deleting FHIR resources using collection-level purge of deleted resources and instance-level hard delete operations.
Overview
This API supports two administrative deletion operations for FHIR resources:
-
$purgeDeleted(collection level): Permanently removes previously deleted resources from a collection. -
$hardDelete(instance level): Permanently removes a specific already deleted resource instance by its resource identifier ({rid}).
Use these operations when irreversible deletion is required and you have appropriate authorization.
R4 supported resources
The following collection-level and instance-level administrative operations are available for R4 resources.
Collection-level purge of deleted
POST /api/fhir/r4/Condition/$purgeDeleted
POST /api/fhir/r4/Device/$purgeDeleted
POST /api/fhir/r4/DiagnosticReport/$purgeDeleted
POST /api/fhir/r4/Encounter/$purgeDeleted
POST /api/fhir/r4/Endpoint/$purgeDeleted
POST /api/fhir/r4/Group/$purgeDeleted
POST /api/fhir/r4/Location/$purgeDeleted
POST /api/fhir/r4/Observation/$purgeDeleted
POST /api/fhir/r4/Organization/$purgeDeleted
POST /api/fhir/r4/Patient/$purgeDeleted
POST /api/fhir/r4/Practitioner/$purgeDeleted
POST /api/fhir/r4/PractitionerRole/$purgeDeleted
POST /api/fhir/r4/Provenance/$purgeDeleted
POST /api/fhir/r4/RelatedPerson/$purgeDeleted
POST /api/fhir/r4/ServiceRequest/$purgeDeleted
POST /api/fhir/r4/Specimen/$purgeDeleted
Instance-level hard delete
POST /api/fhir/r4/Condition/{rid}/$hardDelete
POST /api/fhir/r4/Device/{rid}/$hardDelete
POST /api/fhir/r4/DiagnosticReport/{rid}/$hardDelete
POST /api/fhir/r4/Encounter/{rid}/$hardDelete
POST /api/fhir/r4/Endpoint/{rid}/$hardDelete
POST /api/fhir/r4/Group/{rid}/$hardDelete
POST /api/fhir/r4/Location/{rid}/$hardDelete
POST /api/fhir/r4/Observation/{rid}/$hardDelete
POST /api/fhir/r4/Organization/{rid}/$hardDelete
POST /api/fhir/r4/Patient/{rid}/$hardDelete
POST /api/fhir/r4/Practitioner/{rid}/$hardDelete
POST /api/fhir/r4/PractitionerRole/{rid}/$hardDelete
POST /api/fhir/r4/Provenance/{rid}/$hardDelete
POST /api/fhir/r4/RelatedPerson/{rid}/$hardDelete
POST /api/fhir/r4/ServiceRequest/{rid}/$hardDelete
POST /api/fhir/r4/Specimen/{rid}/$hardDelete
R6 supported resources
The following collection-level and instance-level administrative operations are available for R6 resources.
Collection-level purge of deleted
POST /api/fhir/r6-ballot4/Device/$purgeDeleted
POST /api/fhir/r6-ballot4/DeviceAssociation/$purgeDeleted
POST /api/fhir/r6-ballot4/Encounter/$purgeDeleted
POST /api/fhir/r6-ballot4/Location/$purgeDeleted
POST /api/fhir/r6-ballot4/Observation/$purgeDeleted
POST /api/fhir/r6-ballot4/Patient/$purgeDeleted
POST /api/fhir/r6-ballot4/Practitioner/$purgeDeleted
POST /api/fhir/r6-ballot4/PractitionerRole/$purgeDeleted
POST /api/fhir/r6-ballot4/Provenance/$purgeDeleted
POST /api/fhir/r6-ballot4/Subscription/$purgeDeleted
POST /api/fhir/r6-ballot4/SubscriptionTopic/$purgeDeleted
Instance-level hard delete
POST /api/fhir/r6-ballot4/Device/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/DeviceAssociation/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Encounter/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Location/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Observation/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Patient/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Practitioner/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/PractitionerRole/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Provenance/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/Subscription/{rid}/$hardDelete
POST /api/fhir/r6-ballot4/SubscriptionTopic/{rid}/$hardDelete
Request and response
- Authentication and authorization are required. Ensure the caller has privileges to perform administrative deletion.
- Requests target either the resource collection endpoint (
$purgeDeleted) or a specific resource instance ({rid}with$hardDelete). - Responses return an
OperationOutcomebody describing the result.
Usage guidance
- Irreversible action: Both operations permanently remove data. Verify resource identifiers and scopes before invoking.
-
Purge scope:
$purgeDeletedaffects resources already in a deleted state within the addressed collection. -
Instance targeting:
$hardDeleteoperates on a single already deleted resource identified by{rid}. - Audit and compliance: Retain appropriate audit trails and confirmations required by your organization before executing permanent removals.
For the complete list of endpoints, see FHIR Endpoints.
Status Codes
| Code | Meaning |
|---|---|
| 200 | The purge-deleted or hard-delete operation completed and returned an OperationOutcome. |
| 204 | The standard delete request completed successfully and the response has no body. |