list()
Retrieves a list of API keys for a given user or organization. Returns a PaginatedResourceResponse object.
function list(
queryParams: GetAPIKeyListParams,
): Promise<PaginatedResourceResponse<APIKeyResource[]>>- Name
subject- Type
string- Description
The user or organization ID to query API keys by.
- Name
includeInvalid?- Type
boolean- Description
Whether to include invalid API keys (revoked or expired). Defaults to
false.
- Name
limit?- Type
number- Description
The maximum number of API keys to return. Defaults to
10.
- Name
offset?- Type
number- Description
The number of API keys to skip before returning results. Defaults to
0.
const userId = 'user_123'
const apiKeys = await clerkClient.apiKeys.list({
subject: userId,
})const userId = 'user_123'
const apiKeys = await clerkClient.apiKeys.list({
subject: userId,
includeInvalid: true,
})const userId = 'user_123'
const apiKeys = await clerkClient.apiKeys.list({
subject: userId,
limit: 20,
offset: 0,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/api_keys. See the BAPI reference for more information.
Feedback
Last updated on