{"meta":{"title":"REST-API-Endpunkte für Teammitglieder","intro":"Verwende die REST-API, um die Mitgliedschaft von Teams in deiner GitHub-Organisation zu erstellen und zu verwalten.","product":"REST-API","breadcrumbs":[{"href":"/de/rest","title":"REST-API"},{"href":"/de/rest/teams","title":"Teams"},{"href":"/de/rest/teams/members","title":"Mitglieder"}],"documentType":"article"},"body":"# REST-API-Endpunkte für Teammitglieder\n\nVerwende die REST-API, um die Mitgliedschaft von Teams in deiner GitHub-Organisation zu erstellen und zu verwalten.\n\n## Informationen zu Teammitgliedern\n\nDiese Endpunkte sind nur für authentifizierte Mitglieder der [Organisation](/de/rest/orgs) des Teams verfügbar. OAuth-Zugriffstoken erfordern den `read:org`-[Bereich](/de/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps). GitHub generiert den `slug`-Wert des Teams aus dem `name`-Wert des Teams.\n\nWenn `pull`- und `push`-Berechtigungen akzeptiert werden, werden sie den **Lese**- und **Schreib**-Rollen für ein Organisations-Repository zugeordnet. Weitere Informationen zu Repositoryrollen findest du unter [Repositoryrollen für eine Organisation](/de/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization).\n\n> \\[!NOTE]\n> Wenn du die Teamsynchronisierung für ein Team mit dem Identitätsanbieter (IdP) deiner Organisation eingerichtet hast, wird beim Versuch, die API für Änderungen an der Teammitgliedschaft zu verwenden, ein Fehler angezeigt. Wenn Sie Zugriff auf die Verwaltung der Gruppenmitgliedschaft in Ihrem IdP haben, können Sie GitHub Teammitgliedschaft über Ihren Identitätsanbieter verwalten, wodurch Teammitglieder in einer Organisation automatisch hinzugefügt und entfernt werden. Weitere Informationen finden Sie unter [Verwalten der Teamsynchronisierung für deine Organisation](/de/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization).\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List pending team invitations\n\n```\nGET /orgs/{org}/teams/{team_slug}/invitations\n```\n\nThe return hash contains a role field which refers to the Organization Invitation role and will be one of the following values: direct\\_member, admin, billing\\_manager, hiring\\_manager, or reinstate. If the invitee is not a GitHub member, the login field in the return hash will be null.\nNote\n\nYou can also specify a team by org\\_id and team\\_id using the route GET /organizations/{org\\_id}/team/{team\\_id}/invitations.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/invitations\n```\n\n**Response schema (Status: 200):**\n\nArray of `Organization Invitation`:\n\n* `id`: required, integer, format: int64\n* `login`: required, string or null\n* `email`: required, string or null\n* `role`: required, string\n* `created_at`: required, string\n* `failed_at`: string or null\n* `failed_reason`: string or null\n* `inviter`: required, `Simple User`:\n  * `name`: string or null\n  * `email`: string or null\n  * `login`: required, string\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `avatar_url`: required, string, format: uri\n  * `gravatar_id`: required, string or null\n  * `url`: required, string, format: uri\n  * `html_url`: required, string, format: uri\n  * `followers_url`: required, string, format: uri\n  * `following_url`: required, string\n  * `gists_url`: required, string\n  * `starred_url`: required, string\n  * `subscriptions_url`: required, string, format: uri\n  * `organizations_url`: required, string, format: uri\n  * `repos_url`: required, string, format: uri\n  * `events_url`: required, string\n  * `received_events_url`: required, string, format: uri\n  * `type`: required, string\n  * `site_admin`: required, boolean\n  * `starred_at`: string\n  * `user_view_type`: string\n* `team_count`: required, integer\n* `node_id`: required, string\n* `invitation_teams_url`: required, string\n* `invitation_source`: string\n\n## List team members\n\n```\nGET /orgs/{org}/teams/{team_slug}/members\n```\n\nTeam members will include the members of child teams.\nTo list members in a team, the team must be visible to the authenticated user.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n* **`role`** (string)\n  Filters members returned by their role in the team.\n  Default: `all`\n  Can be one of: `member`, `maintainer`, `all`\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/members\n```\n\n**Response schema (Status: 200):**\n\nArray of `Simple User`:\n\n* `name`: string or null\n* `email`: string or null\n* `login`: required, string\n* `id`: required, integer, format: int64\n* `node_id`: required, string\n* `avatar_url`: required, string, format: uri\n* `gravatar_id`: required, string or null\n* `url`: required, string, format: uri\n* `html_url`: required, string, format: uri\n* `followers_url`: required, string, format: uri\n* `following_url`: required, string\n* `gists_url`: required, string\n* `starred_url`: required, string\n* `subscriptions_url`: required, string, format: uri\n* `organizations_url`: required, string, format: uri\n* `repos_url`: required, string, format: uri\n* `events_url`: required, string\n* `received_events_url`: required, string, format: uri\n* `type`: required, string\n* `site_admin`: required, boolean\n* `starred_at`: string\n* `user_view_type`: string\n\n## Get team membership for a user\n\n```\nGET /orgs/{org}/teams/{team_slug}/memberships/{username}\n```\n\nTeam members will include the members of child teams.\nTo get a user's membership with a team, the team must be visible to the authenticated user.\nNote\n\nYou can also specify a team by org\\_id and team\\_id using the route GET /organizations/{org\\_id}/team/{team\\_id}/memberships/{username}.\n\nNote\n\nThe response contains the state of the membership and the member's role.\n\nThe role for organization owners is set to maintainer. For more information about maintainer roles, see Create a team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - if user has no team membership\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/memberships/USERNAME\n```\n\n**Response schema (Status: 200):**\n\n* `url`: required, string, format: uri\n* `role`: required, string, enum: `member`, `maintainer`, default: `\"member\"`\n* `state`: required, string, enum: `active`, `pending`\n\n## Add or update team membership for a user\n\n```\nPUT /orgs/{org}/teams/{team_slug}/memberships/{username}\n```\n\nAdds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nNote\n\nWhen 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 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.\"\n\nAn organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the \"pending\" state until the person 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.\nIf 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.\nNote\n\nYou can also specify a team by org\\_id and team\\_id using the route PUT /organizations/{org\\_id}/team/{team\\_id}/memberships/{username}.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n#### Body parameters\n\n* **`role`** (string)\n  The role that this user should have in the team.\n  Default: `member`\n  Can be one of: `member`, `maintainer`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden if team synchronization is set up\n\n* **422** - Unprocessable Entity if you attempt to add an organization to a team\n\n### Code examples\n\n#### Add or update team membership for an organization member\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/memberships/USERNAME \\\n  -d '{\n  \"role\": \"maintainer\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get team membership for a user](#get-team-membership-for-a-user).\n\n## Remove team membership for a user\n\n```\nDELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\n```\n\nTo 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.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nNote\n\nWhen 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 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.\"\n\nNote\n\nYou can also specify a team by org\\_id and team\\_id using the route DELETE /organizations/{org\\_id}/team/{team\\_id}/memberships/{username}.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - Forbidden if team synchronization is set up\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/memberships/USERNAME\n```\n\n**Response schema (Status: 204):**\n\n## List pending team invitations (Legacy)\n\n```\nGET /teams/{team_id}/invitations\n```\n\nWarning\n\nEndpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List pending team invitations endpoint.\n\nThe return hash contains a role field which refers to the Organization Invitation role and will be one of the following values: direct\\_member, admin, billing\\_manager, hiring\\_manager, or reinstate. If the invitee is not a GitHub member, the login field in the return hash will be null.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/teams/TEAM_ID/invitations\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List pending team invitations](#list-pending-team-invitations).\n\n## List team members (Legacy)\n\n```\nGET /teams/{team_id}/members\n```\n\nWarning\n\nEndpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List team members endpoint.\n\nTeam members will include the members of child teams.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`role`** (string)\n  Filters members returned by their role in the team.\n  Default: `all`\n  Can be one of: `member`, `maintainer`, `all`\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/teams/TEAM_ID/members\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List team members](#list-team-members).\n\n## Get team member (Legacy)\n\n```\nGET /teams/{team_id}/members/{username}\n```\n\nThe \"Get team member\" endpoint (described below) is closing down.\nWe recommend using the Get team membership for a user endpoint instead. It allows you to get both active and pending memberships.\nTo list members in a team, the team must be visible to the authenticated user.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - if user is a member\n\n* **404** - if user is not a member\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/teams/TEAM_ID/members/USERNAME\n```\n\n**Response schema (Status: 204):**\n\n## Add team member (Legacy)\n\n```\nPUT /teams/{team_id}/members/{username}\n```\n\nThe \"Add team member\" endpoint (described below) is closing down.\nWe recommend using the Add or update team membership for a user endpoint instead. It allows you to invite new organization members to your teams.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nTo add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.\nNote\n\nWhen 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 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.\"\n\nNote that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see \"HTTP method.\"\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - Forbidden\n\n* **404** - Not Found if team synchronization is set up\n\n* **422** - Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/teams/TEAM_ID/members/USERNAME\n```\n\n**Response schema (Status: 204):**\n\n## Remove team member (Legacy)\n\n```\nDELETE /teams/{team_id}/members/{username}\n```\n\nThe \"Remove team member\" endpoint (described below) is closing down.\nWe recommend using the Remove team membership for a user endpoint instead. It allows you to remove both active and pending memberships.\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nTo remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.\nNote\n\nWhen 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 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.\"\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **404** - Not Found if team synchronization is setup\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/teams/TEAM_ID/members/USERNAME\n```\n\n**Response schema (Status: 204):**\n\n## Get team membership for a user (Legacy)\n\n```\nGET /teams/{team_id}/memberships/{username}\n```\n\nWarning\n\nEndpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Get team membership for a user endpoint.\n\nTeam members will include the members of child teams.\nTo get a user's membership with a team, the team must be visible to the authenticated user.\nNote:\nThe response contains the state of the membership and the member's role.\nThe role for organization owners is set to maintainer. For more information about maintainer roles, see Create a team.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/teams/TEAM_ID/memberships/USERNAME\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get team membership for a user](#get-team-membership-for-a-user).\n\n## Add or update team membership for a user (Legacy)\n\n```\nPUT /teams/{team_id}/memberships/{username}\n```\n\nWarning\n\nEndpoint closing down notice: This endpoint route is closing down 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.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nIf 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.\nNote\n\nWhen 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 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.\"\n\nIf 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.\nIf 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n#### Body parameters\n\n* **`role`** (string)\n  The role that this user should have in the team.\n  Default: `member`\n  Can be one of: `member`, `maintainer`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden if team synchronization is set up\n\n* **404** - Resource not found\n\n* **422** - Unprocessable Entity if you attempt to add an organization to a team\n\n### Code examples\n\n#### Assign the member role for a user in a team\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  https://api.github.com/teams/TEAM_ID/memberships/USERNAME \\\n  -d '{\n  \"role\": \"member\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get team membership for a user](#get-team-membership-for-a-user).\n\n## Remove team membership for a user (Legacy)\n\n```\nDELETE /teams/{team_id}/memberships/{username}\n```\n\nWarning\n\nEndpoint closing down notice: This endpoint route is closing down 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.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.\nTo 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.\nNote\n\nWhen 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 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.\"\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`team_id`** (integer) (required)\n  The unique identifier of the team.\n\n* **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **403** - if team synchronization is set up\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/teams/TEAM_ID/memberships/USERNAME\n```\n\n**Response schema (Status: 204):**"}