Class: Session
A live Session object. Every field from the API response is available directly
on the object (e.g. session.title, session.status), and the object also
exposes action methods (start(), stop(), getMessages(), watch(), …).
Extends
Constructors
new Session()
Internal
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | ClientContext | - |
_projectId | string | - |
data | object | - |
data.createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z |
data.createdByUserId | string | Description ID of the user who created the session Example user_123 |
data.externalRoomId | string | Description External Room ID Example room_abc123 |
data.gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io |
data.id | string | Description Session ID Example sess_789 |
data.idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 |
data.projectId | string | Description Project ID Example proj_123 |
data.status | string | Description Session Status Example active |
data.tenantId | string | Description Tenant ID Example tenant_456 |
data.title | string | Description Session Title Example Daily Standup |
Returns
Inherited from
SessionResponse.constructor
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:137
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z | SessionResponse.createdAt | 4Players/cortex-typescript-sdk/src/types.ts:2036 |
createdByUserId | string | Description ID of the user who created the session Example user_123 | SessionResponse.createdByUserId | 4Players/cortex-typescript-sdk/src/types.ts:2030 |
externalRoomId | string | Description External Room ID Example room_abc123 | SessionResponse.externalRoomId | 4Players/cortex-typescript-sdk/src/types.ts:2010 |
gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io | SessionResponse.gateway | 4Players/cortex-typescript-sdk/src/types.ts:2020 |
id | string | Description Session ID Example sess_789 | SessionResponse.id | 4Players/cortex-typescript-sdk/src/types.ts:2000 |
idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 | SessionResponse.idleTimeout | 4Players/cortex-typescript-sdk/src/types.ts:2046 |
projectId | string | Description Project ID Example proj_123 | SessionResponse.projectId | 4Players/cortex-typescript-sdk/src/types.ts:2015 |
status | string | Description Session Status Example active | SessionResponse.status | 4Players/cortex-typescript-sdk/src/types.ts:2041 |
tenantId | string | Description Tenant ID Example tenant_456 | SessionResponse.tenantId | 4Players/cortex-typescript-sdk/src/types.ts:2005 |
title | string | Description Session Title Example Daily Standup | SessionResponse.title | 4Players/cortex-typescript-sdk/src/types.ts:2025 |
Accessors
data
The raw API response object.
Deprecated
The response fields are now available directly on this object
(e.g. session.title instead of session.data.title). This accessor will be
removed before the stable release.
Returns
object
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z | 4Players/cortex-typescript-sdk/src/types.ts:2036 |
createdByUserId | string | Description ID of the user who created the session Example user_123 | 4Players/cortex-typescript-sdk/src/types.ts:2030 |
externalRoomId | string | Description External Room ID Example room_abc123 | 4Players/cortex-typescript-sdk/src/types.ts:2010 |
gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io | 4Players/cortex-typescript-sdk/src/types.ts:2020 |
id | string | Description Session ID Example sess_789 | 4Players/cortex-typescript-sdk/src/types.ts:2000 |
idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 | 4Players/cortex-typescript-sdk/src/types.ts:2046 |
projectId | string | Description Project ID Example proj_123 | 4Players/cortex-typescript-sdk/src/types.ts:2015 |
status | string | Description Session Status Example active | 4Players/cortex-typescript-sdk/src/types.ts:2041 |
tenantId | string | Description Tenant ID Example tenant_456 | 4Players/cortex-typescript-sdk/src/types.ts:2005 |
title | string | Description Session Title Example Daily Standup | 4Players/cortex-typescript-sdk/src/types.ts:2025 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:153
Methods
downloadDebugAudio()
Download the debug audio WAV file that was sent to the transcription API for a specific message. Only available when debug audio is enabled on the project settings and within the 24-hour retention window. Use this to investigate transcription quality issues (audio glitches, noise, etc).
Check message.hasDebugAudio on a Message to determine whether a
recording is available before calling this method.
Parameters
| Parameter | Type | Description |
|---|---|---|
messageId | string | Message ID whose debug audio should be downloaded |
Returns
Promise<Blob>
WAV audio data as a Blob
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:233
getActions()
Get available plugin actions for this session, grouped by the plugin that contributes them. Use this to render action menus (e.g. "Generate minutes").
Returns
Promise<object>
The session's available plugin actions
| Name | Type | Description | Defined in |
|---|---|---|---|
plugins | object[] | Description Plugins (with their actions) available for this session | 4Players/cortex-typescript-sdk/src/types.ts:2116 |
sessionId | string | Description Session ID the actions apply to | 4Players/cortex-typescript-sdk/src/types.ts:2114 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:188
getMessages()
Get the message transcript for this session
Returns
Promise<object[]>
Array of messages
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:201
regenerateSummary()
Regenerate the summary for this session
Returns
Promise<void>
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:213
start()
Start this session (command the bot to join the room)
Returns
Promise<object>
Start confirmation
| Name | Type | Description | Defined in |
|---|---|---|---|
message | string | Description Status message Example Bot start command sent | 4Players/cortex-typescript-sdk/src/types.ts:2053 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:161
stop()
Stop this session (command the bot to leave the room)
Returns
Promise<object>
Stop confirmation
| Name | Type | Description | Defined in |
|---|---|---|---|
message | string | Description Status message Example Bot stop command sent | 4Players/cortex-typescript-sdk/src/types.ts:2060 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:174
watch()
Live-subscribe to this session. The initial value is loaded via REST, then
kept in sync over SSE; current becomes undefined if the session is deleted.
Returns
DocumentSubscription<object>
A DocumentSubscription for this session
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z | 4Players/cortex-typescript-sdk/src/types.ts:2036 |
createdByUserId | string | Description ID of the user who created the session Example user_123 | 4Players/cortex-typescript-sdk/src/types.ts:2030 |
externalRoomId | string | Description External Room ID Example room_abc123 | 4Players/cortex-typescript-sdk/src/types.ts:2010 |
gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io | 4Players/cortex-typescript-sdk/src/types.ts:2020 |
id | string | Description Session ID Example sess_789 | 4Players/cortex-typescript-sdk/src/types.ts:2000 |
idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 | 4Players/cortex-typescript-sdk/src/types.ts:2046 |
projectId | string | Description Project ID Example proj_123 | 4Players/cortex-typescript-sdk/src/types.ts:2015 |
status | string | Description Session Status Example active | 4Players/cortex-typescript-sdk/src/types.ts:2041 |
tenantId | string | Description Tenant ID Example tenant_456 | 4Players/cortex-typescript-sdk/src/types.ts:2005 |
title | string | Description Session Title Example Daily Standup | 4Players/cortex-typescript-sdk/src/types.ts:2025 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:254
watchMessageAnnotations()
Live-subscribe to message annotations for this session's messages.
The initial snapshot fetches the session's messages and batches their
annotations from the plugin catalog. message.annotation.created events
fold new annotations in as plugins emit them.
Note: message.annotation.created is message-scoped (its resourceId
is message:{id}, not the session) and the reducer can't cheaply verify
which session a given messageId belongs to. Consumers should group the
returned annotations by messageId and only render the ones for messages
they already know belong to this session — i.e. pair this watch with
watchMessages or getMessages and use that messageId set as the
filter on the rendering side.
Returns
CollectionSubscription<object>
A CollectionSubscription of MessageAnnotations.
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:2392 |
data | object | Description Annotation data | 4Players/cortex-typescript-sdk/src/types.ts:2385 |
id | string | Description Annotation UUID | 4Players/cortex-typescript-sdk/src/types.ts:2374 |
messageId | string | Description Message ID this annotation is attached to | 4Players/cortex-typescript-sdk/src/types.ts:2394 |
pluginInstanceId? | string | Description Plugin instance that created this | 4Players/cortex-typescript-sdk/src/types.ts:2378 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:2376 |
type | "profanity" | "summary" | "action_items" | "sentiment" | Description Annotation type | 4Players/cortex-typescript-sdk/src/types.ts:2383 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:318
watchMessages()
Live-subscribe to this session's transcript. The initial messages are loaded
via REST, then new messages are appended as they are transcribed (kept
in chronological order to match getMessages()'s server-side ordering).
Returns
CollectionSubscription<object>
A CollectionSubscription of messages
| Name | Type | Description | Defined in |
|---|---|---|---|
content | string | Description Message content Example Hello team! | 4Players/cortex-typescript-sdk/src/types.ts:2145 |
hasDebugAudio | boolean | Description Whether a debug audio WAV file is available for download Default false | 4Players/cortex-typescript-sdk/src/types.ts:2156 |
id | string | Description Message ID Example msg_123 | 4Players/cortex-typescript-sdk/src/types.ts:2123 |
senderName | string | Description Sender name (or [System] for system messages) Example Alice | 4Players/cortex-typescript-sdk/src/types.ts:2140 |
sessionId | string | Description Session ID Example sess_789 | 4Players/cortex-typescript-sdk/src/types.ts:2128 |
timestamp | string | Format: date-time Description Timestamp Example 2023-10-01T10:05:00Z | 4Players/cortex-typescript-sdk/src/types.ts:2151 |
type | "user" | "system" | Description Message type: user (transcribed speech) or system (join/leave events) Default user Example user @enum {string} | 4Players/cortex-typescript-sdk/src/types.ts:2135 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:264
watchSessionAnnotations()
Live-subscribe to session-level annotations for this session (summaries,
action items, etc.). The initial snapshot fetches the existing annotations
from the plugin catalog and session.annotation.created events scoped to
this session (resourceId === session:{id}) fold new ones in.
Returns
CollectionSubscription<object>
A CollectionSubscription of SessionAnnotations.
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:2507 |
data | object | Description Annotation data | 4Players/cortex-typescript-sdk/src/types.ts:2500 |
id | string | Description Annotation UUID | 4Players/cortex-typescript-sdk/src/types.ts:2489 |
pluginInstanceId? | string | Description Plugin instance that created this | 4Players/cortex-typescript-sdk/src/types.ts:2493 |
sessionId | string | Description Session ID this annotation is attached to | 4Players/cortex-typescript-sdk/src/types.ts:2509 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:2491 |
type | "profanity" | "summary" | "action_items" | "sentiment" | Description Annotation type | 4Players/cortex-typescript-sdk/src/types.ts:2498 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:380