---
title: "Set a team's custom role"
method: PUT
path: "/v1/teams/{teamId}/permission-set"
tags: ["Permissions"]
---

# Set a team's custom role

`PUT /v1/teams/{teamId}/permission-set`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/teams/{teamId}/permission-set`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Gives a team one custom role (a team permission set), replacing its current one, or none with permissionSetId null. The same role can be given to any number of teams; a role left with no team is kept until it is deleted. You can only give a role whose permissions you all have yourself. Whether the team is an Admin team is changed separately (PATCH /v1/teams/:teamId). Requires permissions.manage (only the owner has it by default), a recent sign-in.

## Path parameters

- `teamId` string, typeid, required

## Request body

- TeamPermissionSetBody
  - `permissionSetId` string, typeid, nullable, required: Den TypeID with 'pms_' prefix and a 26-character base32 suffix.

## Response `200`

The team's custom role was set; the role's current state is returned, or null when the team has none.

- TeamPermissionSetResponse
  - `set` PermissionSetDetail, nullable, 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, needs a recent sign-in, tried to turn on a permission they don't have, tried to change Admin permissions without being the owner or an admin, or tried to change Super admin permissions without being the owner or a super admin.
- `404`: The team, 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`: 3 warning, 1 info
  - added the new `billing_manager_default` enum value to the `set/anyOf[#/components/schemas/PermissionSetDetail]/kind` response property for the response status `200`
  - added the new `own_role` enum value to the `anyOf[#/components/schemas/PermissionEditError]/error` response property for the response status `403`
  - added the new `super_admin_role_requires_super_admin` enum value to the `anyOf[#/components/schemas/PermissionEditError]/error` response property for the response status `403`
  - added the required property `set/anyOf[#/components/schemas/PermissionSetDetail]/directMemberIds` to the response with the `200` status
- **2026-11-06** `20dfeecd1cd0`: 1 breaking, 2 warning
  - added `subschema #3` to the `set/anyOf[#/components/schemas/PermissionSetDetail]/appliesTo` response property `oneOf` list for the response status `200`
  - added the new `super_admin_default` enum value to the `set/anyOf[#/components/schemas/PermissionSetDetail]/kind` response property for the response status `200`
  - added the new `super_admin_permissions_require_super_admin` enum value to the `anyOf[#/components/schemas/PermissionEditError]/error` response property for the response status `403`
- …earlier changes not shown

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/teams/:teamId/permission-set/put.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)
