update()
Updates the given API key.
Returns the updated APIKey object.
function update(params: UpdateAPIKeyParams): Promise<APIKey>const apiKeyId = 'apikey_123'
const userId = 'user_123'
const response = await clerkClient.apiKeys.update({
apiKeyId: apiKeyId,
subject: userId,
description: 'API key for accessing my application',
scopes: ['read:users', 'write:users'],
secondsUntilExpiration: 86400, // expires in 24 hours
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/api_keys/{apiKeyID}. See the BAPI reference for more information.
Feedback
Last updated on