---
title: "Create team permissions"
method: POST
path: "/v1/permissions/sets"
tags: ["Permissions"]
---

# Create team permissions

`POST /v1/permissions/sets`

## Request

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

Creates the permission set for one team, named "<team name> Permissions" (fixed from then on), links it to the team and stores its initial permissions. A team can have one active set. Send name (and optionally teamIds) instead of teamId to create a named role that can be given to any number of teams; each listed team's current custom role is replaced. You can only turn on permissions you have yourself. Requires permissions.manage (only the owner has it by default), and a recent sign-in.

## Request body

- CreatePermissionSetBody
  - `teamId` string, typeid: The one team this set applies to, named "<team name> Permissions". A team can have one active permission set. Required unless Shared roles is on and name is given.
  - `name` string: Shared roles: the role's name. Required when teamId is left out.
  - `teamIds` string[]: Shared roles: teams that get this role now. Each team's current custom role is replaced. Left out or empty, the role starts with no team.
  - `memberIds` string[]: People who get this role directly now, without a team. Each person's current directly given role is replaced. Needs members.update as well, and can't include yourself. Only with name.
  - `permissions` object[], required: Initial status per key. Keys left out, or set to deny, start denied.
    - `key` string, required: Permission key from GET /v1/permissions/catalog, e.g. llm_provider.delete.
    - `status` 'allow' | 'deny', required

## Response `201`

Team permission set created.

- 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 was invalid or named an unknown or repeated permission.
- `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 organization or team was not found, or Permissions is turned off.
- `409`: The team already has an active permission set.

## Changes

- **2026-11-10** `7caa32d85ccc`: 5 warning, 2 info
  - added the new `billing_manager_default` enum value to the `set/kind` response property for the response status `201`
  - added the new `own_role` enum value to the `anyOf[#/components/schemas/PermissionEditError]/error` response property for the response status `400`
  - 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 `400`
  - …3 more
- **2026-11-06** `20dfeecd1cd0`: 1 breaking, 3 warning
  - added `subschema #3` to the `set/appliesTo` response property `oneOf` list for the response status `201`
  - added the new `super_admin_default` enum value to the `set/kind` response property for the response status `201`
  - added the new `super_admin_permissions_require_super_admin` enum value to the `anyOf[#/components/schemas/PermissionEditError]/error` response property for the response status `400`
  - 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/permissions/sets/post.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)
