Skip to main content

index/interfaces/UpdateApiKeyOptions.md

Options for updating an existing API key. All fields are optional - only provided fields are updated.

Example​

// Update description and add more tokens
const updates: UpdateApiKeyOptions = {
description: 'Updated description',
tokenNames: ['token1', 'token2', 'token3']
};

// Upgrade role and extend expiration
const roleUpdate: UpdateApiKeyOptions = {
role: 'MANAGER',
expiresAt: '2026-12-31T23:59:59Z'
};

Properties​

PropertyTypeDescription
delegateAllTokens?booleanIf true, key has access to ALL tokens owned by the user.
description?stringUpdated description/label. Max 255 characters.
expiresAt?string | nullUpdated expiration date in ISO 8601 format. Pass null to remove expiration.
role?ApiKeyRoleNew role for the API key.
tokenNames?string[]Updated list of specific tokens to delegate. Replaces existing token delegations.
tokenPermissions?Record<string, Permission[]>Per-token permission overrides. Maps tokenName to Permission[]. Replaces existing per-token permissions for the specified tokens. Since 5.8.0