GET
/
v1
/
keys.getKey
curl --request GET \
  --url https://api.unkey.dev/v1/keys.getKey \
  --header 'Authorization: Bearer <token>'
{
  "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": {}
  }
}

Changelog

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

Authorizations

Authorization
string
header
required

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

Query Parameters

keyId
string
required

The id of the key to fetch

Minimum length: 1
Example:

"key_1234"

decrypt
boolean | null

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

Response

200
application/json

The configuration for a single key

The response is of type object.