permissions

Update permission

Changed on

Update the name, slug, or description of a permission, identified by its ID or slug.

Omitted fields keep their current values. A request with no fields to update returns the stored permission without a write.

Important: Keys and roles reference the permission by ID, so they keep the permission after a slug change. Key verification can return the old slug for a short time while caches refresh. A slug that another permission in your workspace already uses returns 409.

Required Permissions

Your root key must have the following permission:

  • unkey:v1:<workspace_id>:projects/<project_id>/rbac/permissions/<permission_id>#write
post/v2/permissions.updatePermission

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/permissions.updatePermission
  • Auth
    HTTP bearer

Request body

permissionstring required

The permission to update. Pass the permission ID (perm_...) or its current slug.

namestring

New human-readable name for the permission. Omit this field to keep the current name.

slugstring

New slug for the permission. Keys and roles that have this permission get the new slug in verification responses. The slug must be unique in your workspace. Omit this field to keep the current slug.

descriptionstring nullable

New description for the permission. Omit this field to keep the current description. Send null or an empty string to remove it.

Example request

{
  "permission": "perm_1234567890abcdef",
  "name": "Read documents",
  "slug": "documents.read",
  "description": "Allows reading document resources"
}

Response

Permission updated successfully

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "perm_1234567890abcdef",
    "name": "users.read",
    "slug": "users-read",
    "description": "Allows reading user profile information and account details"
  }
}

Changes