GET
/
v1
/
apis.listKeys
List API keys
curl --request GET \
  --url https://api.unkey.dev/v1/apis.listKeys \
  --header 'Authorization: Bearer <token>'
{
  "keys": [
    {
      "id": "key_1234",
      "start": "sk_5j1",
      "workspaceId": "ws_1234",
      "apiId": "api_1234",
      "name": "Customer X",
      "ownerId": "user_123",
      "meta": {
        "roles": [
          "admin",
          "user"
        ],
        "stripeCustomerId": "cus_1234"
      },
      "createdAt": 0,
      "updatedAt": 0,
      "expires": 0,
      "remaining": 1000,
      "refill": {
        "interval": "monthly",
        "amount": 10,
        "refillDay": 10
      },
      "ratelimit": {
        "async": true,
        "limit": 10,
        "duration": 60
      },
      "roles": [
        "admin",
        "finance"
      ],
      "permissions": [
        "domain.dns.create_record",
        "finance.read_receipt"
      ],
      "enabled": true,
      "plaintext": "<string>",
      "identity": {
        "id": "<string>",
        "externalId": "<string>",
        "meta": {}
      }
    }
  ],
  "cursor": "eyJrZXkiOiJrZXlfMTIzNCJ9",
  "total": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

apiId
string
required

The id of the api to fetch

Minimum length: 1
Example:

"api_1234"

limit
integer
default:100

The maximum number of keys to return

Required range: 1 <= x <= 100
Example:

100

cursor
string

Use this to fetch the next page of results. A new cursor will be returned in the response if there are more results.

ownerId
string
deprecated

Deprecated. Use externalId instead.

Minimum length: 1
externalId
string

If provided, this will only return keys where the externalId matches.

Minimum length: 1
decrypt
boolean | null

Decrypt and display the raw key. Only possible if the key was encrypted when generated.

revalidateKeysCache
boolean | null
default:false

EXPERIMENTAL

Skip the cache and fetch the keys from the database directly. When you're creating a key and immediately listing all keys to display them to your user, you might want to skip the cache to ensure the key is displayed immediately.

Response

200
application/json

List of keys for the api

The response is of type object.