---
title: "Update a role set"
method: PATCH
path: "/role_sets/{role_set_key_or_id}"
tags: ["Role Sets"]
---

# Update a role set

`PATCH /role_sets/{role_set_key_or_id}`

Updates an existing role set.
You can update the name, key, description, type, default role, or creator role.
All parameters are optional - you can update only the fields you want to change.

## Path parameters

- `role_set_key_or_id` string, required

## Request body

- object
  - `name` string, nullable — The new name for the role set
  - `key` string, nullable — A unique key for the role set. Must start with 'role_set:' and contain only lowercase alphanumeric characters and underscores.
  - `description` string, nullable — Optional description for the role set
  - `type` 'initial', nullable — Set to "initial" to make this the default role set for new organizations. Only one role set can be "initial" per instance; setting this will change any existing initial role set to "custom".
  - `default_role_key` string, nullable — The key of the role to use as the default role for new organization members. Must be an existing role in the role set.
  - `creator_role_key` string, nullable — The key of the role to assign to organization creators. Must be an existing role in the role set.

## Response `200`

Success

- RoleSet — A role set defines a collection of roles that can be assigned to organization members
  - `object` 'role_set', required
  - `id` string, required — The unique identifier of the role set
  - `name` string, required — The name of the role set
  - `key` string, required — A unique key for the role set (e.g., "role_set:default")
  - `description` string, nullable, required — Optional description of the role set
  - `roles` RoleSetItem[], required — The list of roles in this role set
    - `object` 'role_set_item', required
    - `id` string, required — The unique identifier of the role
    - `name` string, required — The name of the role
    - `key` string, required — The key of the role (e.g., "org:admin", "org:member")
    - `description` string, nullable, required — Optional description of the role
    - `members_count` integer, nullable — The number of members assigned to this role within the role set
    - `has_members` boolean, nullable — Whether this role has any members assigned within the role set
    - `created_at` integer, required — Unix timestamp of role creation
    - `updated_at` integer, required — Unix timestamp of last role update
  - `default_role` RoleSetItem — A role within a role set
    - `object` 'role_set_item', required
    - `id` string, required — The unique identifier of the role
    - `name` string, required — The name of the role
    - `key` string, required — The key of the role (e.g., "org:admin", "org:member")
    - `description` string, nullable, required — Optional description of the role
    - `members_count` integer, nullable — The number of members assigned to this role within the role set
    - `has_members` boolean, nullable — Whether this role has any members assigned within the role set
    - `created_at` integer, required — Unix timestamp of role creation
    - `updated_at` integer, required — Unix timestamp of last role update
  - `creator_role` RoleSetItem — A role within a role set
    - `object` 'role_set_item', required
    - `id` string, required — The unique identifier of the role
    - `name` string, required — The name of the role
    - `key` string, required — The key of the role (e.g., "org:admin", "org:member")
    - `description` string, nullable, required — Optional description of the role
    - `members_count` integer, nullable — The number of members assigned to this role within the role set
    - `has_members` boolean, nullable — Whether this role has any members assigned within the role set
    - `created_at` integer, required — Unix timestamp of role creation
    - `updated_at` integer, required — Unix timestamp of last role update
  - `type` 'initial' | 'custom', required — The type of the role set ("initial" or "custom")
  - `role_set_migration` RoleSetMigration — Information about an ongoing role set migration
    - `object` 'role_set_migration', required
    - `id` string, required — The unique identifier of the migration
    - `organization_id` string, nullable — The organization ID if the migration is scoped to a specific organization
    - `instance_id` string, required — The instance ID this migration belongs to
    - `source_role_set_id` string, required — The ID of the source role set being migrated from
    - `dest_role_set_id` string, nullable — The ID of the destination role set being migrated to
    - `trigger_type` string, required — What triggered this migration (e.g., "role_set_deletion", "role_removal")
    - `status` string, required — Current status of the migration (e.g., "enqueued", "in_progress", "completed")
    - `migrated_members` integer, required — Number of members that have been migrated so far
    - `mappings` object, nullable — Role key mappings from source to destination roles
    - `started_at` integer, nullable — Unix timestamp when the migration started
    - `completed_at` integer, nullable — Unix timestamp when the migration completed
    - `created_at` integer, required — Unix timestamp of migration creation
    - `updated_at` integer, required — Unix timestamp of last migration update
  - `created_at` integer, required — Unix timestamp of role set creation
  - `updated_at` integer, required — Unix timestamp of last role set update

## Other responses

- `400` — Request was not successful
- `401` — Authentication invalid
- `403` — Authorization invalid
- `404` — Resource not found
- `422` — Invalid request parameters

---

[API](https://skmtc.dev/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.dev/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/revisions/75df3a43fcb2/schema)
