Upload a document
Upload a document for a patient. Accepts PDF, JPEG, PNG, and DOCX files up to 10MB. Pass an optional external_id form field to attach a caller-supplied identifier (immutable once set; unique per organization).
Text extraction runs asynchronously. This endpoint returns as soon as the file is stored — it does not wait for extraction (which can take 10–30s for a PDF). The returned document is typically in pending status (extraction may occasionally finish before the response is built). Track progress by polling GET /patients/{patientId}/documents (pass ?external_id=<your id> to fetch just this document) until its status is completed (has_extracted_text becomes true) or failed. Note: these endpoints report extraction status and availability (status, has_extracted_text, extracted_text_length) — the extracted text content itself is not returned. You can (re-)trigger extraction at any time with POST /patients/{patientId}/documents/{documentId}/extract.
Authorizations
API key obtained from /api/v1/ext-api-keys
Path Parameters
Patient ID
"1743552000000"
Body
Response
Document uploaded. The file is stored and, in the normal case, text extraction is queued to run asynchronously — the returned document is then typically pending. If extraction could not be queued, the file is still saved and message reflects that (trigger extraction later via the extract endpoint). Poll the GET endpoint to track extraction status.
Human-readable status. text extraction started when extraction was queued; Document uploaded successfully if the file was stored but extraction could not be queued (retry via the extract endpoint).
"Document uploaded successfully; text extraction started"

