Class: ApiKeyManager
Manages API keys for the tenant.
Constructors
new ApiKeyManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
Returns
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:29
Methods
create()
Create a new API key
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | API key creation payload |
body.expiresAt? | string | Description Optional expiration date (ISO string) Example 2025-12-31T23:59:59Z |
body.name | string | Description Human-readable name for the key Example Aiba Webhook |
body.projectId? | string | Description 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)
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation date | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2757 |
expiresAt? | string | Format: date-time Description Expiration date | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2752 |
id | string | Description Unique identifier | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2731 |
key | string | Description Full API key - shown only once at creation! | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2759 |
keyPrefix | string | Description First characters of the key for identification Example ots_live_abc1... | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2740 |
lastUsedAt? | string | Format: date-time Description When the key was last used | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2747 |
name | string | Description Key name | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2733 |
projectId? | string | Description 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 to | odin-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()
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
| Name | Type | Description | Defined in |
|---|---|---|---|
presets | object[] | Description Named starting selections, in display order | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:2814 |
scopes | object[] | Description Every grantable scope, in display order | odin-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 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 an API key
Parameters
| Parameter | Type | Description |
|---|---|---|
keyId | string | API key ID |
Returns
Promise<void>
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/api-keys.ts:58