Skip to main content

Class: ApiKeyManager

Manages API keys for the tenant.

Constructors​

new ApiKeyManager()​

new ApiKeyManager(ctx): ApiKeyManager

Internal

Parameters​

ParameterType
ctxClientContext

Returns​

ApiKeyManager

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:29

Methods​

create()​

create(body): Promise<object>

Create a new API key

Parameters​

ParameterTypeDescription
bodyobjectAPI key creation payload
body.expiresAt?stringDescription Optional expiration date (ISO string) Example 2025-12-31T23:59:59Z
body.namestringDescription Human-readable name for the key Example Aiba Webhook
body.projectId?stringDescription Optional project ID to scope this key to Example my-project-id
body.scopes( | "sessions" | "messages" | "participants" | "participants.token" | "gatherings" | "sanctions" | "sanctions.read" | "rooms.push" | "plugins" | "plugin-endpoints" | "webhooks" | "functions" | "settings")[]Description Scopes to grant to this key (at least one). A plain scope (sanctions) covers reads and writes of its resource family, a .read scope (sanctions.read) only its read routes, and a capability scope (participants.token, rooms.push) one narrow capability the family scope does not include. GET /api-keys/scopes describes every scope. Example [ "participants.token", "sanctions.read" ]

Returns​

Promise<object>

Created API key (includes the secret key, shown only once)

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation dateodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2757
expiresAt?stringFormat: date-time Description Expiration dateodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2752
idstringDescription Unique identifierodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2731
keystringDescription Full API key - shown only once at creation!odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2759
keyPrefixstringDescription First characters of the key for identification Example ots_live_abc1...odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2740
lastUsedAt?stringFormat: date-time Description When the key was last usedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2747
namestringDescription Key nameodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2733
projectId?stringDescription Project ID this key is scoped to (null = all projects)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2735
scopes( | "sessions" | "messages" | "participants" | "participants.token" | "gatherings" | "sanctions" | "sanctions.read" | "rooms.push" | "plugins" | "plugin-endpoints" | "webhooks" | "functions" | "settings")[]Description Scopes this key has access toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2742

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:46


getScopes()​

getScopes(): Promise<object>

Get the scope catalog: every scope a key can be created with (in display order, grouped by product and family, with labels and a sensitive flag) plus the presets.

Render scope pickers and key-list labels from this instead of hardcoding scopes, so new scopes appear without a client change.

Returns​

Promise<object>

The scope catalog

NameTypeDescriptionDefined in
presetsobject[]Description Named starting selections, in display orderodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2814
scopesobject[]Description Every grantable scope, in display orderodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2812

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:73


list()​

list(): Promise<object[]>

List all API keys for the tenant

Returns​

Promise<object[]>

Array of API keys

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:35


revoke()​

revoke(keyId): Promise<void>

Revoke an API key

Parameters​

ParameterTypeDescription
keyIdstringAPI key ID

Returns​

Promise<void>

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:58