Skip to main content
GET
Get an API key
One active key, by id — the same shape GET /api-keys returns in its list, and with the same omission: never the secret. Use it to check what a key you issued earlier is allowed to do, or to confirm a revoke took effect (a revoked key answers 404 here). For a key limited to some agents, agents names them — the same ids as agent_ids, in the same order, each with its name — so you can check which client a key reaches without a second request. An archived agent keeps its name; an agent that no longer exists has "name": null (the key never widens because of it). For a key that reaches the whole workspace, both are null. Required scope: api_keys:read, or api_keys:manage, which reads a key as well.

Example request

Example response

A key limited to one client’s agent:

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).

Path Parameters

id
string<uuid>
required

Response

The key

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.

id
string<uuid>
name
string

What you called the key. Unique among this workspace's active keys, compared without regard to case.

Example:

"Nightly lead sync"

prefix
string

First 16 characters of the key, enough to tell two keys apart. Never the whole secret.

Example:

"ypr_live_9f2c41a"

scopes
string[]
Example:
agent_ids
string<uuid>[] | null

The agents this key is limited to, or null for a key that reaches the whole workspace. A limited key reaches those agents, their calls, the leads they called (read only), their spend, their deliveries and their campaigns, and calls only from numbers those agents answer or call from; everything the workspace shares answers 403 API_KEY_AGENT_SCOPED, and naming another agent answers 403 AGENT_OUTSIDE_KEY_SCOPE.

Example:

null

agents
object[] | null

The same agents as agent_ids, in the same order, each with its name — so a read says which client a limited key reaches. An archived agent keeps its name; an agent that no longer exists has name: null. null for a key that reaches the whole workspace.

Example:

null

created_at
string<date-time>
expires_at
string<date-time> | null

When the key stops working, or null for a key that works until it is revoked. Past this moment every request made with it answers 401 EXPIRED_KEY; the key stays listed until it is revoked.

Example:

null

last_used_at
string<date-time> | null

When this key last authenticated a request. null if it never has.