Skip to main content
GET
List API keys
Every active key in your workspace, newest first. ?revoked=true lists the keys you have revoked instead, newest revocation first: a revoked key stays on record, with revoked_at, and never works again.

Auditing revoked keys

?revoked=true is the audit trail. Each row carries everything the live list does — scopes, agents, created_at, expires_at — plus revoked_at and who revoked it: revoked_by is the person who deleted it in the dashboard (id and email), revoked_by_key the key that revoked it with DELETE /api-keys/{id} (id, name, prefix). Both are null when it was not recorded. A teammate’s email is personal data: a key that reads this list (api_keys:read or api_keys:manage) is marked Reads personal data in the dashboard. Revocations are on record from 22 September 2026: a key deleted before that left no row to list. Who revoked a key is on record from 28 September 2026: a key revoked before that may have both revoked_by and revoked_by_key null, and the dashboard’s Deleted keys list and its CSV say “not recorded” for it. Narrow it to a range with revoked_since and revoked_until, and page it with limit and cursor: each page’s pagination.next_cursor continues the list, and is null on the last page. A cursor belongs to the workspace and the range it was cut for; send it with the same revoked_since and revoked_until, or start again without it.
The secret is never returned — not here, not anywhere except the response that created the key. What you get back is prefix, the first 16 characters, which is enough to tell two keys apart and to match a key against the dashboard list. agent_ids is the list of agents a key is limited to, or null for a key that reaches the whole workspace. agents is the same list with each agent’s name (null for an agent that no longer exists), so the list alone tells you which client each key belongs to. last_used_at is when the key last authenticated a request, or null if it never has. It is the quickest way to find a key nothing uses any more. expires_at is when the key stops working, or null for a key that works until it is revoked. A key past its expires_at answers 401 EXPIRED_KEY to every request and stays listed until you revoke it. Required scope: api_keys:read, or api_keys:manage, which reads the list as well. api_keys:read is read-only — a key holding it can audit the inventory and cannot issue or revoke anything.

Query parameters

pagination says how many there are: total (on revoked=true, within the range), limit (the one sent, or the number of keys when none was), offset and has_more — and on revoked=true, next_cursor.

Example request

Example response

GET /api-keys/{id} returns one key in the same shape, and 404s for a key that is not in this workspace or has been revoked.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Query Parameters

limit
integer

How many keys to answer with. Leave it out for every key.

Required range: 1 <= x <= 100
offset
integer
default:0

How many of the newest keys to skip.

Required range: x >= 0
revoked
boolean
default:false

true lists the revoked keys, each with revoked_at, revoked_by and revoked_by_key; false (the default) the live ones.

revoked_since
string

With revoked=true: keys revoked at or after this moment. An ISO 8601 date-time with a time zone (Z or an offset), or a date (the start of that UTC day). A time with no zone is refused.

revoked_until
string

With revoked=true: keys revoked at or before this moment. A date-time with a time zone, or a bare date, which covers that whole UTC day. A time with no zone is refused.

cursor
string

With revoked=true: pagination.next_cursor from the previous page, sent with the same revoked_since / revoked_until. Not with offset.

Response

The workspace's active keys, or its revoked keys with revoked=true

data
object[]

ApiKey rows on the live list; RevokedApiKey rows, which carry every ApiKey field, on revoked=true.

An API key belonging to your workspace. The secret itself is stored only as a SHA-256 hash and is returned exactly once, by POST /api-keys; no read ever returns it. prefix is the first 16 characters of the secret and is what identifies a key in the dashboard list.

pagination
object