---
title: "Assign an enterprise role to a team"
method: PUT
path: "/enterprises/{enterprise}/enterprise-roles/teams/{team_slug}/{role_id}"
tags: ["enterprise-admin"]
---

# Assign an enterprise role to a team

`PUT /enterprises/{enterprise}/enterprise-roles/teams/{team_slug}/{role_id}`

## Request

- Base URL: `https://api.github.com`
- URL: `https://api.github.com/enterprises/{enterprise}/enterprise-roles/teams/{team_slug}/{role_id}`
- Auth: none declared

Assigns an enterprise role to 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
- `role_id` integer, 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.dev/github/apis/enterprise-cloud.md) - [All operations](https://skmtc.dev/github/apis/enterprise-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/github/apis/enterprise-cloud/revisions/998ae512e4cd?raw)
