GET
/
v1
/
apis.listKeys
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": 123,
      "updatedAt": 123,
      "deletedAt": 123,
      "expires": 123,
      "remaining": 1000,
      "refill": {
        "interval": "daily",
        "amount": 10
      },
      "ratelimit": {
        "async": true,
        "limit": 10,
        "duration": 60
      },
      "roles": [
        "admin",
        "finance"
      ],
      "permissions": [
        "domain.dns.create_record",
        "finance.read_receipt"
      ],
      "enabled": true,
      "plaintext": "<string>"
    }
  ],
  "cursor": "eyJrZXkiOiJrZXlfMTIzNCJ9",
  "total": 123
}

Changelog

DateChanges
Dec 06 2023Introduced endpoint
May 15 2024Return updatedAt timestamp

Authorizations

Authorization
string
headerrequired

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

limit
integer
default: 100

The maximum number of keys to return

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

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

decrypt
boolean | null

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

Response

200 - application/json
keys
object[]
required
cursor
string

The cursor to use for the next page of results, if no cursor is returned, there are no more results

total
integer
required

The total number of keys for this api