Upload document
Uploads a clinical PDF or image for OCR and emits an unstructured_report or clinical_note event log.
POST
sdk:event-log
The SDK requests a presigned URL, PUTs the binary (with matching Content-Type), commits, and returns a DocumentHandle — call wait() or poll() until a terminal status. You choose log_type and labels; the platform does not infer them from the file. processing_mode=segmented_notes treats the file as a container spanning many encounters: omit timestamp and the platform emits one clinical_note per detected visit entry, each dated from the document’s own content. See the resource ingestion guide for supported formats, the textize/OCR pipeline, and held segments.
Parameters
str
required
Olira patient id that owns the document.
str | Path
required
Local filesystem path to a PDF or supported image (max 100 MB).
DocumentLogType | str
required
“unstructured_report” (requires document_type) or “clinical_note” (requires note_type + source).
str
required
Stable key for this document; reusing after leaving pending_upload returns 409.
datetime | None
Clinical timestamp for the emitted event log (timezone-aware preferred). Required for processing_mode=single_document; must be omitted for segmented_notes, where each note is dated from the document’s content.
DocumentProcessingMode | str
default:"\"single_document\""
single_document emits one log for the whole file at the timestamp you supply. segmented_notes emits one clinical_note per detected encounter, each dated from the OCR text — requires log_type=clinical_note and no timestamp.
dict | None
segmented_notes only. Bounds and disambiguates inferred dates: {“from”: “2018-03”, “to”: “2025-01”, “day_first”: True}. from/to accept YYYY, YYYY-MM, or a full ISO date.
dict | None
segmented_notes only. What each page holds, in page order: {“pages”: [{“left”: “identity card”, “right”: “clinical notes”}]}. Used to recognise non-note leaves.
str | None
Required for unstructured_report. Catalog enum (e.g. clinical_note, lab_report, discharge_summary).
str | None
Required for clinical_note. Catalog enum (e.g. progress_note, history_and_physical).
Any | None
Required for clinical_note (e.g. ehr_integration, manual_entry, or structured Source).
str | None
MIME type override; defaults from filename (application/pdf, image/png, …).
bool
default:"False"
When True, block until a terminal status before returning the handle.
float
default:"600.0"
Timeout for wait=True / handle.wait().
Returns
DocumentHandle — Poll/wait handle; .document is the current DocumentResource snapshot.
str
Document resource id.
DocumentStatus
pending_upload | uploaded | ocr_running | ocr_complete | segmenting | log_emitted | logs_emitted | ocr_failed | segmentation_failed.
str | None
Emitted event log id when status is log_emitted (single_document).
list[str]
Per-encounter event log ids when status is logs_emitted (segmented_notes).
list[DocumentSegment]
Detected encounters: index, page range, resolved timestamp, status (emitted | held) and hold_reason.
int | None
Segments that became logs. See also segments_detected / segments_held.
int | None
Non-whitespace characters in no segment and no classified region — a dropped-content signal.
int | None
Pages processed by OCR when available.
str | None
Failure detail when status is ocr_failed or segmentation_failed.
Guide: /send-data/resource-ingestion.
On the presigned PUT, send Content-Type matching the upload-url request; omit the SDK Authorization header.
There is no human confirmation on this path — commit starts OCR immediately.

