Skip to main content

List API Keys (Admin)

List API keys across all users in the org with owner email, scope, last-used timestamp, and 12-character key prefix. The raw key is NEVER returned. Requires an admin-scoped API key.

Parameters

NameTypeDefaultDescription
user_idstring-Filter by owning user ID.
scopestring-Filter by scope. Pre-#1150 keys with NULL scope are returned under user.
include_system_managedboolean-Include OAuth/onboarding-managed keys (default false).
limitinteger-Page size (1-500, default 100).
cursorstring-Opaque pagination cursor.

Use Cases

  • Inventory every API key in the org with its owner email, scope, and last-used time
  • Find all admin-scoped keys — filter by scope to audit privileged access
  • List a single user's API keys before offboarding them

Example Usage

First page of all keys

{
"tool": "admin_list_api_keys",
"arguments": {}
}

Only admin-scoped keys

{
"tool": "admin_list_api_keys",
"arguments": {
"scope": "admin"
}
}

Keys for one user, including system-managed

{
"tool": "admin_list_api_keys",
"arguments": {
"user_id": "3f7c2b1a-9d4e-4c2a-8b1f-0a1b2c3d4e5f",
"include_system_managed": true
}
}

Response Format

FieldTypeDescription
apiKeysarrayAPI keys page (up to limit items). Use nextCursor to fetch the next page.
apiKeys[].idstring
apiKeys[].namestring
apiKeys[].keyPrefixstringFirst 12 characters of the raw key for identification — never the full raw key.
apiKeys[].scopestringCoerced from null → 'user' for pre-#1150 rows.
apiKeys[].userIdstring
apiKeys[].userEmailstring | null
apiKeys[].userNamestring | null
apiKeys[].isSystemManagedboolean
apiKeys[].createdAtstring
apiKeys[].lastUsedAtstring | null
nextCursorstring | nullOpaque cursor for the next page; null when no more results.