Add or update team membership for a user (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Add or update team membership for a user endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
If the user is already a member of the team’s organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub Enterprise Server.”
If the user is unaffiliated with the team’s organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the “pending” state until the user accepts the invitation, at which point the membership will transition to the “active” state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.
If the user is already a member of the team, this endpoint will update the role of the team member’s role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
Path Parameters
Body
application/json
Body
The role that this user should have in the team. Can be one of:
* member
- a normal member of the team.
* maintainer
- a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team’s name and description.
Allowed values:membermaintainer
Default:member
Response
application/json
Response
Response
Team Membership
Team Membership
The role of the user in the team.
Allowed values:membermaintainer
Default:member
Example:member
The state of the user’s membership in the team.
Allowed values:activepending
Path Parameters
Body
Remove team membership for a user (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Remove team membership for a user endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.
To remove a membership between a user and a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.
Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub Enterprise Server.”
Path Parameters
Response
Response
Response
Path Parameters
List team projects (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new List team projects
endpoint.
Lists the organization projects for a team.
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
Response
application/json
Response
Response
A team’s access to a project.
Simple User
Show Child Parameters
The organization permission for this project. Only present when owner is an organization.
Whether the project is private or not. Only present when owner is an organization.
Show Child Parameters
Path Parameters
Query Parameters
Check team permissions for a project (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Check team permissions for a project endpoint.
Checks whether a team has read
, write
, or admin
permissions for an organization project. The response includes projects inherited from a parent team.
Path Parameters
Response
application/json
Response
Response
Team Project
A team’s access to a project.
Simple User
Show Child Parameters
The organization permission for this project. Only present when owner is an organization.
Whether the project is private or not. Only present when owner is an organization.
Show Child Parameters
Path Parameters
Add or update team project permissions (Legacy)
DEPRECATEDDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Add or update team project permissions endpoint.
Adds an organization project to a team. To add a project to a team or update the team’s permission on a project, the authenticated user must have admin
permissions for the project. The project and team must be part of the same organization.
Path Parameters
Body
application/json
Body
The permission to grant to the team for this project. Can be one of:
* read
- team members can read, but not write to or administer this project.
* write
- team members can read and write, but not administer this project.
* admin
- team members can read, write and administer this project.
Default: the team’s permission
attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Allowed values:readwriteadmin
Response
Response
Response