---
title: "Remove all enterprise roles from a team"
method: DELETE
path: "/enterprises/{enterprise}/enterprise-roles/teams/{team_slug}"
tags: ["enterprise-admin"]
---

# Remove all enterprise roles from a team

`DELETE /enterprises/{enterprise}/enterprise-roles/teams/{team_slug}`

Removes all assigned enterprise roles from a team in an enterprise.

> [!WARNING]
> This API is not available for Copilot Business for non-GHE.

To use this endpoint, the authenticated user must be one of:

  - An administrator for the enterprise.
  - A user, or a user on a team, with the fine-grained permission `write_enterprise_custom_enterprise_role` in the enterprise.

OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint.

## Path parameters

- `enterprise` string, required
- `team_slug` string, required

## Response `204`

Response

## Other responses

- `403` — Forbidden
- `404` — Resource not found
- `422` — Response if the enterprise roles feature is not enabled for the enterprise, or validation failed.

---

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