Skip to main content

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()​

new Session(
ctx,
_projectId,
data): Session

Internal

Parameters​

ParameterTypeDescription
ctxClientContext-
_projectIdstring-
dataobject-
data.createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z
data.createdByUserIdstringDescription ID of the user who created the session Example user_123
data.endedAt?null | stringFormat: date-time Description When the session was stopped. Set the first time the session goes to inactive (manual stop, the owning gathering ending or being cancelled, or the bot idle timeout) and cleared again if the session is restarted. Null while the session is running, and for sessions created with autoStart: false that were never started. Example 2023-10-01T11:30:00Z
data.externalRoomIdstringDescription External Room ID Example room_abc123
data.gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.io
data.idstringDescription Session ID Example sess_789
data.idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300
data.projectIdstringDescription Project ID Example proj_123
data.statusstringDescription Session Status Example active
data.tenantIdstringDescription Tenant ID Example tenant_456
data.titlestringDescription Session Title Example Daily Standup

Returns​

Session

Inherited from​

SessionResponse.constructor

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:179

Properties​

PropertyTypeDescriptionInherited fromDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00ZSessionResponse.createdAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2032
createdByUserIdstringDescription ID of the user who created the session Example user_123SessionResponse.createdByUserIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2026
endedAt?null | stringFormat: date-time Description When the session was stopped. Set the first time the session goes to inactive (manual stop, the owning gathering ending or being cancelled, or the bot idle timeout) and cleared again if the session is restarted. Null while the session is running, and for sessions created with autoStart: false that were never started. Example 2023-10-01T11:30:00ZSessionResponse.endedAtodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2043
externalRoomIdstringDescription External Room ID Example room_abc123SessionResponse.externalRoomIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2006
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.ioSessionResponse.gatewayodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2016
idstringDescription Session ID Example sess_789SessionResponse.idodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:1996
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300SessionResponse.idleTimeoutodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2048
projectIdstringDescription Project ID Example proj_123SessionResponse.projectIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2011
statusstringDescription Session Status Example activeSessionResponse.statusodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2037
tenantIdstringDescription Tenant ID Example tenant_456SessionResponse.tenantIdodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2001
titlestringDescription Session Title Example Daily StandupSessionResponse.titleodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2021

Accessors​

data​

get data(): object

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

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2032
createdByUserIdstringDescription ID of the user who created the session Example user_123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2026
endedAt?null | stringFormat: date-time Description When the session was stopped. Set the first time the session goes to inactive (manual stop, the owning gathering ending or being cancelled, or the bot idle timeout) and cleared again if the session is restarted. Null while the session is running, and for sessions created with autoStart: false that were never started. Example 2023-10-01T11:30:00Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2043
externalRoomIdstringDescription External Room ID Example room_abc123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2006
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.ioodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2016
idstringDescription Session ID Example sess_789odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:1996
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2048
projectIdstringDescription Project ID Example proj_123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2011
statusstringDescription Session Status Example activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2037
tenantIdstringDescription Tenant ID Example tenant_456odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2001
titlestringDescription Session Title Example Daily Standupodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2021

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:195

Methods​

downloadDebugAudio()​

downloadDebugAudio(messageId): Promise<Blob>

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​

ParameterTypeDescription
messageIdstringMessage ID whose debug audio should be downloaded

Returns​

Promise<Blob>

WAV audio data as a Blob

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:327


getActions()​

getActions(): Promise<object>

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

NameTypeDescriptionDefined in
pluginsobject[]Description Plugins (with their actions) available for this sessionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2151
sessionIdstringDescription Session ID the actions apply toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2149

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:230


getMessages()​

getMessages(): Promise<object[]>

Get the whole message transcript for this session, in order, with the hasDebugAudio flag on every message. This is the full-list read: fine for showing a finished session, wrong for polling — use listMessages (cursor + ETag) for anything that runs in a loop.

Returns​

Promise<object[]>

Array of messages

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:246


listMessages()​

listMessages(query)​

listMessages(query?): Promise<MessagePage>

Read one page of the transcript by cursor — the read built for polling.

Every message has a per-session seq. Ask for after: <seq> to get only newer messages, keep latestSeq of the response as the next after, and pass it (or the page's etag) as ifNoneMatch: while nothing changed the call resolves to null (HTTP 304), which costs Cortex one Redis read and no database query. include attaches plugin annotations and/or the hasDebugAudio flag per message; both are omitted unless asked for.

let after = 0;
for (;;) {
const page = await session.listMessages({ after, limit: 200, include: ["annotations"] }, { ifNoneMatch: `"${after}"` });
if (page) { render(page.messages); after = page.latestSeq; }
await sleep(2000);
}
Parameters​
ParameterTypeDescription
query?objectafter (cursor), limit (1–200, default 50), order (asc walks forward, desc newest first), include
query.after?numberDescription Cursor: only messages with a seq greater than this. Pass the nextCursor (or latestSeq) of the previous response. 0 or omitted starts at the beginning.
query.include?("annotations" | "debugAudio")[]Description Extras to include per message, comma-separated or repeated: annotations (plugin annotations) and/or debugAudio (the hasDebugAudio flag). Each costs one extra query; omit what you do not need.
query.limit?numberDescription Page size (1–200). Defaults to 50.
query.order?"asc" | "desc"Description asc (default) walks the transcript forward from after; desc returns the newest page first (no continuation cursor).
Returns​

Promise<MessagePage>

The page, or null when the server answered 304 Not Modified

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:279

listMessages(query, options)​

listMessages(query, options): Promise<null | MessagePage>
Parameters​
ParameterType
queryundefined | object
optionsListMessagesOptions
Returns​

Promise<null | MessagePage>

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:280


regenerateSummary()​

regenerateSummary(): Promise<void>

Regenerate the summary for this session

Returns​

Promise<void>

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:307


start()​

start(): Promise<object>

Start this session (command the bot to join the room)

Returns​

Promise<object>

Start confirmation

NameTypeDescriptionDefined in
messagestringDescription Status message Example Bot start command sentodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2088

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:203


stop()​

stop(): Promise<object>

Stop this session (command the bot to leave the room)

Returns​

Promise<object>

Stop confirmation

NameTypeDescriptionDefined in
messagestringDescription Status message Example Bot stop command sentodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2095

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:216


watch()​

watch(): DocumentSubscription<object>

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

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2032
createdByUserIdstringDescription ID of the user who created the session Example user_123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2026
endedAt?null | stringFormat: date-time Description When the session was stopped. Set the first time the session goes to inactive (manual stop, the owning gathering ending or being cancelled, or the bot idle timeout) and cleared again if the session is restarted. Null while the session is running, and for sessions created with autoStart: false that were never started. Example 2023-10-01T11:30:00Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2043
externalRoomIdstringDescription External Room ID Example room_abc123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2006
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.ioodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2016
idstringDescription Session ID Example sess_789odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:1996
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2048
projectIdstringDescription Project ID Example proj_123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2011
statusstringDescription Session Status Example activeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2037
tenantIdstringDescription Tenant ID Example tenant_456odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2001
titlestringDescription Session Title Example Daily Standupodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2021

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:348


watchMessageAnnotations()​

watchMessageAnnotations(): CollectionSubscription<object>

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.

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2173
dataobjectDescription Annotation dataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2166
idstringDescription Annotation UUIDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2155
messageIdstringDescription Message ID this annotation is attached toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2175
pluginInstanceId?stringDescription Plugin instance that created thisodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2159
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2157
type"profanity" | "summary" | "action_items" | "sentiment"Description Annotation typeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2164

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:415


watchMessages()​

watchMessages(): CollectionSubscription<object>

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

NameTypeDescriptionDefined in
annotations?object[]Description Plugin annotations of this message. Only present when the request includes annotations.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2226
contentstringDescription Message content Example Hello team!odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2213
externalUserId?null | stringDescription External user ID of the speaker from ODIN (null for system messages)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2203
hasDebugAudiobooleanDescription Whether a debug audio WAV file is available for download. Only computed when the request includes debugAudio (or on the legacy full-list read); otherwise omitted. Default falseodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2224
idstringDescription Message ID Example msg_123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2182
participantId?null | stringDescription Participant who spoke (null for system messages)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2201
senderNamestringDescription Sender name (or [System] for system messages) Example Aliceodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2208
seqnumberDescription Per-session sequence number, starting at 1 and gap-free. Use it as the after cursor of the messages route and as the value of If-None-Match when polling. Example 42odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2192
sessionIdstringDescription Session ID Example sess_789odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2187
timestampstringFormat: date-time Description Timestamp Example 2023-10-01T10:05:00Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2219
type"user" | "system"Description Message type: user (transcribed speech) or system (join/leave events) Default user Example user @enum {string}odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2199

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:358


watchSessionAnnotations()​

watchSessionAnnotations(): CollectionSubscription<object>

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.

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2588
dataobjectDescription Annotation dataodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2581
idstringDescription Annotation UUIDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2570
pluginInstanceId?stringDescription Plugin instance that created thisodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2574
sessionIdstringDescription Session ID this annotation is attached toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2590
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2572
type"profanity" | "summary" | "action_items" | "sentiment"Description Annotation typeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2579

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/sessions.ts:483