rootKeys

Updates a root key in the authenticated workspace. Requires unkey:v1:<workspace_id>:rootKeys/<key_id>#write. Use rootKeys/*#write to update any root key in the workspace.

permissions replaces the complete permission set. Each permission must be a supported URN in the authenticated workspace and within the caller's permissions. An expiring root key can only update root keys that expire no later than itself.

post/v2/rootKeys.updateKey

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/rootKeys.updateKey
  • Auth
    HTTP bearer

Request body

ipAllowliststring[]

Replacement IPv4 or IPv6 addresses and CIDR ranges. Omit to keep the current list. Use an empty list for unrestricted access. A restricted root-key caller can expand the target's list only within the caller's allowed networks and cannot send an empty list.

keyIdstring required

Root key identifier returned by rootKeys.createKey or rootKeys.listKeys.

namestring nullable

New root key name. Set null to remove the name. Omit to keep the current name.

enabledboolean

Whether the root key can authenticate. Omit to keep the current state.

permissionsstring[]

Complete replacement permission set. Every permission must be a supported URN in the authenticated workspace and within the caller's permissions. Omit to keep the current permissions.

Response

Root key updated.

dataEmptyResponse required

Empty response object by design. A successful response indicates this operation was successfully executed.

Example response

{
  "meta": {
    "requestId": "req_123"
  }
}

Changes