Repository navigation
feat: add team invites - #42
Merged
Merged
Conversation
- Team invites: list (cursor paginated), get, create, update and revoke
(/team/invites), with TeamInviteData, CreateTeamInviteData,
UpdateTeamInviteData and ListTeamInvitesQuery.
- Team roles: get, create, update, delete (optional replacement_role_id
query, DeleteTeamRoleQuery) and duplicate (/team/roles), with
CreateTeamRoleData, UpdateTeamRoleData and DuplicateTeamRoleData.
- Team members: remove a member (DELETE /team/members/{userId}).
- GET /team/members takes the optional filter[project_id] query parameter
(ListTeamMembersQuery.FilterProjectID).
- TeamRoleData gains the optional, nullable description field.
Co-Authored-By: Claude <noreply@anthropic.com>
Add Team.Invites (TeamInvitesService) to list, iterate, retrieve, create, update and revoke pending team invitations. Needs a team token. The team role and member removal operations are listed as pending in the coverage test; the next changes add their methods. Co-Authored-By: Claude <noreply@anthropic.com>
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
Non-breaking. Adds
Team.Invites, aTeamInvitesServicethat manages pending team invitations, and regenerates the types from the latest API spec. Suggested version bump: minor.Team.Invites.List(ctx, *ListTeamInvitesQuery, ...RequestOption) (*ListTeamInvitesResponse, error)GET /team/invitesTeam.Invites.Iterate(ctx, *ListTeamInvitesQuery, ...RequestOption) iter.Seq2[TeamInviteData, error]GET /team/invites, followingnext_cursorTeam.Invites.Retrieve(ctx, inviteID, ...RequestOption) (*TeamInviteData, error)GET /team/invites/{inviteId}Team.Invites.Create(ctx, CreateTeamInviteData, ...RequestOption) (*TeamInviteData, error)POST /team/invitesTeam.Invites.Update(ctx, inviteID, UpdateTeamInviteData, ...RequestOption) (*TeamInviteData, error)PUT /team/invites/{inviteId}Team.Invites.Revoke(ctx, inviteID, ...RequestOption) (*MessageResponse, error)DELETE /team/invites/{inviteId}Team.Members: the same options, empty-ID validation and error types (409 is a*ConflictError, 422 a*ValidationError).Createsends the invitation email. The team needs a free seat, and the Owner role can't be assigned.Updatereplaces the email address, role and project access, and sends a new email only when the address changes.TestEveryOperationHasAMethod) lists those six operations as pending. Every other operation is still strictly checked, and the test fails if a pending operation gets a method without being removed from the list.Team.Invitesin the Team API table, with an example.API changes in the regenerated types
GET /team/invitespage[size],page[cursor]);ListTeamInvitesQuery,ListTeamInvitesResponseTeam.Invites.List,Team.Invites.Iterate(this PR)GET /team/invites/{inviteId}TeamInviteData)Team.Invites.Retrieve(this PR)POST /team/invitesTeamInviteData, 409, 422; bodyCreateTeamInviteDataTeam.Invites.Create(this PR)PUT /team/invites/{inviteId}UpdateTeamInviteDataTeam.Invites.Update(this PR)DELETE /team/invites/{inviteId}MessageResponseTeam.Invites.Revoke(this PR)GET /team/roles/{roleId}TeamRoleData)Team.RetrieveRole(stacked PR)POST /team/rolesTeamRoleData, 409, 422; bodyCreateTeamRoleDataTeam.CreateRole(stacked PR)PUT /team/roles/{roleId}UpdateTeamRoleDataTeam.UpdateRole(stacked PR)DELETE /team/roles/{roleId}replacement_role_idquery (DeleteTeamRoleQuery);MessageResponse, 409, 422Team.DeleteRole(stacked PR)POST /team/roles/{roleId}/duplicateTeamRoleData; bodyDuplicateTeamRoleDataTeam.DuplicateRole(stacked PR)DELETE /team/members/{userId}MessageResponse, 409Team.Members.Remove(stacked PR)GET /team/membersfilter[project_id]query parameter (ListTeamMembersQuery.FilterProjectID): only members who can access the projectTeam.Members.List,Team.Members.Iteratealready take the query (stacked PR adds the test and docs)TeamRoleDataDescriptionfield (Nullable[string], optional)TeamInviteData,TeamInviteDataRole{id, email, role {id, name}, project_access, created_at}Usage
Checks
Run on this branch with
GOFLAGS=-buildvcs=false(worktree):test -z "$(gofmt -l .)": passesgo vet ./...: passessh scripts/generate.sh --check: passes (generated files up to date; the header check that CI runs also passes)go test -race -coverprofile=coverage.out ./...: passes (coverage 94.3%)go build ./...: passesgo mod tidy && git diff --exit-code go.mod: no changes (nogo.sum)go vet,go test -raceandgo buildwith Go 1.24.13 (minimum), 1.26.4 and 1.27.1: passgorelease -base=v3.1.0(top of the stack): every change from this stack is compatible. It reports one incompatible change,SendBatchMailRequest: changed from []SendMailRequest to []SendBatchMailItem, which is already onmainfrom the per-email idempotency keys change (feat: add per-email idempotency keys to batch send #38) and not part of this stack. Against currentmain(gorelease -base=github.com/lettermint/lettermint-go/v3@8982ddb), it reports only compatible changes, includingTeamRoleData.Description: added,ListTeamMembersQuery.FilterProjectID: addedandTeamService.Invites: added.Not run locally
Suggested release tag
v3.2.0(minor: new methods and fields), after the whole stack is merged.🤖 Generated with Claude Code