Quickstart Code Example
Generate a synthetic patient and download its record and documents — in Python
This page asks for one patient with a few facts of your choosing, waits for the job to finish,
and saves the patient’s FHIR bundle and clinical documents. It uses only the requests
library.
Create an API key with the synth:process scope on the
emtelligent platform, then set it in the environment:
Create a session
Authentication is a bearer token in the Authorization header: an API key, or an
OAuth 2.0 access token.
Submit a job
Every field of a request is optional: an empty request generates a random patient. This one
describes the patient and asks for four documents, as a FHIR bundle and as text. The
Idempotency-Key makes the submission safe to retry: sending the same key and body again
returns the original job instead of creating, and charging for, a second one.
Wait for it to finish
A patient usually takes one to five minutes, depending on how many documents you ask for.
Download the results
Each result is listed in job["results"] with the URL to download it from.
Each result can be downloaded once: a second request returns 410 result_expired.
Save it before you do anything else with it. Results not downloaded within 24 hours are
deleted.
fhir_bundle.json is a FHIR R4 transaction bundle you can post to a FHIR server.
notes.zip holds one text file per document, in date order, with a manifest.json
describing each. result.json is the patient’s full record. See
Results for the formats.
Next steps
- Generating a patient: everything you can ask for, document types, and reproducing a patient
- Generating a cohort: many patients in a shared health system
- Results: the FHIR bundle, documents, PDFs, and Bulk Data
Complete example
The steps above in one script. Save it as synth_quickstart.py, set SYNTH_API_KEY as at the
top of this page, and run python synth_quickstart.py.
To generate many patients in one health system instead, see Generating a cohort.

