Prerequisites
- A Corti Console account with an API client — if you haven’t set one up yet, follow Creating API Clients and the Authentication Quickstart. You’ll need your
clientId,clientSecret,tenantName, andenvironment(euorus). - The Corti SDK installed and a client created — install (
@corti/sdkorCorti.Sdk) and initialize a client by following the Authentication Quickstart or the SDKs overview. The SDK handles OAuth 2.0 token acquisition and refresh from your credentials automatically — no manual bearer-token juggling. - A
templateId— the UUID of a stored template to synthesize the note against. Discover Corti Standards or your own viaLIST /documents/templates?lang=<locale>, or browse Corti Standards.
Pick your scenario
Both scenarios end with the same guided document generation call. They differ only in how audio is captured and turned into a transcript.- Real-time ambient scribe
- Asynchronous
Create an interaction
An interaction anchors the session — the transcript and facts your stream produces are persisted under it, and the doc-gen step reads them back.
Only
encounter (with identifier, status, and type) is required. assignedUserId, patient, period, and title are optional — see Create Interaction for the full schema.Capture and stream audio in real time
For live capture in the browser, the Ambient Web Component (
@corti/ambient-web) is the fastest path — the <corti-ambient> element handles microphone permissions, device selection, audio streaming, and transcript/facts delivery for you. Point it at the interactionId from step 1 and configure it for facts (real-time extraction).The web component does not manage OAuth — supply an
accessToken (or a token-refresh function); see the Ambient authentication guide. In production you’d create the interaction server-side and pass the interactionId and token to the browser.The component persists transcripts and (with
mode.type: "facts") extracted facts under the interaction — that’s the data the doc-gen step reasons over. Before generating the note, wait until recording has stopped and audio processing has finished (recording-state-changed reports detail.processing: false, or call closeConnection(), which sends end and waits for the server’s ended response) so every transcript segment and fact is stored.Generate a note from the interaction
Once the session has ended, generate the note by referencing the
interactionId — the SDK pulls the persisted facts and transcript implicitly. templateRef picks the template you want.Full specification: Generate a structured document.
What you get back
Guided document generation returns adocument plus usageInfo:
stringDocument— the rendered per-section output, keyed by section UUID. Always present.structuredDocument— populated when one or more sections declare anoutputSchema. Keyed the same way; each entry holds the schema-typed value (string, number, boolean, object, or array). A string leaf is a validoutputSchema, so string-typed sections show up here too — this field reflects whether a schema was declared, not whether the type is non-string.templateVersionId— the exact template version used. Store it for reproducibility.
Next steps
Beginner's Guide
How facts, sections, templates, and schemas fit together — in plain language.
Guided Document Synthesis
The endpoint reference. Four template-supply paths, input context options, response shape.
Sections & Templates
Author your own sections and templates or inherit from Corti Standards.
Corti Standards library
Browse the curated catalogue to find a
templateId to use in the doc-gen step.Prompting Best-practices
Patterns for
contentPrompt, writingStylePrompt, miscPrompt, and outputSchema descriptions.Customization Guide
Inherit, override at runtime, or author your own — with per-customer and per-user patterns.
Please contact us if you run into issues with your first end-to-end request.