---
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 caller's own data-plane keys (id, name, timestamps, attenuating grants). Never returns the secret. Gated by the Context's `allow_self_service_keys` flag.

## Path parameters

- `context_id` string, required

## Response `200`

- KeyDetailJson[]
  - `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.

## Other responses

- `401` — Unauthorized
- `403` — Self-service keys disabled
- `422` — Invalid context id

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/versions/52b41ab517b6/schema)
