Repository navigation
feat: add team role management - #44
Merged
Merged
Conversation
Add `team.retrieveRole`, `team.createRole`, `team.updateRole`, `team.deleteRole` and `team.duplicateRole` (team token). `deleteRole` takes an optional `replacement_role_id` query, which moves the role's existing assignments to another role. Co-Authored-By: Claude <noreply@anthropic.com>
bjarn
added this pull request to stack #46
October 20, 2026 20:46
bjornftw
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds custom team role management as methods on
team, next to the existingteam.roles()list method (team token).team.rolesis already that list method, so the new calls are named…Roleonteam:retrieveRole(roleId, options?)GET /team/roles/{roleId}TeamRoleDatacreateRole(body, options?)POST /team/roleswithCreateTeamRoleData(name,description?,permissions)TeamRoleData(201)updateRole(roleId, body, options?)PUT /team/roles/{roleId}withUpdateTeamRoleDataTeamRoleDatadeleteRole(roleId, query?, options?)DELETE /team/roles/{roleId}, optional{ replacement_role_id }MessageResponseduplicateRole(roleId, body, options?)POST /team/roles/{roleId}/duplicatewithDuplicateTeamRoleData(name,description?)TeamRoleData(201)deleteRoletakes the optional query the same way the other methods with query parameters do.replacement_role_idis the role that receives the deleted role's assignments. It is needed only while the role is still assigned to members, invitations or SCIM groups. Without it (or withnull), no query parameter is sent.duplicateRolewithout adescriptionkeeps the source role's description.TeamRoleData.description(string | null, optional) is typed on every role result, includingteam.roles().ConflictErrorand a 422 the existingValidationError. Empty,.and..role IDs are rejected before any request. NoIdempotency-Key.Non-breaking.
Usage
Checks
On this branch:
npm run lint: passednpm run type-check: passednpm run generate:check: generated files up to date with the pinned spec; the header-only mode that CI runs also passesnpm run test:coverage: 8 suites, 345 tests passednpm run test:coverageon Node 20.18.0, 22.21.0 and 24.18.0: 345 passed eachnpm run build: passednpm run test:smoke: ESM import, CJS require and type declarations OKNot run locally
Nothing; every CI step was run locally.
🤖 Generated with Claude Code