Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 26.8 KB

updatekeyrequestbody.md

File metadata and controls

22 lines (18 loc) · 26.8 KB

UpdateKeyRequestBody

Update a key's configuration. The apis.<API_ID>.update_key permission is required.

Fields

Field Type Required Description Example
key_id str ✔️ The id of the key you want to modify key_123
name OptionalNullable[str] The name of the key Customer X
owner_id OptionalNullable[str] : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated, use externalId
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
external_id OptionalNullable[str] 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 back to you, so you know who is accessing your API.
Under the hood this upserts and connects an ìdentity for you.
To disconnect the key from an identity, set externalId: null.
user_123
meta Dict[str, Any] Any additional metadata you want to store with the key {
"roles": [
"admin",
"user"
],
"stripeCustomerId": "cus_1234"
}
expires OptionalNullable[int] The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. 0
ratelimit OptionalNullable[models.UpdateKeyRatelimit] Unkey comes with per-key ratelimiting out of the box. Set null to disable. {
"type": "fast",
"limit": 10,
"refillRate": 1,
"refillInterval": 60
}
remaining OptionalNullable[int] The number of requests that can be made with this key before it becomes invalid. Set null to disable. 1000
refill OptionalNullable[models.UpdateKeyRefill] Unkey enables you to refill verifications for each key at regular intervals. {
"interval": "daily",
"amount": 100
}
enabled Optional[bool] Set if key is enabled or disabled. If disabled, the key cannot be used to verify. true
roles List[models.Roles] The roles you want to set for this key. This overwrites all existing roles.
Setting roles requires the rbac.*.add_role_to_key permission.
[
{
"id": "perm_123"
},
{
"name": "dns.record.create"
},
{
"name": "dns.record.delete",
"create": true
}
]
permissions List[models.UpdateKeyPermissions] The permissions you want to set for this key. This overwrites all existing permissions.
Setting permissions requires the rbac.*.add_permission_to_key permission.
[
{
"id": "perm_123"
},
{
"name": "dns.record.create"
},
{
"name": "dns.record.delete",
"create": true
}
]