Skip to main content

OrgApiKeyCreateRequest

@gravity-rail/sdk


@gravity-rail/sdk / OrgApiKeyCreateRequest

Interface: OrgApiKeyCreateRequest

Mint an organization-bound API key with its workspace scope (ADR-55).

workspaceScope is the one org -> workspace gate shared with organization webhook endpoints and org Agents: all reaches every current and future workspace of the organization, selected reaches the named workspaces plus every workspace carrying ALL of the selector's labels (now and as labels change), and none reaches nothing. The scope is required and fixed at mint; change it by minting a replacement and revoking this key.

Field shape only. Whether each workspace and label belongs to the caller's organization is the service's check, before any key is created.

Properties​

expiresInDays?​

optional expiresInDays: number | null

Number of days until the key expires. If not provided, default expiry is used.


name​

name: string

Name for the API key


rawScopes?​

optional rawScopes: string[]


scopes?​

optional scopes: string[]

List of permission scopes for the API key


workspaceScope​

workspaceScope: OrgWorkspaceScopeRequest

Which of the organization's workspaces the key may reach.