Medplum resource history and versioning

Medplum keeps a version of every resource write, so teams can reconstruct what changed, when and by whom. This page explains how to use that history for audits and disputes, handle deletes and plan for storage growth.

On this page

Why Medplum resource history matters for audits and disputes

When a compliance, clinical or data team has to explain who changed a patient or clinical record and when, the answer starts with version history. Medplum stores every write as a version of the resource, and each version can be read back through the FHIR history interactions, so a team can reconstruct the sequence of changes to a record rather than relying on its current state alone. Teams usually need this when a clinician disputes a documented value, when a billing or medication question depends on what was recorded at a given time, when a regulator or internal auditor asks for change evidence, or when a data correction needs to be traced back to its source.

The Medplum docs describe history as a per-resource record of prior versions, which is what makes these reviews possible without a separate reconstruction effort. Confirm in your own environment which history interactions your client applications and access policies can call, which roles can read history for sensitive resource types, and how long your deployment retains prior versions. Also confirm with your compliance lead what the history record shows for the actor and time of each write, since that is the detail an auditor or dispute reviewer will ask about first.

History does not replace a separate audit log for access events. A version record shows what changed in a resource, but it does not by itself show who viewed a record, which search was run, or which application read data without writing it. Teams that must answer access questions should plan for Medplum's audit event capabilities alongside version history, and should confirm with their own compliance and security teams how each source will be retained, protected and exported for review.

Reading resource history by scope: one resource, a type or the whole server

Start here when the question concerns a single record, such as one Patient, Observation or MedicationRequest. The instance-level history interaction returns the ordered list of versions for that logical ID, including the current version and earlier states. This is the view most disputes need, because it shows the exact content that existed before and after a given change. Check these points in the returned bundle:

  • Version ID: the meta.versionId of each entry identifies the state, so cite it when you reference a specific version in a dispute.
  • Timestamp: the meta.lastUpdated value shows when the version was written, which you should compare against your own event timeline.
  • Author reference: the meta.author field, where populated, identifies who or what made the write, such as a user, client application or Bot.
  • Deletion entries: check whether a version marks the resource as deleted, since a soft delete appears as a history entry rather than a missing record.
  • Completeness: confirm the bundle is not truncated by paging before you treat it as the full history.

Confirm the exact query parameters and paging behavior for instance history against the Medplum FHIR documentation before you write audit tooling.

Which history view fits which audit or dispute question

This table compares the three history views Medplum exposes and how far back a query can reach, with the question each answers, the data it returns, the effort it takes and when it fits. Read it by starting from the question in dispute, then picking the narrowest view that answers it. Confirm retention and purge behavior with Medplum for your deployment before relying on any view for an audit.

ViewQuestion it answersData it returnsEffort to queryWhen it fits
Per-resource historyWhat changed on this one patient, order or encounter, and in what sequence?Every stored version of a single resource, with version IDs and timestamps for each writeLow: one request keyed to a known resource IDDisputes about a specific record, such as a disputed medication or a late result edit
Type-level historyWhat writes touched any resource of one type during a window, such as all Observations?Versions across all resources of one type, filterable by time, usable to trace a patternMedium: results span many resources and need paging and filteringReviews of a workflow or a suspected bulk change to one resource type
Server-level historyWhich writes did a project or system make across all resource types?Versions across every resource type in the project, ordered by timeHigh: largest result set, so narrow by time and paging before reviewingIncident response or a broad investigation where the affected resource types are not yet known
Querying far back in timeCan a version from an older period still be produced for a review?Only what is still retained under the deployment's retention and purge settingsDepends on retention: older periods may be partially or fully unavailableOnly after Medplum confirms the retention window and purge behavior for your deployment
Current version plus audit eventsWho performed a write and from which client or project?Current state from the resource itself, with audit events kept separately for access and actionsLow to medium: combine the two sources and match on time and actorWhen the dispute is about who acted, not only what the record said

How a write becomes a retrievable version

The flow starts with a client application or Bot sending a create or update through the FHIR API. The Medplum server records the write as a new version of the resource, with its metadata, in the PostgreSQL database. History reads then return those stored versions to applications and to the audit reviewer. Check that each trust boundary is defined by your own access policies and that reviewers receive only the history they are authorized to see.

A write creates a stored version that history endpoints later return to readers.

Setting up history retrieval and an audit workflow on a self-hosted Medplum

This sequence confirms the Medplum version and its history behavior, gives auditors a narrowly scoped client, and proves that reads and writes produce history a dispute can rely on. It ends with a documented export format that your compliance and legal teams can review.

  1. Confirm the deployed version and its support status

    The platform team records the exact Medplum server version running in each environment, from the deployment configuration or the server's version output, and checks it against the release line in Medplum's versioning policy. Confirm that the version is on a supported release line, since a major version receives a fixed window of Active support, Maintenance and, for Enterprise, extended security patches. Also confirm that the environment has been upgraded through each minor version in sequence. The step is done when the version, its support window and the upgrade path are written in the audit runbook.

  2. Review how history is stored in your deployment

    The database owner reviews how the self-hosted server stores resource versions in PostgreSQL and confirms the retention, backup and restore settings that cover the history tables. Ask your Medplum partner or the vendor documentation to confirm how far back history is kept in your version and whether any purge or archive jobs run against it. The step is done when the team can answer, for a sample resource, where its prior versions live and how they are backed up.

  3. Create a dedicated auditor client with a narrow policy

    A security engineer creates a separate client application for auditors, following the client setup steps in Medplum's authentication and access documentation. Attach an access policy that grants read access only to the resource types and history reads the audit workflow needs, and deny write permissions. Use an individual sign-in for each reviewer where your identity provider supports it, and enable multi-factor authentication for those accounts. The step is done when a test login with the auditor identity can read history for an approved resource and receives an authorization error for a write.

  4. Test history reads on a known resource

    Using a test patient or a seeded test resource in a non-production project, the audit engineer requests the resource's history through the FHIR API with the auditor client. Compare the returned versions with the expected number of updates and confirm that each version carries the metadata that identifies when it was written. Repeat the request with an account that lacks the policy to confirm the data is hidden. The step is done when the history output matches the known sequence of changes and the restricted account is refused.

  5. Record a controlled write and confirm the new version

    A test engineer makes a known update to the same test resource using a separate, non-auditor client, and notes the time and the client used. The auditor then re-reads the history and checks that a new version appears, that the earlier versions are unchanged, and that the author metadata matches the client that made the write. Test a soft delete on a disposable resource as well, and confirm that it is still visible in history. The step is done when the controlled write appears exactly once in history with the expected metadata.

  6. Document the export and report format for disputes

    The compliance lead and the audit engineer agree on a standard export format for history, such as the FHIR bundle returned by the history call, stored with its request parameters, the auditor identity and the retrieval time. Define how the export is hashed or signed, where it is stored, and who may request it, and confirm the format with your legal and records teams before it is used in a dispute. Test the export on the sample resource and check that a second reviewer can reproduce the same output. The step is done when the format, storage location and reproduction test are recorded in the runbook.

How soft deletes and deleted resource versions behave in disputes

A delete in Medplum and the earlier versions of that resource are two separate questions, and your dispute and deletion policy should treat them that way. The first question is what a delete does to the current content: whether the resource disappears from search and direct reads, and whether a deleted marker is recorded. The second is whether the versions written before the delete remain readable through history. Before you rely on either answer, confirm both in Medplum's current documentation for the version you run, because the behavior is central to any claim you make about erasure or retention. Do not assume that a delete followed by a history read returns the same result on every deployment without checking it yourself.

Compliance teams need to know whether a deleted resource's earlier versions are still readable, and by whom. If prior versions stay readable, someone with history access can still see the content that was supposed to be gone, so the access model matters as much as the delete itself. Ask which project roles, access policies and client applications can call history on deleted resources, and whether a deletion request can remove prior versions or only the current state. Record the answers in your access control design, since history reads are governed by the same permissions as other reads. The Medplum compliance documentation explains that compliance is a shared responsibility, so the retention decision sits with your organization.

Write the deletion policy from the tested behavior, not from the intended behavior. The policy should name who can request a deletion, who approves it, what the delete call changes, what history keeps, and how the decision is logged. Then test it in a non-production project: create a resource, update it several times, delete it, and attempt current reads, history reads, searches and reads through each role and client that can reach the data. Save the results as evidence. Repeat the test after every Medplum upgrade and before you change access policies, because either change can alter who sees prior versions. Share the results with your legal and privacy reviewers before they approve the policy.

Security and access controls for version history

Resource history keeps every earlier version of a record, so it can expose content that current reads never show. The controls below cover who can read history, who can audit it, where copies of it live, and how it leaves the system. Each one needs an owner and a check before go-live.

Restrict who reads full history

Reading a version exposes the content of that version, including clinical details later corrected or removed. Decide which roles may call the history and version read operations, separately from the roles allowed to read the current resource. Test the access policy with a non-privileged user and confirm that a denied current read is also denied for its history. Confirm how your access policies apply to history requests in your Medplum version, since this varies with configuration.

Authentication docs

Scope audit client access

An audit or dispute review usually needs read access to history but no write access and no access to unrelated patients. Create a dedicated client application with its own access policy and restrict it to the resource types and compartments the review requires. Record who holds the client credentials, how they are rotated, and when the client is disabled after the review closes. Confirm with your identity team how client credentials are issued in your deployment.

Protect PostgreSQL backups

A backup of the database holds every version of every resource, including versions that the API no longer serves to ordinary clients. Treat backup files as PHI with the same encryption, access logging and restore approval as the live database. Confirm where backups are stored, who can restore them, and whether restored copies are purged after the purpose ends. Ask your team to document which backup copies contain deleted-resource history.

Log who queries history

Logging a history read is a separate control from the audit trail of writes, and you should confirm what your deployment records for read requests. Decide which history queries must be captured, such as reads by staff outside the treating relationship, and where those logs are sent. Protect the logs themselves, because they reveal which patients were examined and when. Confirm the log retention period with your compliance team before relying on it.

Control PHI in history exports

Exports of history for a dispute or an analytics job can copy earlier clinical content into files that sit outside the platform. Limit export to named purposes, strip fields that are not needed, and record the recipient and file location. Set a deletion date for each export and confirm that bulk exports of history are authorized separately from current data. Check the export settings in your version before any dispute package leaves the environment.

Assign shared responsibility

Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers. For a self-hosted deployment, the infrastructure, backups, access reviews and log retention for history are typically the customer's to run and evidence. Ask Medplum which controls it provides in its hosted plans and which fall to your team, and record the split in your compliance plan. Confirm the current scope with the compliance documentation before an assessment.

Compliance docs

How version history drives database storage growth

Every write to a Medplum resource adds a version, so the database grows with the number of writes, not only with the number of patients or records. Resources that change often, bulk imports, and integrations that rewrite the same records on every sync will grow storage faster than the record count suggests. A device feed that posts an observation update every few minutes, or a nightly import that touches every patient, produces a new version each time, and each version stays in history until your retention approach removes or archives it. Your team owns the decision about which of these writes are necessary and which are duplicates that could be skipped before they reach the server.

The main cost drivers are write volume, resource size, update frequency, backup retention and replica counts. Large resources with embedded content, such as documents or bundles, multiply the cost of each version. Backup retention multiplies the stored history again, because every backup copy holds the same versions, and each read replica or standby database holds its own copy of the data. Ask your Medplum contact and your database team how these settings combine in your deployment, and which of the retention, archival and purge options apply to your version of the platform. The Medplum self-hosting docs are the starting point for the infrastructure side, but confirm current retention behavior with Medplum before you size storage.

Measure growth before you commit to a storage plan. Load a representative dataset, replay a realistic week of integration traffic and bulk loads, then record database size per version written, separated by resource type. Repeat the measurement with your planned backup schedule and replica count, since those multiply the result. Use the measured rate to project storage for your retention period and the size of each version, and plan a review point when the rate changes, for example after a new device feed or integration goes live. Put the questions to Medplum in writing: what retention and archival options exist for version history, what they cost, and how restoring archived versions affects audit and dispute work.

Limits to confirm before relying on version history

Version history is only as useful as its retention, its survival through change, and its performance under load. The items below are questions to answer in your own environment before an audit, dispute or investigation depends on them.

Retention and purge of old versions

Confirm how long superseded versions of each resource type are kept, whether any purge or compaction job removes them, and who can trigger one. Ask whether a purge is logged, and whether a deleted or purged version can be recovered from backups. Your retention schedule for clinical and financial records should be checked against this behavior, not assumed from the platform default.

Self-hosting docs

History through migrations and upgrades

Confirm whether resource history is preserved when a post-deploy data migration rewrites rows, and whether version identifiers and timestamps stay stable across the change. Test this on a copy of production data before the upgrade, since migrations on large datasets can run for a long time and history tables may grow or change during the run.

Upgrade guide

Sequential minor version upgrades

Confirm that your upgrade plan passes through each minor version in order, since skipping versions causes startup failures. Check whether the history you rely on for an investigation remains readable at each intermediate version, and record which version was running when a given write occurred so that an audit can be tied to the right release.

Performance of history queries

Confirm how history reads perform on resources with long version chains, such as a patient or encounter updated many times by integrations. Test paged history requests, filtered reads and reconstruction of a state at a past point in time against realistic volumes. Slow history queries can stall a dispute review or a disclosure request, so measure them before relying on them under deadline.

Coverage across write paths

Confirm that every route that writes data produces a version, including Bots, Subscriptions, batch and transaction bundles, the HL7 and Agent integrations, and direct database scripts. Writes made outside the API are the most likely gap, so list each write path your deployment uses and test whether its changes appear in history with the correct author.

Behavior on the chosen hosting option

Confirm how history is backed up, replicated and restored under your hosting choice, whether that is Medplum Cloud, AWS, Kubernetes, Azure, Google Cloud or Ubuntu. On a self-hosted deployment, your team owns the PostgreSQL backups and point-in-time recovery that protect history, so verify a restore includes version rows and that compliance responsibilities are assigned in writing.

Compliance docs

What teams ask before using Medplum history for audits

How much effort does it take to set up history-based audit reports in Medplum?

The effort depends mostly on how many audit questions the reports must answer and how many resource types they cover. Medplum records a version for each write, so the history data exists by default, but turning it into reports that an auditor or legal team can read takes design work. Teams usually settle which resource types matter (for example, clinical notes, orders or consent records), define the fields each report must show, and test the output against real dispute cases. Each extra resource type, actor type or reporting rule adds build and review time. Ask any partner to break the estimate down by report, resource type and review cycle rather than giving a single total.

Can an internal team set up Medplum audit history without a partner?

Yes, if the team has engineers who know the FHIR REST API, Medplum's access policies and its SDK, and at least one person who understands the records that will be audited. The harder part is usually not the query but agreeing what counts as an audit trail: who can read history, how reports are signed off and how the output is kept. A partner adds most value where the team lacks a compliance reviewer, has no experience with audit evidence, or needs the work done alongside a self-hosted deployment. Compare the internal skills you already have against the list of work items before deciding.

What does the work need from our team before audit reports can go live?

Four inputs decide most of the work. First, access policies must restrict who can read version history, since history can expose data that current views hide. Second, test data is needed to prove that a known change, deletion or correction appears in the report as expected. Third, a retention decision must set how long versions are kept and what happens to them afterward. Fourth, a named reviewer from compliance, legal or clinical operations must sign off on the report format and the questions it answers. Without these four, the reports may be technically correct but unusable in a dispute.

How do Medplum upgrades affect stored resource history?

Stored history stays in the database through upgrades, but the upgrade path itself is the risk to plan around. Self-hosted Medplum must be upgraded through each minor version in sequence, and skipping versions causes startup failures, so the history you rely on must survive every step. Post-deploy data migrations can run for hours or days on large datasets, according to Medplum's upgrading guide, so schedule them with that window in mind. Before each upgrade, test that a sample of historical versions still returns the same content and that audit reports still run. Confirm the rollback approach with Medplum's upgrading documentation before you start.

What drives the cost of building history-based audit reports?

Cost follows three drivers: the scope of the reports, the data volume they must query and the number of distinct audit workflows. A single report for one resource type is a small task. Reports that join several resource types, cover years of versions or serve separate teams, such as privacy, legal and quality, multiply the design, testing and review work. Data volume affects query design, indexing and how long test runs take. Each audit workflow needs its own access rules and sign-off. Ask for quotes that list the reports, the resource types, the data window and the number of reviewers, and state which items are one-time build work and which are ongoing review or retesting.

How do we estimate storage growth from Medplum version history?

Estimate it from your own write volume, not from a generic rule. Every write creates a new version, so growth tracks how often resources change, how large they are and how long versions are kept. Start by measuring the average number of writes per resource type over a representative period, multiply by average resource size, and then add the database and index overhead you observe in a test environment. Separate high-churn resources, such as observations or tasks, from stable ones, such as patient demographics. Then model the retention decision, since keeping versions for longer changes the total far more than changing the write rate. Confirm the figures in your own environment before committing to a storage budget.

Which compliance and security checks should we ask about before relying on history for disputes?

Ask how access to version history is restricted, how deleted or soft-deleted resources appear in history, and whether the audit reports themselves are logged. Medplum's compliance documentation covers several frameworks and states that compliance is a shared responsibility between Medplum and its customers, so the reports, access rules and retention settings in your deployment are your responsibility. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or certifications. Independent auditors and certification bodies make those determinations. Review the compliance area of Medplum's documentation with your compliance lead before the reports are used in a formal dispute.

Official Medplum sources for versioning and upgrades

Start with Medplum's own documentation before you rely on any behavior described on this page, because version history, retention and upgrade mechanics change between releases. The versions and release policy page is the first read for confirming how long a major version receives support and security patches, since that window determines how long a given release of your deployment can stay in service. Check it against the version you run today and the version you plan to reach, and record the support end dates in your change calendar.

Next, read the Medplum upgrading the server guide alongside the Medplum self-hosting documentation. Confirm how your installation method handles database migrations, whether any version bump changes how resource history rows are written or pruned, and which minor versions you must pass through in sequence. Ask your Medplum contact to confirm whether history tables or version retention settings are affected by the upgrade path you choose, because that answer shapes both your rollback window and your storage forecast.

Finally, use the medplum/medplum GitHub repository and its releases page to review the changelog for every release between your current build and your target. Look for changes to history endpoints, audit events and data migrations, and treat any entry that touches them as a item to test in a staging copy of your database. Pair this with the Medplum authentication documentation so you can confirm which identity and client settings are recorded against each version change in your own environment.

How DeployOpen scopes and supports Medplum history and audit work

DeployOpen plans, builds, documents and supports the history and audit setup for a self-hosted Medplum deployment inside infrastructure you control. The work starts with a written scope that defines which resource types, retention rules, access checks and audit reports are in play before any build begins.

How we scope

  • Map which resource types and dispute workflows need version history, and which do not.
  • Document the retention, soft delete and purge rules your compliance and legal teams must approve.
  • Agree in writing how history reads will be tested against your access policies and roles.

How we build

  • Configure history reads, version lookups and audit queries against your Medplum server and database.
  • Test who-changed-what reporting with seeded changes, including soft deletes and corrected records.
  • Measure history table growth on a representative dataset and set storage monitoring alerts.

How we hand over

  • Deliver runbooks for history queries, audit exports, retention changes and storage checks.
  • Document the access model, the audit evidence produced and the controls you own under the shared responsibility model.
  • Walk your security, compliance and platform teams through the build and the test results before handover.

How we support

  • Offer ongoing support and upgrade work as a retainer, covering history behavior across Medplum minor and patch releases.
  • Retest history and audit queries after each planned upgrade before the change reaches production.
  • Review storage growth and retention settings on a schedule agreed in your support scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.