Bulk FHIR export from Medplum for partners, payers and analytics teams
A partner, payer or analytics team that needs a large FHIR population on a schedule will hit the limits of paged search quickly. The Bulk FHIR pattern solves this by making an asynchronous request for a whole dataset, having the server prepare the resources in the background, and then delivering the result as files that the requester downloads. Those files are typically newline-delimited JSON (NDJSON), with one FHIR resource per line. The request returns a status location to poll rather than a result set, so the client never holds a long HTTP connection open while millions of resources are gathered.
The supplied research does not confirm which Bulk FHIR operations Medplum exposes, which export levels it supports, or which version introduced them. Before you scope anything, check the Medplum documentation and the version you actually run, using the Medplum self-hosting docs as the starting point, and ask Medplum's team to confirm the export behavior in writing. If support is partial or absent, the design changes from a standard export to a custom Bot or scheduled job, and the effort changes with it.
The decision rule is about volume and frequency. FHIR search with paging suits lookups an application makes in real time, such as a chart view or a worklist. Bulk export suits a full or incremental copy taken for a partner feed, a claims or quality review, or a population report, where the cost of millions of paged requests is the problem. If the consumer needs a continuously queryable analytical store rather than files, the warehouse sync topic in this group is the better fit. Write down which of the three your consumer needs before you choose, because each one shifts who owns the pipeline and where the data lands.
Export options and when each fits
This table compares five export shapes a team can request from Medplum: whole system, group or cohort, resource-type subsets, incremental time windows and patient-level requests. Read each row for the consumer it suits, the data it exposes, the file volume it creates and what to confirm in the version you run. The main takeaway is that narrower scopes reduce exposed data and file volume, but each shape needs its own access and version checks before go-live.
| Export shape | Best-fit consumer | Data exposed and file volume | Confirm in your Medplum version |
|---|---|---|---|
| Whole-system export | Internal analytics team loading a broad data lake | All resource types and patients the export identity can read. Largest files and longest runs. | Confirm the export identity's access policy limits what it can read, and how long large runs take on your data. |
| Group or cohort export | Partner or payer receiving a defined population | Only members of the chosen Group. File volume scales with cohort size. | Confirm how Group membership is maintained and which linked resources appear in the output. |
| Resource-type subset | Quality or reporting team needing specific clinical data | Only the selected resource types. Volume depends on which types are chosen. | Confirm how resource types are selected and whether referenced resources are included or must be requested separately. |
| Incremental by time window | Recurring feed to a partner or warehouse | Only resources changed within the window. Small files per run, but many runs over time. | Confirm which timestamp defines the window, and how deletes and version history appear in later runs. |
| Patient-level export | Patient access or single-subject records request | One patient's data and linked resources. Small volume, but one request per patient. | Confirm the request pattern and whether linked resources are included by default. |
How a bulk export request moves from the client to the files
The export client sits in the partner or analytics environment and first obtains an access token from Medplum Auth using client credentials. It then starts an asynchronous export at the bulk export endpoint, which checks the token's scope and the access policy before any data is written. The client polls for status until the export completes, downloads the NDJSON files, and lands them in controlled storage on its own side. Check the trust boundary at the file location: once files leave Medplum, access controls on them are yours to set.
Export flow from client authentication through polling to files in controlled storage.
Setting up Bulk FHIR export on a self-hosted Medplum deployment
This sequence takes a self-hosted Medplum deployment from an untested export capability to a scheduled job that delivers NDJSON files to named consumers. Each step ends with a check, so the team can show that exports match the agreed scope and counts before any partner or analytics team relies on them.
Confirm the deployed version and upgrade path
Record the Medplum server version running in each environment and compare it with the current release listed on the GitHub releases page. At research time the latest release was 5.2.5, published on October 15, 2026, but confirm the current release when you start. Check the support window for your major version in Medplum's versioning policy. Self-hosted upgrades must pass through each minor version in sequence, so plan any upgrade before you test exports. Done when the version, support status and upgrade plan are written into the change record and the export is tested on the version you will run in production.
Define export scope and consumers in writing
The data owner and security lead list each consumer, such as a partner, a payer or an analytics team, along with its purpose, the resource types it may receive, any date range, the fields to exclude, and the expected frequency. Record the data-sharing agreement that covers each consumer. Any resource type not on the list is excluded by default. For example, a payer receiving only Patient and Coverage resources for an agreed period is an illustrative scope that the signed document would define. Done when every consumer has a signed scope entry that the export configuration can be checked against.
Create dedicated client credentials
Create one client application per consumer or per export job rather than sharing an administrator login. Medplum supports client credentials for server-to-server access, which fits scheduled exports, so use that method for each client. Store each client secret in your secrets manager and limit who can read it. Confirm the authentication setup in Medplum's authentication documentation before you rely on it. Check: request a token for each client, confirm that it resolves to the expected client identity, and confirm that the secret is absent from job definitions, logs and repositories. Done when each consumer has a distinct, traceable client.
Restrict access with projects and access policies
Place each export client in the project that holds only the data it is allowed to see, and attach an access policy that grants read access to the agreed resource types and nothing else. Confirm with your Medplum version's documentation how Bulk export is authorized and whether project-level and resource-level policies both apply to it. Review the policy as a document with the data owner. Check: run an access denial test in which the client requests a resource type outside its scope, and confirm that the response contains no data for that type. Done when the out-of-scope test is recorded as a pass.
Enable and test the export on a copy
Restore a copy of the production database to a non-production environment running the same Medplum version, with the same projects, access policies and client definitions. Start an export as each client, poll the status endpoint until the job completes, and download the output files. Keep the copy's data handling controls the same as production, including encryption and restricted access, because it still holds PHI. Done when each consumer's export completes, the out-of-scope test from the previous step still fails as expected on the copy, and the run log shows no unexpected errors.
Validate file contents and counts
Compare the NDJSON output with a known sample. Use a seeded set of test resources with known counts, and run a matching count query against the database using the same filters the export applies. Parse each line as JSON, confirm the resource type matches the file, and check that no field outside the agreed list appears. Record the counts per resource type in a reconciliation report signed by the data owner. Check: the export counts equal the reference counts for every resource type. Done when the reconciliation report shows zero differences, and any difference has been explained and resolved before scheduling.
Schedule the job and monitor each run
Schedule the export with the tool your team operates, such as a cron-based job, a pipeline runner or a Medplum Bot, and run it under the dedicated client credentials. Store output files in encrypted storage with access limited to the named consumer, and set a retention period in line with the agreement. Alert on failed or partial runs. Repeat the access denial test and a count comparison after each Medplum upgrade and each client secret rotation. Check: the first scheduled run matches the reconciliation baseline, and the access test still fails for out-of-scope requests. Done when the schedule, alerts and retention settings are documented.
What partners, payers and analytics teams each need from the export
Partners usually need a contracted subset: a defined patient population, a defined set of resource types and a defined time window, delivered on a schedule the agreement describes. The request should name the resource types, the population criteria and the fields the partner is entitled to receive, because the export is only as narrow as the scope you write down. The access model that fits is a dedicated client application with its own credentials and an access policy limited to the resource types and compartments in the agreement, rather than a shared administrator login.
- Scope in writing: list each resource type and the criteria that select the patients, and keep the list in the data sharing agreement.
- Dedicated client: give the partner's integration its own client identity so access can be reviewed and revoked without affecting other consumers.
- Minimum necessary data: confirm which fields the partner needs for its purpose and exclude the rest at the policy level.
- Delivery format: NDJSON files in a location the partner can reach through an approved transfer path, with checksums and a manifest so both sides can confirm completeness.
- Contract terms: confirm who is the covered entity or business associate, the retention and deletion obligations, and the breach notification path. Paid Medplum cloud plans include standard BAA and MSA agreements, so confirm which agreement applies to your deployment model.
Check that the contract names the exact resource types and that the partner's stated purpose matches the minimum necessary data you plan to export.
Payers typically need member-level data under agreements that tie each data element to a permitted purpose, such as care management, quality reporting or claims operations. The scope should be expressed as member rosters, coverage periods and the clinical and administrative resources tied to those members, and it should be reviewed each time the member population or purpose changes. The access model should separate the export identity from clinical users, use short-lived credentials where the platform supports them, and log every export job with the requester, scope and time.
- Member roster as the boundary: drive the export from an approved member list so every file can be traced back to an agreement and a purpose.
- Purpose-based field sets: define separate field sets for quality reporting, care management and claims, and do not reuse a broad export for each.
- Identity controls: use an identity provider with multi-factor authentication for people who schedule or download exports, and client credentials for scheduled jobs.
- Audit trail: keep job records that show who requested each export, which scope applied and where files were delivered.
- Contract terms: confirm the data use terms, the permitted onward disclosure, the retention period and the amendment process when scope changes. These terms come from your legal and compliance teams and the payer agreement, not from the platform.
Before approving a payer scope, check that each field set maps to a stated purpose and that your legal team has confirmed the agreement covers member-level disclosure.
Analytics teams building population reports rarely need direct identifiers for most measures. The usual starting point is a de-identified or limited dataset with stable pseudonymous identifiers, dates shifted or generalized where the report allows it, and only the resource types the metrics depend on. The access model should keep analysts out of the production Medplum project, deliver files into a restricted analytics zone and separate re-identification keys from the analytical data. Where the team needs ongoing access rather than periodic files, the Iceberg table sync and warehouse options described elsewhere in this group may be a better fit, which you should evaluate against your own governance model.
- De-identify before delivery: decide which identifiers the report needs and remove or replace the rest before files leave the export pipeline.
- Narrow resource types: export only the resources behind each metric, such as encounters, observations or medication requests, rather than everything in the project.
- Separate key custody: store any re-identification mapping under a different owner and access path from the analytical files.
- Schema and versioning: record the FHIR version, the profile set and the export time with each dataset so reports can be reproduced.
- Contract and governance terms: confirm whether the data is de-identified under the method your privacy office uses, what the analysts may publish, and who approves new cuts. Confirm the expected handling with your privacy office, since the platform does not determine de-identification status.
Before approving a dataset, check that every metric in the report can be calculated from the fields you plan to deliver.
Handling NDJSON export files securely
An NDJSON export file is a full copy of PHI. Each line of a Bulk FHIR NDJSON file is a complete FHIR resource, so a patient's name, identifiers, dates, diagnoses and contact details sit in plain text with no field-level protection. Treat every output file as a protected health information dataset from the moment the server writes it. Before the first export runs, confirm with your platform team where the Medplum server or its export job writes files in your deployment, which storage backend holds them, and whether the layout separates resource types into their own files. The exact file layout and storage options depend on how you deployed Medplum and must be confirmed in your environment, not assumed from the defaults.
Encrypt the files at rest in the storage you control, such as an encrypted bucket or volume, and require TLS for every transfer between the server, the storage location and the consumer. Restrict read access to a named service identity for the consumer and a small set of administrators, and log access to the storage location itself, since access logs at the storage layer are the record you will need in a disclosure review. Publish a checksum for each file alongside the export manifest so the consumer can confirm the file arrived intact and complete. Confirm with the consumer which hash algorithm they will verify and where the manifest is delivered, because a checksum that travels with the file itself proves little.
Set retention and deletion rules before the export runs, not after the consumer has the data. Agree in writing how long the export files stay in your storage, when they are deleted, and how the consumer confirms deletion of its copies, including any staging or analytics environments the files pass through. Keep the export manifest and deletion records so you can show what was disclosed, to whom and when. Ask the consumer to confirm where they store files, who can read them and how they handle files that fail to load, because a failed import often leaves partial copies behind.
Access control on export: who can pull what
A Bulk FHIR export moves an entire population of records out of the platform in one job, so the export path needs its own access controls. The cards below cover the identities that start an export, the policies that limit what they can read, and the places the resulting files end up.
Client credentials for the exporting service
Run scheduled exports under a dedicated client with client credentials, not under a person's login. A service identity can be rotated, scoped and disabled without touching anyone's account, and it leaves a clean trail in the audit log. Confirm which client types your Medplum version supports for machine access and whether your team can enforce a rotation schedule for their secrets. Authentication details are covered in the sibling authentication topic.
Medplum auth docsScoping the client through access policies
The exporting client should see only the resource types and compartments the partner or analytics use case needs. Create a project for the export, attach an access policy that limits the client to the required resource types, and test that a broad export returns only permitted data. Record the policy version alongside each export so you can show what the client could read on a given day. Multi-tenant and patient-level rules are covered in the access control topic.
MFA for human administrators
Engineers and administrators who can create export clients, change policies or download finished files should sign in with multi-factor authentication. A stolen password should not be enough to widen an export's scope or retrieve its output. Check which MFA methods your identity setup supports, and confirm that administrator accounts cannot be bypassed through a secondary login path such as a legacy local account. Ask whether MFA can be required for every admin account, not only for the ones created first.
Logging and audit of export jobs
Each export request should be traceable to a client, a time, a requested scope and a result. Log who started the job, what resource types and time window were requested, when the output was produced, and who accessed the files afterward. Forward these events to a store your security team controls, and set an alert for exports outside the normal schedule or from unexpected clients. Without this record, you cannot answer a partner's dispute about what data was delivered.
File storage permissions
NDJSON output is ordinary files until it is locked down. Write exports to a dedicated bucket or volume with no public read access, encrypt them at rest, and grant download rights only to named recipients or pipeline roles. Set a lifecycle rule that deletes files after the agreed delivery window. Confirm with your cloud or storage team how object-level permissions, signed URLs and bucket policies will be enforced, since a permissive default on the storage side undoes the controls upstream.
Keeping export credentials out of code and logs
Client secrets and bearer tokens for export jobs belong in a secrets manager, injected at runtime into the job. They should never appear in repository files, scheduler definitions, container images or CI job output. Mask secret variables in pipeline logs, avoid echoing request headers in debug steps, and rotate any secret that has been printed or committed. A quick review of CI configuration and job history is a practical first check before the export goes live.
Scheduling recurring exports without overloading the server
The main decision for recurring Bulk FHIR exports is whether a schedule is needed at all. A fixed schedule suits partners and analytics feeds that expect a predictable cadence, while on-demand exports suit one-off requests from payers or research teams. Each recurring job competes with clinical traffic for database and API capacity on the same self-hosted Medplum deployment, so write down which exports run automatically, how often, which resource types they cover, and who owns each job before anything is scheduled. Confirm with your platform team how much headroom the Medplum server, PostgreSQL and Redis tiers have at peak hours, because export load is set by your data volume and infrastructure, not by any figure this page can give.
Choose off-peak windows based on measured clinical usage, not assumptions about night-time quiet. Keep exports clear of two events in particular. The first is a Medplum upgrade. The upgrading guide requires each minor version to be applied in sequence, and post-deploy data migrations can run for hours or days on large datasets, so an export that starts during a migration competes for the same database resources and can hide a stalled migration. Schedule a freeze window around every upgrade and confirm the migration has finished before resuming jobs. The second is any other large batch job, such as a bulk load or matching run from your Medplum deployment operations setup. Ask your team to confirm how rate limits apply to the export client's identity, since a recurring job on a shared client can trigger throttling for other integrations.
Treat failures and partial output as normal events to design for. Monitor each job for non-success status, incomplete file sets, and NDJSON files that end mid-record or are missing expected resource types, and alert on them separately from the clinical systems. Write each run to a new, timestamped location and publish to consumers only after the run completes and checksums match, so a partner never ingests a half-written file. Decide in advance whether a failed run is retried automatically, skipped until the next window, or escalated, and document the restart point. The capacity thresholds, retry limits and monitoring stack depend on your environment, so confirm them in a test run against representative data and align the final settings with the operations plan described in the Medplum high availability and operations content group.
What does a Bulk FHIR export setup cost and take to build?
What drives the cost of a Bulk FHIR export setup on Medplum?
Cost follows the written scope, and the main drivers are the number of resource types, the number of consumers receiving files, the access model and the testing your team needs before go-live. Each consumer adds its own delivery target, credentials, file checks and support questions. Access rules that limit which patients, organizations or resource types leave the platform take design and review time. Storage for NDJSON output, retention rules and a schedule that runs against a live database also add work. Ask the provider to price each of these as a separate line so you can see what changes if one driver grows.
Can our own team build a Bulk FHIR export without a partner?
A team with FHIR, Medplum and cloud operations experience can build an export, and many do. The harder parts are usually not the export call itself but the access model, the handling of exported files and the operational routine after go-live. Check whether your team has someone who can write and review access policies, who owns the storage and encryption of export files, and who will test each consumer's import against real output. If those skills are thin, a fixed-scope engagement can cover design, build and validation, and your team keeps ownership of the running system.
What does our team need to provide for a Bulk FHIR export project?
Four things usually decide whether the project moves on schedule:
- Access to the cloud accounts or data center where Medplum runs, with the permissions needed to deploy and change the export configuration.
- A version decision for Medplum, including whether you are on a supported release line and when you plan to upgrade.
- Named data owners who can confirm which resource types, fields and patients each consumer may receive.
- A written sign-off on scope, including the consumers, delivery method, retention period and the people who approve changes.
Without these, design work stalls, and changes after build usually cost more than decisions made before it.
How does a Medplum upgrade affect scheduled Bulk FHIR exports?
A scheduled export depends on the Medplum server version, so an upgrade can change behavior, timing or output. Medplum's upgrading guide says self-hosted deployments must move through each minor version in sequence, and that post-deploy data migrations can run for hours or days on large datasets. Plan a test export on a staging copy after each step, confirm the schedule still fires, and check that the NDJSON output still matches what each consumer expects. Ask the provider how exports are paused during migrations and who approves the cutover.
Does Medplum Cloud or self-hosting change the Bulk FHIR export work?
Yes. On self-hosted Medplum, your team or its partner owns the infrastructure, the database, the scheduler, the storage for export files and the backups, so those tasks appear in the scope. On a hosted plan, the provider runs the platform, but you still decide who can export, which data leaves the platform and how files are handled, because Medplum's compliance documentation describes compliance as a shared responsibility between Medplum and its customers. Confirm with Medplum which export features each plan includes before you write the scope.
What should a written quote for a Bulk FHIR export include?
A useful quote lists the scope as a set of deliverables rather than a total. Ask for the resource types and consumers in scope, the access policies and review steps, the scheduling design, where NDJSON files are stored and how they are encrypted and deleted, the test plan with each consumer's import check, and the handover documentation. Ask which items are one-time, such as design and build, and which recur, such as hosting, monitoring, upgrades and support. Also ask what is excluded, which assumptions the price depends on, and how a change to scope is priced and approved.
Limits to confirm before you commit to an export design
A Bulk FHIR export design depends on what the deployed Medplum version exposes, how the server and database handle large jobs, and which plan or support terms apply to your deployment. Confirm the items below in your own environment before you write the export requirements or sign a scope.
Bulk FHIR support in your version
Confirm that the Bulk FHIR endpoints and their behavior exist in the exact Medplum version you run or plan to run, not only in the current release. Ask how the server starts export jobs, how clients poll for status, and where output files are staged. Test the full kickoff, status and download sequence against a non-production copy before you rely on it in a partner agreement.
Upgrade guideSupported export scopes
Find out which export scopes the server accepts, such as whole-system exports, patient-level exports or group-based exports, and whether each one can be restricted to specific resource types. Your partner or payer request will map to one of these scopes, so a scope the server does not support changes the design before any code is written.
Large export performance
Large exports read heavily from PostgreSQL and depend on how the server uses Redis for caching and job coordination. Ask for documented throughput limits, recommended database sizing, and whether exports can run during business hours without degrading interactive API traffic. Run a timed export against a dataset of realistic size in your own infrastructure.
Plan tier and hosting features
Confirm which Bulk FHIR capabilities are included in the hosted plan you would use and which require a custom Enterprise agreement or the Enterprise Self-Hosted option. Hosted and self-hosted deployments differ in who operates the server, who controls storage for export files, and who answers support requests when an export fails.
Medplum pricingResource types and profiles included
Verify which resource types the export returns, whether custom profiles and extensions appear in the NDJSON output, and whether access policies filter resources before they reach the file. Partners often expect specific US Core or internal profile shapes, so compare a sample export with the data dictionary your recipient has agreed to receive.
Version support and patch windows
Each major Medplum version receives Active support, then Maintenance, with an Enterprise extension for security patches. Critical vulnerabilities have a 7-day patch target and high-severity issues a 14-day target. Plan export jobs and file handling so that the upgrades these targets require do not force an export pipeline to stop unplanned.
- Critical patch target
- 7 days
How DeployOpen scopes and delivers a Medplum export
DeployOpen treats a Bulk FHIR export from a self-hosted Medplum deployment as a scoped delivery: the consuming partner, data set, access model and file handling are agreed in writing first, then built, tested and documented inside your infrastructure. The work is fixed-scope, with ongoing support available as a retainer once the export runs in production.
How we scope
- Written scope names each export consumer, the resource types they need and the population they are entitled to receive.
- Scope records who approves each export request, and which Medplum projects, access policies and client applications the export will use.
- Scope confirms where the NDJSON output lands, how long it is kept and who may download it.
- Scope states the Medplum version and deployment target, so the export is checked against your actual release.
How we build
- We configure the export client, its scoped credentials and access policy so the job reads only what the agreed scope allows.
- We build the scheduling and trigger logic, then test partial, failed and repeated runs against a staging copy of your data.
- We set up secure handling of NDJSON files, including encryption at rest, transfer controls, checksum verification and automatic deletion.
- We test the export against your upgrade path, so a Medplum version change does not silently alter exported content.
How we hand over
- Documentation covers the export configuration, the access policy, the schedule, the file handling steps and the audit trail for each run.
- Runbooks describe how to rerun a failed export, rotate client credentials and respond when a consumer reports missing or unexpected data.
- Your team receives a walkthrough of the build and the test evidence, so operators can run the export without DeployOpen present.
How we support
- Ongoing support covers monitoring of scheduled exports, credential rotation and fixes after Medplum upgrades, available as a retainer.
- Retesting follows any change to the consumer list, resource scope, access policy or Medplum version.

