WebSocket Secure (WSS) API Documentation for /stream endpoint
/stream
API enables real-time, bidirectional communication with the Corti system for interaction streaming. Clients can send and receive structured data, including transcripts and fact updates. Learn more about FactsR™ here.
This documentation provides a structured guide for integrating the Corti WSS API for real-time interaction streaming.
/stream
endpoint supports real-time ambient documentation interactions and clinical decision support workflows.Environment | Description |
---|---|
us | US-based instance |
eu | EU-based instance |
wss://
scheme and provide a valid interaction ID in the URL.
websocketUrl
for that interaction including the tenant-name
as url parameter.
The authentication for the WSS stream requires in addition to the tenant-name
parameter a token
parameter to pass in the Bearer access token.transcripts
and facts
and recording(s)
in the relevant REST endpoints. Audio recordings are saved as .webm format.
This can be configured by Corti to be turned off to ensure you can comply with your applicable regulations and data handling preferences.Property | Type | Description |
---|---|---|
type | string | ”transcript” |
data | array of objects | Transcript segments |
data[].id | string | Unique identifier for the transcript |
data[].transcript | string | The transcribed text |
data[].final | boolean | Indicates whether the transcript is finalized or interim |
data[].speakerId | integer | Speaker identifier (-1 if diarization is off) |
data[].participant.channel | integer | Audio channel number (e.g. 0 or 1) |
data[].time.start | number | Start time of the transcript segment |
data[].time.end | number | End time of the transcript segment |
Property | Type | Description |
---|---|---|
type | string | ”facts” |
fact | array of objects | Fact objects |
fact[].id | string | Unique identifier for the fact |
fact[].text | string | Text description of the fact |
fact[].group | string | Categorization of the fact (e.g., “medical-history”) |
fact[].groupId | string | Unique identifier for the group |
fact[].isDiscarded | boolean | Indicates if the fact was discarded |
fact[].source | string | Source of the fact (e.g., “core”) |
fact[].createdAt | string (date-time) | Timestamp when the fact was created |
fact[].updatedAt | string or null (date-time) | Timestamp when the fact was last updated |
CONFIG_ACCEPTED
before transmitting other data.
Property | Type | Required | Description |
---|---|---|---|
type | string | Yes | ”config” |
configuration | object | Yes | Configuration settings |
configuration.transcription.primaryLanguage | string (enum) | Yes | Primary spoken language for transcription |
configuration.transcription.isDiarization | boolean | No - false | Enable speaker diarization |
configuration.transcription.isMultichannel | boolean | No - false | Enable multi-channel audio processing |
configuration.transcription.participants | array | Yes | List of participants with roles assigned to a channel |
configuration.transcription.participants[].channel | integer | Yes | Audio channel number (e.g. 0 or 1) |
configuration.transcription.participants[].role | string (enum) | Yes | ”doctor”, “patient”, or “multiple” |
configuration.mode.type | string (enum) | Yes | ”facts” or “transcription” |
configuration.mode.outputLocale | string (enum) | No | Output language locale (required for facts ) |
type: "ENDED"
and closes the connection.
connect
),
the socket will close itself without reconnecting when it receives an ENDED
message.
When using manual configuration, the socket will attempt to reconnect after the server closes the connection. To prevent this,
you must subscribe to the ENDED
message and manually close the connection.
isMultichannel: false
and audio will be converted to mono-channel, ensuring no duplicate transcripts are being returned.
In a virtual setting such as telehealth, you would typically have the virtual audio on one channel from webRTC and mix in on a separate channel the microphone of the local client. In this scenario, define isMultichannel: true
and assign each channel the relevant participant role, e.g. if the doctor is on the local client and channel 0, then you can set the role for channel 0 to doctor
.
Diarization is independent of audio channels and participant roles. If you want transcript segments to be assigned to automatically identified speakers, set isDiarization: true
. If false
, transcript segments will be returned with speakerId: -1
. If set to true
, then diarization will try to identify speakers separately on each channel. The first identified speaker on each channel will have transcript segments with speakerId: 0
, the second speakerId: 1
and so forth.
sendAudio
method on the stream socket. Audio should be sent as binary chunks (e.g., ArrayBuffer):
reason: language unavailable
Once configuration has been accepted and the session is running, you may encounter runtime or application-level errors.
These are sent as JSON objects with the following structure:
usage
and type ENDED
.
error
event and automatically close the socket. You can also inspect the original message in the message
handler. With manual configuration, configuration errors are only received as messages (not as error
events), and you must close the socket manually to avoid reconnection.
connect
),
the socket will close itself without reconnecting when it receives an ENDED
message.
When using manual configuration, the socket will attempt to reconnect after the server closes the connection. To prevent this,
you must subscribe to the ENDED
message and manually close the connection.