> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an API key

> One active key, by id. Never returns the secret. For a key limited to
some agents, `agents` names each one. Requires `api_keys:read`, or
`api_keys:manage`, which reads a key as well.


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](https://docs.goyappr.com/api-reference/introduction.md#limiting-a-key-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

```bash theme={null}
curl "https://api.goyappr.com/api-keys/6a1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d" \
  -H "Authorization: Bearer $YAPPR_API_KEY"
```

## Example response

```json theme={null}
{
  "id": "6a1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
  "name": "Nightly lead sync",
  "prefix": "ypr_live_9f2c41a",
  "scopes": ["leads:read", "leads:manage"],
  "agent_ids": null,
  "agents": null,
  "created_at": "2026-09-22T09:14:02.881Z",
  "last_used_at": "2026-09-22T11:02:44.310Z",
  "expires_at": null
}
```

A key limited to one client's agent:

```json theme={null}
{
  "id": "7b2d3e4f-5061-4b7c-9d8e-0f1a2b3c4d5e",
  "name": "Client A — dental",
  "prefix": "ypr_live_4e81c0d",
  "scopes": ["agents:read", "calls:read"],
  "agent_ids": ["0b6a3f7e-2d41-4c8a-9f10-5e2b7c9d1a44"],
  "agents": [
    { "id": "0b6a3f7e-2d41-4c8a-9f10-5e2b7c9d1a44", "name": "Dental reception" }
  ],
  "created_at": "2026-09-24T08:30:00.000Z",
  "last_used_at": null,
  "expires_at": null
}
```

## Errors

| HTTP | Code | When |
| - | - | - |
| 400 | `API_KEY_REQUEST_INVALID` | A query parameter was sent. Reading one key takes none. |
| 403 | `INSUFFICIENT_SCOPE` | API key holds neither `api_keys:read` nor `api_keys:manage`. |
| 404 | `NOT_FOUND` | No such key in this workspace, or it has been revoked. |
| 404 | `RESOURCE_ID_INVALID` | The id in the path is not an id at all. Use an `id` exactly as the list returned it. |
| 503 | `API_KEY_STORAGE_UNAVAILABLE` | The key store could not be read. Retry. |


## OpenAPI

````yaml GET /api-keys/{id}
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /api-keys/{id}:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
    get:
      tags:
        - API Keys
      summary: Get an API key
      description: |
        One active key, by id. Never returns the secret. For a key limited to
        some agents, `agents` names each one. Requires `api_keys:read`, or
        `api_keys:manage`, which reads a key as well.
      operationId: getApiKey
      responses:
        '200':
          description: The key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
        '403':
          description: >-
            INSUFFICIENT_SCOPE - the key is valid for this workspace but holds
            neither api_keys:read nor api_keys:manage. Nothing was read. A
            workspace owner or admin can tick API keys -> Read on this key in
            Settings -> API keys; a key cannot obtain it through the API,
            because issuing a key needs api_keys:manage, which reads the list
            itself.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such key here, or it has been revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The key store could not be read. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ApiKey:
      type: object
      description: |
        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.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          description: >-
            What you called the key. Unique among this workspace's active keys,
            compared without regard to case.
          example: Nightly lead sync
        prefix:
          type: string
          description: >-
            First 16 characters of the key, enough to tell two keys apart. Never
            the whole secret.
          example: ypr_live_9f2c41a
        scopes:
          type: array
          items:
            type: string
          example:
            - leads:read
            - leads:manage
        agent_ids:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >
            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:
          type: array
          nullable: true
          description: |
            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.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
                nullable: true
          example: null
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: |
            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:
          type: string
          format: date-time
          nullable: true
          description: When this key last authenticated a request. `null` if it never has.
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        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`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.