---
title: "Rename a role"
method: PATCH
path: "/v1/permissions/sets/{permissionSetId}"
tags: ["Permissions"]
---

# Rename a role

`PATCH /v1/permissions/sets/{permissionSetId}`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/permissions/sets/{permissionSetId}`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Renames a team permission set (a custom role). Member, Admin and Super admin permissions keep their names, and archived sets can't be changed. Requires permissions.manage (only the owner has it by default), a recent sign-in.

## Path parameters

- `permissionSetId` string, typeid, required

## Request body

- RenamePermissionSetBody
  - `name` string, required: The role's new name.

## Response `200`

Role renamed; its current state is returned.

- PermissionSetResponse
  - `set` PermissionSetDetail, required
    - `id` string, required
    - `name` string, required
    - `kind` 'member_default' | 'admin_default' | 'billing_manager_default' | 'super_admin_default' | 'team', required
    - `team` PermissionSetTeam, nullable, required
      - `id` string, required
      - `name` string, nullable, required: Null when the team no longer exists.
    - `teams` PermissionSetTeam[], required: Every team the set applies to now. More than one only with Shared roles.
      - `id` string, required
      - `name` string, nullable, required: Null when the team no longer exists.
    - `directMemberIds` string[], required: People given this set directly, without a team (a custom role or Billing manager). Member ids only; pending invitations included.
    - `allowedCount` integer, required
    - `createdAt` string, date-time, required
    - `archivedAt` string, date-time, nullable, required
    - `permissions` PermissionSetKeyState[], required
      - `key` string, required
      - `status` 'allow' | 'deny', required
      - `locked` boolean, required: Always on in this set; it can't be turned off.
      - `lastChangedAt` string, date-time, nullable, required
      - `lastChangedBy` PermissionChangedBy, nullable, required
        - `memberId` string, required
        - `name` string, nullable, required
        - `email` string, nullable, required: Null unless the caller holds teams.view, or when the member has no email.
      - `lastChangeSource` 'user' | 'seed' | 'reconcile' | 'migration', nullable, required
    - `appliesTo` union, required
      - object
        - `kind` 'everyone', required
        - `memberCount` integer, required
      - object
        - `kind` 'admins', required
        - `directAdminCount` integer, required
        - `directAdmins` PermissionPerson[], nullable, required: Names and emails of members with the admin role. Null unless the caller holds teams.view; directAdminCount is always returned.
          - `memberId` string, required
          - `name` string, required
          - `email` string, required
        - `adminTeams` object[], required
          - `id` string, required
          - `name` string, required
          - `memberCount` integer, required
      - object
        - `kind` 'super_admins', required
        - `superAdminCount` integer, required
        - `superAdmins` PermissionPerson[], nullable, required: Names and emails of members with the super-admin role. Null unless the caller holds teams.view; superAdminCount is always returned.
          - `memberId` string, required
          - `name` string, required
          - `email` string, required
      - object
        - `kind` 'team', required
        - `team` PermissionSetTeam, nullable, required
          - `id` string, required
          - `name` string, nullable, required: Null when the team no longer exists.
        - `teams` PermissionSetTeam[], required
          - `id` string, required
          - `name` string, nullable, required: Null when the team no longer exists.
        - `memberCount` integer, required: People in any of the set's teams, each counted once.
        - `members` PermissionPerson[], nullable, required: Names and emails of the people in the set's teams. Null unless the caller holds teams.view; memberCount is always returned.
          - `memberId` string, required
          - `name` string, required
          - `email` string, required

## Other responses

- `400`: The body or id was invalid, or the set is Member, Admin or Super admin permissions.
- `401`: The caller must be signed in.
- `403`: The caller lacks permissions.manage or needs a recent sign-in.
- `404`: The permission set or organization was not found, or Permissions or Shared roles is turned off.
- `409`: The permission set is archived.

## Changes

- **2026-11-10** `7caa32d85ccc`: 1 warning, 1 info
  - added the new `billing_manager_default` enum value to the `set/kind` response property for the response status `200`
  - added the required property `set/directMemberIds` to the response with the `200` status
- **2026-11-06** `20dfeecd1cd0`: 1 breaking, 1 warning
  - added `subschema #3` to the `set/appliesTo` response property `oneOf` list for the response status `200`
  - added the new `super_admin_default` enum value to the `set/kind` response property for the response status `200`
- **2026-10-23** `c93387179b31`: 6 breaking, 10 info
  - the response property `set/appliesTo/oneOf[subschema #3]/team/anyOf[#/components/schemas/PermissionSetTeam]/name` became nullable for the status `200`
  - the response property `set/appliesTo/oneOf[subschema #3]/teams/items/name` became nullable for the status `200`
  - the response property `set/permissions/items/lastChangedBy/anyOf[#/components/schemas/PermissionChangedBy]/email` became nullable for the status `200`
  - the response property `set/permissions/items/lastChangedBy/anyOf[#/components/schemas/PermissionChangedBy]/name` became nullable for the status `200`
  - …12 more
- **2026-10-14** `0005cd4e85a8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/permissions/sets/:permissionSetId/patch.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
