# List API keys

`GET /api/v1/api-keys`

Never returns secrets — only the prefix, the last-4 hint, and lifecycle timestamps.

No API key can call this route: it needs a signed-in dashboard user with the right role. A key answers 403.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | string | optional |  |
| `cursor` | string | optional | `next_cursor` from the previous page. |

## Responses

### 200

API keys for the caller’s tenant and mode, newest first.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
              },
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "test",
                  "live"
                ]
              },
              "keyPrefix": {
                "type": "string",
                "enum": [
                  "gpy_",
                  "agk_",
                  "pk_"
                ]
              },
              "keyHint": {
                "type": "string",
                "description": "Last 4 characters of the key. The only fragment of the secret ever stored.",
                "example": "aB3x"
              },
              "keyType": {
                "type": "string",
                "enum": [
                  "developer",
                  "agent",
                  "publishable"
                ],
                "example": "developer"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "expiresAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "lastUsedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "revokedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "revokedReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "manual",
                  "rolled",
                  null
                ],
                "description": "Why the key was revoked: `manual` (DELETE), or `rolled` (its overlap was ended early). Null while live, and on keys revoked before this field existed."
              },
              "replacedBy": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "description": "The key that replaced this one when it was rolled. A key with a replacement cannot be rolled again."
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "name",
              "mode",
              "keyPrefix",
              "keyHint",
              "keyType",
              "scopes",
              "createdAt"
            ]
          }
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "items",
        "next_cursor"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
