Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 17.2 KB

File metadata and controls

21 lines (18 loc) · 17.2 KB

Key

Fields

Field Type Required Description Example
id string ✔️ The id of the key key_1234
start string ✔️ The first few characters of the key to visually identify it sk_5j1
workspaceId string ✔️ The id of the workspace that owns the key ws_1234
apiId string The id of the api that this key is for api_1234
name string The name of the key, give keys a name to easily identify their purpose Customer X
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. user_123
meta Record<string, any> Any additional metadata you want to store with the key {
"roles": [
"admin",
"user"
],
"stripeCustomerId": "cus_1234"
}
createdAt number The unix timestamp in milliseconds when the key was created 0
deletedAt number The unix timestamp in milliseconds when the key was deleted. We don't delete the key outright, you can restore it later. 0
expires number The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. 0
remaining number 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. 1000
refill components.Refill Unkey allows you to refill remaining verifications on a key on a regular interval. {
"interval": "daily",
"amount": 10
}
ratelimit components.Ratelimit Unkey comes with per-key ratelimiting out of the box. {
"type": "fast",
"limit": 10,
"refillRate": 1,
"refillInterval": 60
}
enabled boolean Sets if key is enabled or disabled. Disabled keys are not valid. true