Send GET [base]/Patient/$export with headers Accept: application/fhir+json and Prefer: respond-async; optionally include _type, _since, and _outputFormat query parameters
Expect a 202 Accepted response; capture the Content-Location header — this is the polling URL for the export status
Poll the Content-Location URL with GET; while the export is in progress the server returns 202 with an optional X-Progress header describing status
When the export is complete the server returns 200 with a JSON manifest body; parse the output array, each element containing type and url fields pointing to NDJSON files
Download each NDJSON file using authenticated GET requests; each line is a valid FHIR resource JSON object of the indicated type
After processing, send DELETE to the Content-Location URL to signal the server it may clean up the export artifacts
Known gotchas
The Prefer: respond-async header is required; omitting it may cause the server to attempt a synchronous response or return an error
_outputFormat defaults to application/fhir+ndjson; if you specify a different value confirm the server supports it via CapabilityStatement before requesting
NDJSON files may be split across multiple files per resource type; iterate all entries in the output array for a given type, not just the first
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp