---
title: "List API keys"
method: GET
path: "/keys"
tags: ["Credentials"]
---

# List API keys

`GET /keys`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/keys`
- Auth: HTTP bearer

Key metadata, never a secret: name, prefix, grant, creator, last use, expiry and suspension. The person needs access to the whole organization's mail. Needs the organization's credential features to be enabled; while they are not, this answers 404 feature_disabled.

Person only: a dashboard session or the person's own Primitive CLI token; no other OAuth app. The person's role must hold keys:read. API keys, agent connection keys and agents are refused.

## Query parameters

- `cursor` string

## Response `200`

Success

- object
  - `success` true, required
  - `data` CredentialsListKeysResult, required
    - `items` object[], required
      - `id` string, required
      - `kind` 'org_key' | 'function_key' | 'connected_key', required
      - `name` string, nullable, required
      - `key_prefix` string, required
      - `grant` object, required
        - `template` string, nullable, required
        - `permissions` string[], nullable, required
        - `mail_scope` unknown, required
      - `agent_address` string, nullable, required
      - `created_by_user_id` string, nullable, required
      - `created_at` string, nullable, required
      - `last_used_at` string, nullable, required
      - `expires_at` string, nullable, required
      - `suspended` boolean, required
    - `next_cursor` string, nullable, required

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: Resource not found
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) - [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primitive/apis/primitive-api/revisions/bce409c97acb?raw)
