---
title: "Remove team membership for a user"
method: DELETE
path: "/orgs/{org}/teams/{team_slug}/memberships/{username}"
tags: ["teams"]
---

# Remove team membership for a user

`DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}`

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.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-cloud@latest/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

> [!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 Cloud 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 Cloud](https://docs.github.com/enterprise-cloud@latest/articles/synchronizing-teams-between-your-identity-provider-and-github/)."

> [!NOTE]
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.

## Path parameters

- `org` string, required
- `team_slug` string, required
- `username` string, required

## Response `204`

Response

## Other responses

- `403` — Forbidden if team synchronization is set up

---

[API](https://skmtc.net/github/apis/ghec.md) · [All operations](https://skmtc.net/github/apis/ghec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/ghec/revisions/8ae6d0c8716e/schema)
