--- title: "List API keys" canonical: "https://admiral.io/docs/api/users/ApiKeyAPI_ListApiKeys" --- # List API keys `GET https://api.admiral.io/v1/users/{user}/apiKeys` - PERMISSION_DENIED when `parent` is not the caller. Scope: `apikey:read` ### Path parameters - `user` (string, required): The user id. ### Query parameters - `page_size` (integer (int32)): Maximum number of keys to return per page. Defaults to 50 when omitted or 0; must not exceed 100. Value 0 to 100. - `page_token` (string): Opaque pagination token from a previous response. - `filter` (string): An AIP-160 filter expression. Filterable fields are `resource_name`, `name` and `status` (`ACTIVE` or `REVOKED`). `resource_name` takes the full resource name, with `-` for the parent, and `name` the short name, as in `name = "ci-deploy"`. Example: `status = ACTIVE` `id` is filterable too: `id = "a" OR id = "b"` reads up to 100 of them by id in one call. Length at most 4096. - `order_by` (string): Fields to order by, in AIP-132 syntax such as `created_at desc`. Accepted fields: `created_at`, `name`, `updated_at`. Left empty, the list keeps the order stated above. An unknown field is INVALID_ARGUMENT. Length at most 256. ### Response 200 Success - `api_keys` (array of ApiKey): The list of keys. Secrets are never included. - `id` (string): `key-` and twelve base36 characters. Never changes and is never reused, so it is what a reference to the key holds. Pattern `^key-[0-9a-z]+$`. Read-only. - `name` (string, required): (IMMUTABLE) The name, such as `ci-deploy`. Unique among the owner's keys that can still authenticate, set on create and changed only by RenameApiKey. Lowercase letters, digits and hyphens, starting with a letter and ending with a letter or digit, 1 to 63 characters. It may not have the shape of an id (`key-` and twelve characters). name.not_uid // an API key name may not have the shape of an id Pattern `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. Length 1 to 63. - `display_name` (string): A label for people, such as "CI deploy". Optional; clients show the name when it is unset. Length at most 128. - `resource_name` (string): (IDENTIFIER) The resource name, such as `users/usr-01j9t5b6c3h1/apiKeys/ci-deploy`. Its parent says whose key it is. Built from the key's name, so it changes when the key is renamed; refer to a key by `id` to keep a reference stable. Identifies the key on update. Pattern `^users/(usr-[0-9a-z]+|-)/apiKeys/[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. - `owner_id` (string): The `usr-` id of the user who owns the key, the same user its resource name's parent names. Access tokens minted from the key act as this user. Pattern `^usr-[0-9a-z]+$`. Read-only. - `scopes` (array of string): The scopes granted to this key, and the ceiling on any access token minted from it. Must be a subset of the caller's own scopes. Items at most 255. - `expires_at` (Timestamp): (IMMUTABLE) When the key expires. Unset never expires. Fixed at creation; organization policy may cap it. - `status` (ApiKeyStatus): ApiKeyStatus represents the lifecycle state of an API key. One of `API_KEY_STATUS_UNSPECIFIED`, `ACTIVE`, `REVOKED`. Read-only. - `last_used_at` (Timestamp): When the key was last exchanged for an access token. Minted tokens are reused for their lifetime, so this reads as "still in use" at that granularity, not as the time of the last request. Read-only. - `revoked_at` (Timestamp): Set when the key was revoked. Read-only. - `etag` (string): Changes whenever the key does. Send it back on update or rename to refuse the change if someone else changed the key first. Read-only. - `created_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. Read-only. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `created_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `updated_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `next_page_token` (string): Pagination token for the next page. Empty when there are no more results.