GET
/
v1
/
keys.getKey

Changelog

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

Authorizations

Authorization
string
headerrequired

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

decrypt
boolean | null

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

Response

200 - application/json
id
string
required

The id of the key

start
string
required

The first few characters of the key to visually identify it

workspaceId
string
required

The id of the workspace that owns the key

apiId
string

The id of the api that this key is for

name
string

The name of the key, give keys a name to easily identify their purpose

ownerId
string

The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.

meta
object

Any additional metadata you want to store with the key

createdAt
integer
required

The unix timestamp in milliseconds when the key was created

updatedAt
integer

The unix timestamp in milliseconds when the key was last updated

expires
integer

The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.

remaining
integer

The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.

refill
object

Unkey allows you to refill remaining verifications on a key on a regular interval.

ratelimit
object

Unkey comes with per-key ratelimiting out of the box.

roles
string[]

All roles this key belongs to

permissions
string[]

All permissions this key has

enabled
boolean

Sets if key is enabled or disabled. Disabled keys are not valid.

plaintext
string

The key in plaintext

identity
object

The identity of the key