Repository navigation
feat: add team role management - #52
Merged
Merged
Conversation
Add `retrieveRole`, `createRole`, `updateRole`, `deleteRole` and `duplicateRole` to `$lettermint->team`. `deleteRole` takes an optional `replacement_role_id` query for a role that is still assigned. Co-Authored-By: Claude <noreply@anthropic.com>
bjarn
added this pull request to stack #54
October 20, 2026 20:49
bjornftw
approved these changes
Oct 20, 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 team role management to
$lettermint->team.team->rolesis already the role list, so these are methods onteam, named like the existing ones (team token):retrieveRole(string $roleId)GET /team/roles/{roleId}TeamRoleDatacreateRole(array $body)POST /team/roleswithCreateTeamRoleData(name,description?,permissions)TeamRoleData(201)updateRole(string $roleId, array $body)PUT /team/roles/{roleId}withUpdateTeamRoleDataTeamRoleDatadeleteRole(string $roleId, array $query = [])DELETE /team/roles/{roleId}, optional['replacement_role_id' => …](DeleteTeamRoleQuery)MessageResponseduplicateRole(string $roleId, array $body)POST /team/roles/{roleId}/duplicatewithDuplicateTeamRoleData(name,description?)TeamRoleData(201)deleteRoletakes the generated query shape, liketeam->retrieve(array $query = []). Without it, or withreplacement_role_idset tonull, no query parameter is sent. A replacement role is needed only while the role is still assigned to members, invites or SCIM groups.TeamRoleData->description(string|null) is tested set,nulland absent.ConflictException, with the conflict code (for examplebuilt_in_role_immutable) inerrorCode. A 422 throwsValidationException. Empty,.and..role IDs are rejected before any request.Idempotency-Keyon these operations.Non-breaking.
Usage
Checks
On this branch (PHP 8.5, Composer 2.10):
vendor/bin/pest --ci: 344 passed (3799 assertions)vendor/bin/phpstan: no errorsvendor/bin/pint --test: passedcomposer generate:check(full regeneration check): 170 generated files up to datecomposer generate:checkin the header-only mode that CI runs: headers of 170 generated files OKNot run locally
🤖 Generated with Claude Code