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

# List API keys

> Every active API key in your workspace, newest first. The secret is
never returned — only `prefix`, which is its first 16 characters.
`?revoked=true` lists the keys this workspace has revoked instead, newest
revocation first, each with `revoked_at` and who revoked it (`revoked_by`,
a person; `revoked_by_key`, a key): a revoked key stays on record and
never works again. `revoked_since` and `revoked_until` narrow that list
to a range, and `pagination.next_cursor` continues it. Revocations are on
record from 22 September 2026, and who revoked a key from 28 September 2026.
Without `limit` the answer holds every key,
as it always has; `limit` and `offset` page it like any other list.

Requires `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 can neither issue nor revoke anything.


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}`](https://docs.goyappr.com/api-reference/api-keys/delete) (`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.

```bash theme={null}
curl "https://api.goyappr.com/api-keys?revoked=true&revoked_since=2026-07-01&revoked_until=2026-09-30&limit=100" \
  -H "Authorization: Bearer $YAPPR_API_KEY"
```

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

| Parameter | Meaning |
| - | - |
| `limit` | How many keys to answer with, 1–100. Leave it out and the answer holds every key, as it always has. |
| `offset` | How many of the newest keys to skip. Default `0`. |
| `revoked` | `true` lists the revoked keys, each with `revoked_at` (null for a key revoked before the time was kept), `revoked_by` and `revoked_by_key`. `false`, the default, lists the live ones. |
| `revoked_since` | 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 (`2026-10-02T02:48:30`) is refused rather than read as UTC. |
| `revoked_until` | 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` | With `revoked=true`: the previous page's `pagination.next_cursor`, with the same range. Not with `offset`. |

`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

```bash theme={null}
curl "https://api.goyappr.com/api-keys" \
  -H "Authorization: Bearer $YAPPR_API_KEY"
```

## Example response

```json theme={null}
{
  "data": [
    {
      "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
    }
  ],
  "pagination": { "total": 1, "limit": 1, "offset": 0, "has_more": false }
}
```

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

## Errors

| HTTP | Code | When |
| - | - | - |
| 400 | `API_KEY_REQUEST_INVALID` | A query parameter other than `limit`, `offset`, `revoked`, `revoked_since`, `revoked_until` and `cursor`, one sent twice or with no value, a `limit` outside 1–100, an `offset` that is not a whole number, a `revoked` other than `true` / `false`, a range or `cursor` without `revoked=true`, a `revoked_since` / `revoked_until` that is not a real date or has a time of day with no time zone (`issues[]` names it, `query_param_invalid`), or a range that ends before it starts, a `cursor` this list did not hand out for this workspace and range, or `cursor` with `offset`. The message names it. |
| 403 | `INSUFFICIENT_SCOPE` | API key holds neither `api_keys:read` nor `api_keys:manage`. |
| 503 | `API_KEY_STORAGE_UNAVAILABLE` | The key store could not be read. Retry. |


## OpenAPI

````yaml GET /api-keys
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:
    get:
      tags:
        - API Keys
      summary: List API keys
      description: >
        Every active API key in your workspace, newest first. The secret is

        never returned — only `prefix`, which is its first 16 characters.

        `?revoked=true` lists the keys this workspace has revoked instead,
        newest

        revocation first, each with `revoked_at` and who revoked it
        (`revoked_by`,

        a person; `revoked_by_key`, a key): a revoked key stays on record and

        never works again. `revoked_since` and `revoked_until` narrow that list

        to a range, and `pagination.next_cursor` continues it. Revocations are
        on

        record from 22 September 2026, and who revoked a key from 28 September
        2026.

        Without `limit` the answer holds every key,

        as it always has; `limit` and `offset` page it like any other list.


        Requires `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 can neither issue nor revoke anything.
      operationId: listApiKeys
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: How many keys to answer with. Leave it out for every key.
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
            minimum: 0
          description: How many of the newest keys to skip.
        - in: query
          name: revoked
          schema:
            type: boolean
            default: false
          description: >-
            `true` lists the revoked keys, each with `revoked_at`, `revoked_by`
            and `revoked_by_key`; `false` (the default) the live ones.
        - in: query
          name: revoked_since
          schema:
            type: string
          description: >-
            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.
        - in: query
          name: revoked_until
          schema:
            type: string
          description: >-
            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.
        - in: query
          name: cursor
          schema:
            type: string
          description: >-
            With `revoked=true`: `pagination.next_cursor` from the previous
            page, sent with the same `revoked_since` / `revoked_until`. Not with
            `offset`.
      responses:
        '200':
          description: The workspace's active keys, or its revoked keys with `revoked=true`
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: >-
                      `ApiKey` rows on the live list; `RevokedApiKey` rows,
                      which carry every `ApiKey` field, on `revoked=true`.
                    items:
                      anyOf:
                        - $ref: '#/components/schemas/ApiKey'
                        - $ref: '#/components/schemas/RevokedApiKey'
                  pagination:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: >-
                          How many keys the list holds - on `revoked=true`,
                          within the range.
                      limit:
                        type: integer
                        description: The `limit` sent, or the number of keys when none was.
                      offset:
                        type: integer
                      has_more:
                        type: boolean
                      next_cursor:
                        type: string
                        nullable: true
                        description: >-
                          On `revoked=true` only: send it as `cursor` for the
                          next page; null on the last.
        '400':
          description: >-
            API_KEY_REQUEST_INVALID - a query parameter other than `limit`,
            `offset`, `revoked`, `revoked_since`, `revoked_until` and `cursor`,
            one sent twice or with no value, a `limit` outside 1-100, an
            `offset` that is not a whole number, a `revoked` other than `true` /
            `false`, a range or cursor without `revoked=true`, a `revoked_since`
            / `revoked_until` that is not a real date, has a time of day with no
            time zone (`query_param_invalid` in `issues[]`), or ends before it
            starts, a `cursor` this list did not hand out for this workspace and
            range, or `cursor` with `offset`. The message names it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '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'
        '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.
    RevokedApiKey:
      description: |
        A key this workspace revoked, as `GET /api-keys?revoked=true` lists it:
        what it could reach (`scopes`, `agents`, `expires_at`), when it was
        made, and when and by whom it was revoked. Revocations are on record
        from 22 September 2026, and who revoked a key from 28 September 2026:
        before that `revoked_by` and `revoked_by_key` may both be null.
      allOf:
        - $ref: '#/components/schemas/ApiKey'
        - type: object
          properties:
            revoked_at:
              type: string
              format: date-time
              nullable: true
              description: >-
                When the key was revoked; null for a key revoked before the time
                was kept.
            revoked_by:
              type: object
              nullable: true
              description: >-
                The person who revoked it in the dashboard, or null when a key
                did, or when it was not recorded. `email` is null when the
                account no longer exists. The email is personal data, which is
                why the dashboard marks a key holding `api_keys:read` or
                `api_keys:manage` as reading it.
              properties:
                id:
                  type: string
                  format: uuid
                email:
                  type: string
                  nullable: true
            revoked_by_key:
              type: object
              nullable: true
              description: >-
                The key that revoked it with `DELETE /api-keys/{id}`, or null
                when a person did. `name` and `prefix` are null for a key that
                no longer exists.
              properties:
                id:
                  type: string
                  format: uuid
                name:
                  type: string
                  nullable: true
                prefix:
                  type: string
                  nullable: true
    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.