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
| Property | Type | Description |
|---|---|---|
delegateAllTokens? | boolean | If true, key has access to ALL tokens owned by the user. |
description? | string | Updated description/label. Max 255 characters. |
expiresAt? | string | null | Updated expiration date in ISO 8601 format. Pass null to remove expiration. |
role? | ApiKeyRole | New 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 |
delegate all tokens expires at api key role token names permissions