This page provides a complete reference for all API methods available in the Corti Embedded Assistant.Documentation Index
Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
Use this file to discover all available pages before exploring further.
Applies to all integration methodsThis API Reference documents operations available across all three integration approaches:
- Web Component API (recommended) -
cortiEmbeddedElement.methodName() - Window API -
window.CortiEmbedded.v1.methodName() - PostMessage API -
postMessage({ action: 'methodName', payload: {...} })
Examples use Web Component APIAll code examples on this page use the Web Component API pattern for clarity and consistency. This is the recommended integration method for most use cases.
Using the API
In React components
Use theuseCortiEmbeddedApi hook to access API methods:
In vanilla TypeScript / JavaScript
Access API methods through the element reference:The Web Component and React wrapper use the package API. Window API and PostMessage often wrap the same operation in a payload object instead.
Error codes
All API actions may return errors with the following structure:| Code | Description | Common Causes |
|---|---|---|
UNAUTHORIZED | User is not authenticated or session expired | Must call auth first, or session has expired |
NOT_READY | Required precondition not met | Missing interaction, not in recording session, etc. |
NOT_FOUND | Requested resource does not exist | Invalid interaction ID, user not found |
INVALID_PAYLOAD | Request payload validation failed | Missing required fields, invalid formats, constraint violations |
INTERNAL_ERROR | Unexpected server or client error | Retry the request or contact support |
Methods
auth
Authenticate the user session with the embedded Assistant. All payload properties are required and can be found on the response from the authentication service. For convenience, you can simply set the authentication response as the payload directly. Usage:- All fields (
access_token,refresh_token,id_token,token_type) are required - Tokens must be valid JWT strings
INVALID_PAYLOAD: Missing required authentication fieldsUNAUTHORIZED: Invalid or expired tokensINTERNAL_ERROR: Authentication service unavailable
configure
Configure the Assistant interface for the current session, including toggling UI features, visual appearance, and locale settings. Usage:appearance.primaryColor: Must be valid CSS color (hex, rgb, hsl) ornulllocale.interfaceLanguage: Must be one of the supported interface languages (see Configuration Reference) ornulllocale.dictationLanguage: Must be one of the supported dictation languages (see Configuration Reference)locale.overrides: Keys must match known override strings (see Configuration Reference)features.*: Must be boolean valuesnetwork.websocketBaseUrl: Must be a valid URL if provided (typicallywss://in production)
INVALID_PAYLOAD: Invalid color format, unsupported language code, non-boolean feature flagsINTERNAL_ERROR: Failed to apply configuration
features.interactionTitle: truefeatures.aiChat: truefeatures.documentFeedback: truefeatures.navigation: falsefeatures.virtualMode: truefeatures.syncDocumentAction: falsefeatures.templateEditor: trueappearance.primaryColor: null(uses built-in styles)locale.interfaceLanguage: null(uses user’s default or browser setting)locale.dictationLanguage: "en"locale.overrides: {}
createInteraction
Create a new interaction session. Usage:auth must be called first)
Input validation:
encounter.identifier: Required, non-empty stringencounter.status: Must be one of:"planned","in-progress","completed","cancelled"encounter.type: Must be one of:"ambulatory","emergency","field","first_consultation","home_health","inpatient_encounter","short_stay","virtual"encounter.period.startedAt: Required, must be valid ISO 8601 datetime stringencounter.title: Optional stringassignedUserId: Optional string ornullpatient: Optional object with patient demographic informationpatient.identifier: Optional string (patient identifier from external system)patient.name: Optional string (patient’s full name)patient.gender: Optional, must be one of:"male","female","other","unknown"patient.birthDate: Optional string ornull(ISO 8601 date format)patient.pronouns: Optional string (preferred pronouns)
UNAUTHORIZED: User not authenticated, callauthfirstINVALID_PAYLOAD: Missing required fields, invalid encounter status/type, invalid date formatINTERNAL_ERROR: Failed to create interaction
addFacts
Add contextual facts to the current interaction. Usage:- User must be authenticated
- An interaction must exist (call
createInteractionfirst)
- Web Component / React: pass an array of facts
- Window API / PostMessage: pass
{ facts: [...] } facts[].text: Required, non-empty stringfacts[].group: Optional string, defaults to"other"if not providedfacts[].source: Optional, defaults to"user"
NOT_READY: No active interaction, callcreateInteractionfirstUNAUTHORIZED: User not authenticatedINVALID_PAYLOAD: Empty facts array, missing text fieldINTERNAL_ERROR: Failed to save facts
void
configureSession
Set session-level defaults and preferences. This method will not overwrite defaults set by the user.defaultTemplateKey and defaultOutputLanguage must be provided together. If one is missing, the method returns INVALID_PAYLOAD.defaultOutputLanguage has no effect on its own. It is only used together with defaultTemplateKey to resolve the template.defaultLanguage: Must be valid language code (e.g.,"en-US","da-DK")defaultOutputLanguage: Must be valid language codedefaultTemplateKey: Must be a language-agnostic template identifierdefaultMode: Must be either"virtual"or"in-person"- All fields are optional, but if either
defaultTemplateKeyordefaultOutputLanguageis provided, both must be provided together defaultTemplateKeyanddefaultOutputLanguagemust be set together
UNAUTHORIZED: User not authenticatedINVALID_PAYLOAD: Invalid payload (including when only one ofdefaultTemplateKeyordefaultOutputLanguageis provided)NOT_FOUND: No template matchesdefaultTemplateKey+defaultOutputLanguage. CallgetTemplatesfirst to verify the template exists for the selected language.INTERNAL_ERROR: Failed to update session settings
void
navigate
Navigate to a specific path within the embedded Assistant. Usage:- Web Component / React: pass the path string directly
- Window API / PostMessage: pass
{ path: "/..." } path: Required, must start with/path: Cannot be a full URL (nohttp://,https://, or//protocol)path: Must be a relative path within the application
/– Root/home/session/<id>– Specific session/templates– Template browser/settings/*– Settings pages
INVALID_PAYLOAD:- Path does not start with
/→"Path must be a relative path starting with '/'" - Path is a full URL →
"Path must be a relative path, not a full URL"
- Path does not start with
INTERNAL_ERROR: Navigation failed
void
Navigable URLs:
/– start a new session/session/<id>- go to an existing session identified by<id>/templates- browse and create templates/settings/preferences- edit defaults like languages and default session settings/settings/input- edit dictation input settings/settings/account- edit general account settings/settings/archive- view items in and restore from archive (only relevant if navigation is visible)
setCredentials
Change the credentials of the currently authenticated user. Can be used to set credentials for a user without a password (if only authenticated via identity provider) or to change the password of a user with an existing password. Password policy:- At least 1 uppercase, 1 lowercase, 1 numerical and 1 special character
- At least 8 characters long
password: Required string- Password must meet policy requirements:
- Minimum 8 characters
- At least 1 uppercase letter (A-Z)
- At least 1 lowercase letter (a-z)
- At least 1 number (0-9)
- At least 1 special character
UNAUTHORIZED: User not authenticatedINVALID_PAYLOAD:- Password too short →
"Password does not meet requirements" - Missing required character types →
"Password does not meet requirements"
- Password too short →
INTERNAL_ERROR: Failed to update password
void
startRecording
Start recording within the embedded session. Usage:- User must be authenticated (call
auth) - An interaction must exist (call
createInteraction) - Application must be in an interview/session context
NOT_READY:"Must be in an interview to start recording"– Not in interview context"No interaction ID found. Call createInteraction first"– No active interaction
UNAUTHORIZED:"Not authenticated. Call auth first"– No valid session
NOT_FOUND:"Interaction not found"– Interaction ID is invalidINTERNAL_ERROR: Failed to connect to recording service (WebSocket error)
void
stopRecording
Stop recording within the embedded session. Usage:startRecording first)
Input validation: None (no payload required)
Possible errors:
NOT_READY:"Must be in an interview to stop recording"– Not in active recording sessionINTERNAL_ERROR: Failed to disconnect from recording service
void
getStatus
Request information about the current state of the application, including authentication status, current user, current URL and interaction details. Usage:- This action does not throw structured error codes
- Very rare, typically always succeeds
- May return partial data if specific queries fail (e.g.,
interactionwill benullif fetch fails)
getTemplates
Retrieve all document templates available to the authenticated user. This includes both built-in templates provided by Corti and custom templates created by the user themself. Usage:auth must be called first)
Input validation: None (no payload required)
Possible errors:
UNAUTHORIZED: User not authenticated, callauthfirstINTERNAL_ERROR: Failed to fetch templates from server
- Display a template picker UI for users to select their preferred documentation template
- Filter templates by language to match the current session settings
- Distinguish between built-in and custom templates using the
isCustomflag - Pre-populate template selection based on user preferences or defaults
Common workflows
Initialize and start recording
Error handing best practice
Complete session lifecycle
Configuration reference
Available interface languages
Updated February 2026
| Language code | Language |
|---|---|
en | English |
de-DE | German |
fr-FR | French |
it-IT | Italian |
sv-SE | Swedish |
da-DK | Danish |
nb-NO | Norwegian Bokmål |
nn-NO | Norwegian Nynorsk |
Available Dictation Languages
Updated February 2026
EU
| Language code | Language |
|---|---|
en | English |
en-GB | British English |
de | German |
fr | French |
sv | Swedish |
da | Danish |
nl | Dutch |
no | Norwegian |
US
| Language code | Language |
|---|---|
en | English |
Known strings to override
Currently, only the following keys are exposed for override:| Key | Default value | Purpose |
|---|---|---|
interview.document.syncDocument.label | ”Synchronize document” | The button text for the “synchronize document” button if enabled. |
Appearance configuration
Disclaimer - always ensure WCAG 2.2 AA conformance
- 1.4.3 Contrast (Minimum): normal text ≥ 4.5:1; large text ≥ 3:1
- 1.4.11 Non-text Contrast: UI boundaries, focus rings, and selected states ≥ 3:1
- 2.4.11 Focus Not Obscured (Minimum): focus indicators remain visible and unobstructed
Related documentation
- PostMessage API - Learn how to use the PostMessage integration method
- Window API - Learn how to use the Window API integration method
- Welcome - Overview of Corti Assistant and integration options
Please contact us for help or questions.