Skip to main content
List API keys visible to the caller. Secret key values are never returned. Required scope: admin
const keys = await mesa.apiKeys.list();

for (const key of keys.api_keys) {
  console.log(key.id, key.name, key.scopes);
}

Options

org
string | undefined
Organization override.

Response

next_cursor
string | null
Cursor for the next page, or null when no more results remain.
has_more
boolean
Whether another page of results is available.
api_keys
ApiKeyListItem[]
API key summaries.

ApiKeyListItem

id
string
API key ID.
name
string | null
API key name, or null when unnamed.
scopes
string[]
Scopes granted to this key.
repo_ids
string[] | null
Repository allowlist, or null when the key is not repo-scoped.
metadata
Record<string, unknown> | null
Additional API key metadata, or null when absent.
tags
Record<string, string>
User-defined API key tags.
last_used_at
string | null
Last use time, or null when the key has not been used.
expires_at
string | null
Expiration time, or null when the key does not expire.
revoked_at
string | null
Revocation time, or null when the key is active.
created_at
string
Creation time.

Raw filters

The high-level method currently accepts only org. Use mesa.raw.listApiKeys(...) for generated filters such as query, status, scope, repo_id, cursor, and limit.