Team Members API
Team members are the people inside a team: the owner and everyone invited to work in it, staff and client guests alike.
Team members are the people inside a team: the owner and everyone invited to work in it, staff and client guests alike. A member joins by invitation to an email address with a role code, holds one role at a time, and leaves by removal; a pending invitation is withdrawn rather than removed, with the same ability, because both revoke the same prospective access. The team's owner appears as the first row of the roster but is not a membership: ownership cannot be re-roled or removed here.
A guest is a member too: a client stakeholder invited with the guest role and one project, who sees that project alone and nothing of the team. Inviting a guest therefore names the project, and accepting the invitation writes the project membership beside the team one.
Reading who is on a team and reading how to reach them are separate asks, so email is present only when the token carries team-member:view and is otherwise absent from the row altogether. The lists are not paginated, since a team's roster is small by construction. Every change announces itself as a team.* event.
Background
What the API refuses
| Attempt | Result |
|---|---|
| Re-role or remove the owner | 404: ownership is not a membership row |
| Invite someone already in the team or already invited | 422 |
Name a role code the team does not have | 422 |
Invite a guest without a project_id, or name one for any other role | 422 |
| Address a user who is not in the team | 404 |
| Address a team the caller cannot see | 404 |
A team is visible only when the caller owns it or is a member. Tokens scoped to a different team get 404 RESOURCE_NOT_FOUND on every route here; existence never leaks.
Endpoints
/v1/teams/{team}/invitationsList a team's pending invitationsGET/v1/teams/{team}/membersList a team's membersPOST/v1/teams/{team}/membersInvite a team memberGET/v1/teams/{team}/members/{member}Get a team memberDELETE/v1/teams/{team}/members/{member}Remove a team memberPATCH/v1/teams/{team}/members/{member}/roleChange a team member's roleDELETE/v1/teams/{team}/invitations/{invitation}Withdraw an invitationRelated
How is this guide?
Last updated on