Skip to main content
Ahora la API REST está versionada. Para obtener más información, consulta "Acerca del control de versiones de la API".

Puntos de conexión de API REST para equipos empresariales

Usa la API de REST para crear y administrar equipos empresariales en tu empresa de GitHub.

Acerca de los equipos empresariales

Nota:

Actualmente, estos puntos de conexión se encuentran en versión preliminar pública y están sujetos a cambios.

Esta documentación de la API está destinada a empresas en GitHub Enterprise Cloud.

Si tu empresa es Copilot Business para no GHE, consulta el vínculo de documentación de acceso anticipado que se te ha compartido anteriormente.

Estos puntos de conexión solo están disponibles para los miembros autenticados de la empresa del equipo empresarial con personal access tokens clásicos con el ámbito read:enterprise de las API GET y admin:enterprise para otras API.

Estos puntos de conexión no son compatibles con fine-grained personal access tokens o tokens de acceso a aplicaciones de GitHub.

GitHub genera el slug del equipo empresarial a partir del equipo name y agrega el prefijo ent:.

List enterprise teams

List all teams in the enterprise for the authenticated user

Tokens de acceso granulares para "List enterprise teams"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise teams" enterprise permissions (read)

Parámetros para "List enterprise teams"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Parámetros de consulta
Nombre, Tipo, Descripción
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Valor predeterminado: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Valor predeterminado: 1

Códigos de estado de respuesta HTTP para "List enterprise teams"

código de estadoDescripción
200

OK

403

Forbidden

Ejemplos de código para "List enterprise teams"

Ejemplo de solicitud

get/enterprises/{enterprise}/teams
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams

Response

Status: 200
[ { "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" } ]

Create an enterprise team

To create an enterprise team, the authenticated user must be an owner of the enterprise.

Tokens de acceso granulares para "Create an enterprise team"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise teams" enterprise permissions (write)

Parámetros para "Create an enterprise team"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Parámetros del cuerpo
Nombre, Tipo, Descripción
name string Obligatorio

The name of the team.

description string or null

A description of the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be set.

Valor predeterminado: disabled

Puede ser uno de los siguientes: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API endpoint. all: The team is assigned to all current and future organizations in the enterprise.

Valor predeterminado: disabled

Puede ser uno de los siguientes: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. You can get this value from the REST API endpoints for SCIM.

notification_setting string

The notification setting the team is set to. The options are:

  • notifications_enabled - team members receive notifications when the team is @mentioned.
  • notifications_disabled - no one receives notifications.

Default: notifications_enabled

Puede ser uno de los siguientes: notifications_enabled, notifications_disabled

Códigos de estado de respuesta HTTP para "Create an enterprise team"

código de estadoDescripción
201

Created

Ejemplos de código para "Create an enterprise team"

Ejemplo de solicitud

post/enterprises/{enterprise}/teams
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 201
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Get an enterprise team

Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a - separator and adds the "ent:" prefix. For example, "My TEam Näme" would become ent:my-team-name.

Tokens de acceso granulares para "Get an enterprise team"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise teams" enterprise permissions (read)

Parámetros para "Get an enterprise team"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

team_slug string Obligatorio

The slug of the team name.

Códigos de estado de respuesta HTTP para "Get an enterprise team"

código de estadoDescripción
200

OK

403

Forbidden

Ejemplos de código para "Get an enterprise team"

Ejemplo de solicitud

get/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 200
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Update an enterprise team

To edit a team, the authenticated user must be an enterprise owner.

Tokens de acceso granulares para "Update an enterprise team"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise teams" enterprise permissions (write)

Parámetros para "Update an enterprise team"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

team_slug string Obligatorio

The slug of the team name.

Parámetros del cuerpo
Nombre, Tipo, Descripción
name string or null

A new name for the team.

description string or null

A new description for the team.

sync_to_organizations string

Retired: this field is no longer supported. Whether the enterprise team should be reflected in each organization. This value cannot be changed.

Valor predeterminado: disabled

Puede ser uno de los siguientes: all, disabled

organization_selection_type string

Specifies which organizations in the enterprise should have access to this team. Can be one of disabled, selected, or all. disabled: The team is not assigned to any organizations. This is the default when you create a new team. selected: The team is assigned to specific organizations. You can then use the add organization assignments API. all: The team is assigned to all current and future organizations in the enterprise.

Valor predeterminado: disabled

Puede ser uno de los siguientes: disabled, selected, all

group_id string or null

The ID of the IdP group to assign team membership with. The new IdP group will replace the existing one, or replace existing direct members if the team isn't currently linked to an IdP group.

notification_setting string

The notification setting the team is set to. The options are:

  • notifications_enabled - team members receive notifications when the team is @mentioned.
  • notifications_disabled - no one receives notifications.

Puede ser uno de los siguientes: notifications_enabled, notifications_disabled

Códigos de estado de respuesta HTTP para "Update an enterprise team"

código de estadoDescripción
200

OK

403

Forbidden

Ejemplos de código para "Update an enterprise team"

Ejemplo de solicitud

patch/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG \ -d '{"name":"Justice League","description":"A great team.","group_id":"62ab9291-fae2-468e-974b-7e45096d5021"}'

Response

Status: 200
{ "id": 1, "name": "Justice League", "description": "A great team.", "slug": "justice-league", "url": "https://api.github.com/enterprises/dc/teams/justice-league", "group_id": "62ab9291-fae2-468e-974b-7e45096d5021", "html_url": "https://github.com/enterprises/dc/teams/justice-league", "members_url": "https://api.github.com/enterprises/dc/teams/justice-league/members{/member}", "created_at": "2019-01-26T19:01:12Z", "updated_at": "2019-01-26T19:14:43Z" }

Delete an enterprise team

To delete an enterprise team, the authenticated user must be an enterprise owner.

If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well.

Tokens de acceso granulares para "Delete an enterprise team"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise teams" enterprise permissions (write)

Parámetros para "Delete an enterprise team"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

team_slug string Obligatorio

The slug of the team name.

Códigos de estado de respuesta HTTP para "Delete an enterprise team"

código de estadoDescripción
204

No Content

403

Forbidden

Ejemplos de código para "Delete an enterprise team"

Ejemplo de solicitud

delete/enterprises/{enterprise}/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/teams/TEAM_SLUG

Response

Status: 204