---
title: "GET /api/v1/{context_id}/keys"
method: GET
path: "/api/v1/{context_id}/keys"
---

# GET /api/v1/{context_id}/keys

`GET /api/v1/{context_id}/keys`

List the key the caller authenticated with (id, name, timestamps, attenuating grants); a context administrator (`grant:manage` over `/`) lists every key in the Context. Never returns the secret. Gated by the Context's `allow_self_service_keys` flag. Paginated: follow `page.nextCursor`.

## Path parameters

- `context_id` string, required

## Query parameters

- `limit` integer
- `cursor` string
- `count` boolean

## Response `200`

- KeyListResponseJson — The `GET /{ctx}/keys` response. An envelope rather than a bare array: a top-level JSON array has nowhere to carry the pagination block, and every list surface returns the same shape.
  - `keys` KeyDetailJson[], required
    - `createdAt` string, date-time, required — Creation timestamp.
    - `grants` Grants — Per-verb scope pattern map. Keys are grant verbs in `<noun>:<verb>` form (`memory:read`, `memory:write`, `memory:forget`, `scope:read`, `scope:create`, `scope:delete`, `grant:manage`); values are arrays of scope patterns.
    - `id` string, required — Stable record-id key (e.g. `abc123defghi`).
    - `lastUsedAt` string, date-time, nullable — Last successful validation; absent if the key has never been used.
    - `name` string, required — Human-readable name (unique within the Context).
    - `validUntil` string, date-time, nullable — Mint-time expiry. Absent ⇒ no expiry was set.
  - `page` PageMeta, required — The pagination block returned beside a page's rows.
    - `hasMore` boolean, required — Whether a further page exists.
    - `nextCursor` string, nullable — Token for the next page; absent on the last page.
    - `totalSize` integer, nullable — Total rows matching the filters, present only when the request asked for it with `count=true`.

## Other responses

- `400` — Invalid pagination parameter
- `401` — Unauthorized
- `403` — Self-service keys disabled
- `422` — Invalid context id
- `503` — Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header.

## Changes

- **2026-08-24** `9f1598713067` — 1 breaking, 7 info
  - the response's body type/format changed from `array`/`` to `object`/`` for status `200`
  - added the new optional `query` request parameter `count`
  - added the new optional `query` request parameter `cursor`
  - added the new optional `query` request parameter `limit`
  - …4 more
- **2026-06-16** `52b41ab517b6` — 1 info
  - endpoint added
- **2026-06-08** `741d58b9ef89` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/surrealdb/apis/spectron/changes/api/v1/:context_id/keys/get.md)

---

[API](https://skmtc.dev/surrealdb/apis/spectron.md) · [All operations](https://skmtc.dev/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/9f1598713067/schema)
