---
title: "List API keys"
method: GET
path: "/v2/workspaces/{id}/keys"
tags: ["Keys"]
---

# List API keys

`GET /v2/workspaces/{id}/keys`

## Request

- Base URL: `https://api.infolang.ai`
- URL: `https://api.infolang.ai/v2/workspaces/{id}/keys`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Key metadata only (prefix, label, last_used, and the scope record when the key has one) — never secrets. A key with no `scopes` field resolves to `LEGACY_DEFAULT`.

Requires the `keys:read` scope. Accepts all three lanes: a session JWT (bounded by the caller's role on this workspace) or an `il_*` machine credential whose own scope set, workspace set and validity window cover it — both ceilings apply and neither can raise the other, so a credential carrying `keys:read` is still refused where the role does not permit it.

A credential with no scope record resolves to `LEGACY_DEFAULT`, which does NOT include `keys:read` — mint a key with it explicitly (`POST /v2/workspaces/{id}/keys`).

## Path parameters

- `id` string, required

## Response `200`

Keys in the workspace

- object
  - `keys` object[], required
    - `key_id` string, required
    - `env` 'live' | 'test', required
    - `prefix` string, required
    - `label` string, nullable
    - `created` string, required
    - `last_used` string, nullable
    - `secret` string
    - `scopes` string[]
    - `scoped_workspace_ids` string[]
    - `scoped_namespaces` string[]
    - `expires_at` string, nullable
    - `not_before` string, nullable
    - `principal` string
    - `principal_kind` 'user' | 'service'

## Other responses

- `401`: Missing/invalid credential, or `credential_expired` — the credential is outside its `[not_before, expires_at)` window and must be replaced
- `403`: `insufficient_scope` — the credential's own scope set, or the caller's role on this workspace, does not cover the scope this route requires (the missing scope is named in the message). Or `forbidden` — the credential is not scoped to this workspace, or holds no grant on it

---

[API](https://skmtc.dev/infolang/apis/infolang-api.md) · [All operations](https://skmtc.dev/infolang/apis/infolang-api/llms.txt) · [OpenAPI document](https://skmtc.dev/infolang/apis/infolang-api/revisions/d04bf6de72c8?raw)
