GET
/
v1
/
apis
/
{apiId}
/
keys
cURL
curl --request GET \
  --url https://api.unkey.dev/v1/apis/{apiId}/keys
{
  "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": {}
      }
    }
  ],
  "total": 123
}

Path Parameters

apiId
string
required

The id of the api to fetch

Minimum length: 1
Example:

"api_1234"

Query Parameters

limit
integer
default:100

The maximum number of keys to return

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

100

offset
number | null

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.

Minimum length: 1

Response

200
application/json

Keys belonging to the api

The response is of type object.