Repository navigation
feat: add team invites - #43
Merged
Merged
Conversation
- Add team invite operations: GET/POST /team/invites and
GET/PUT/DELETE /team/invites/{inviteId}, with TeamInviteData,
CreateTeamInviteData, UpdateTeamInviteData, ListTeamInvitesQuery and
ListTeamInvitesResponse
- Add team role operations: GET/PUT/DELETE /team/roles/{roleId} and
POST /team/roles, POST /team/roles/{roleId}/duplicate, with
CreateTeamRoleData, UpdateTeamRoleData, DuplicateTeamRoleData and
DeleteTeamRoleQuery (optional replacement_role_id)
- Add DELETE /team/members/{userId}
- ListTeamMembersQuery gains the optional filter[project_id]
- TeamRoleData gains the optional, nullable description
Co-Authored-By: Claude <noreply@anthropic.com>
Add `team.invites` with `list`, `iterate`, `retrieve`, `create`, `update` and `revoke` for pending team invitations (team token). The coverage test lists the team role and member removal operations as pending; the next PRs in this stack add their methods. 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
team.invites, a sub-resource for pending team invitations, next toteam.membersand in the same style (team token):list(query?, options?)GET /team/invites(page: { size, cursor })ListTeamInvitesResponse(CursorPage<TeamInviteData>)iterate(query?, options?)next_cursorAsyncGenerator<TeamInviteData>retrieve(inviteId, options?)GET /team/invites/{inviteId}TeamInviteDatacreate(body, options?)POST /team/inviteswithCreateTeamInviteDataTeamInviteData(201)update(inviteId, body, options?)PUT /team/invites/{inviteId}withUpdateTeamInviteDataTeamInviteDatarevoke(inviteId, options?)DELETE /team/invites/{inviteId}MessageResponsecreatesends the invitation email. The team needs a free seat, and the Owner role can't be assigned.updatereplaces the email, role and project access. A new email is sent only when the address changes.ConflictErrorand a 422 the existingValidationError(bothApiError). No new error classes..and..invite IDs are rejected before any request, as for the other methods.Idempotency-Key, so there is no idempotency option.TeamInvitesis exported as a type, likeTeamMembers.team.invitesis in the Team API table and the Team API example.Team role management and member removal are added by the PRs stacked on top of this one. Until then, the coverage test lists those six operations as pending. Every other operation is still checked strictly.
Non-breaking. Suggested bump: minor.
API changes in the regenerated types
GET /team/invites(cursor paginated,page[size],page[cursor])ListTeamInvitesQuery,ListTeamInvitesResponse,TeamInviteDatateam.invites.list/iterate(this PR)GET /team/invites/{inviteId}TeamInviteDatateam.invites.retrieve(this PR)POST /team/invites(201; also 409, 422)CreateTeamInviteDatateam.invites.create(this PR)PUT /team/invites/{inviteId}(also 409, 422)UpdateTeamInviteDatateam.invites.update(this PR)DELETE /team/invites/{inviteId}MessageResponseteam.invites.revoke(this PR)GET /team/roles/{roleId}TeamRoleDatateam.retrieveRole(next PR)POST /team/roles(201; also 409, 422)CreateTeamRoleDatateam.createRole(next PR)PUT /team/roles/{roleId}(also 409, 422)UpdateTeamRoleDatateam.updateRole(next PR)DELETE /team/roles/{roleId}with optionalreplacement_role_id(also 409, 422)DeleteTeamRoleQueryteam.deleteRole(next PR)POST /team/roles/{roleId}/duplicate(201)DuplicateTeamRoleDatateam.duplicateRole(next PR)DELETE /team/members/{userId}(also 409)MessageResponseteam.members.remove(last PR)GET /team/membersgains the optionalfilter[project_id]: only members who can access that projectListTeamMembersQueryteam.members.list/iterate; tested in the last PRdescription?: string | nullon rolesTeamRoleData(also inteam.roles()results)TeamRoleDatais now listed inOperationTypes(it is a direct response type now)operations.tsNo existing type loses or changes a field.
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, 333 tests passednpm run test:coverageon Node 20.18.0, 22.21.0 and 24.18.0: 333 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.
Suggested release tag
v3.2.0(minor).mainalready has unreleased features sincev3.1.0, so this fits in the same minor release.🤖 Generated with Claude Code