Puntos de conexión de la API de REST para la sincronización de equipos
Usa la API de REST para administrar las conexiones entre los equipos de GitHub Enterprise Cloud y los grupos del proveedor de identidad (IdP) externo.
Acerca de la sincronización de equipo
Para utilizar estos puntos de conexión, el usuario autenticado debe ser un mantenedor del equipo o un propietario de la organización asociada con este. El token que utilizas para autenticarte también necesitará autorizarse para su uso con tu proveedor IdP (SSO). Para obtener más información, vea «Autorizar un token de acceso personal para usar con un inicio de sesión único de SAML».
Puedes administrar a los miembros del equipo de GitHub Enterprise Cloud a través de tu IdP con la sincronización de equipos. La sincronización de equipos debe estar habilitada para usar estos puntos de conexión. Para obtener más información, vea «Administración de la sincronización de equipos para su organización».
Nota: Estos puntos de conexión no se pueden usar con Enterprise Managed Users. Para más información sobre cómo administrar una instancia de organización con usuarios administrados, consulta "Puntos de conexión de la API de REST para grupos externos".
List IdP groups for an organization
Lists IdP groups available in an organization.
Tokens de acceso específicos para "List IdP groups for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Members" organization permissions (write)
Parámetros para "List IdP groups for an organization"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
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: |
page string Page token |
q string Filters the results to return only those that begin with the value specified by this parameter. For example, a value of |
Códigos de estado de respuesta HTTP para "List IdP groups for an organization"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "List IdP groups for an organization"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/team-sync/groups
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
List IdP groups for a team
List IdP groups connected to a team on GitHub Enterprise Cloud.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
Parámetros para "List IdP groups for a team"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
Códigos de estado de respuesta HTTP para "List IdP groups for a team"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "List IdP groups for a team"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappings
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
Create or update IdP group connections
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Note
You can also specify a team by org_id
and team_id
using the route PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings
.
Parámetros para "Create or update IdP group connections"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
team_slug string RequeridoThe slug of the team name. |
Nombre, Tipo, Descripción | ||||
---|---|---|---|---|
groups array of objects The IdP groups you want to connect to a GitHub team. When updating, the new | ||||
Properties of |
Nombre, Tipo, Descripción |
---|
group_id string RequeridoID of the IdP group. |
group_name string RequeridoName of the IdP group. |
group_description string RequeridoDescription of the IdP group. |
Códigos de estado de respuesta HTTP para "Create or update IdP group connections"
status code | Descripción |
---|---|
200 | OK |
Ejemplos de código para "Create or update IdP group connections"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","group_description":"string"}]}'
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
List IdP groups for a team (Legacy)
Warning
Endpoint 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 IdP groups for a team
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
List IdP groups connected to a team on GitHub Enterprise Cloud.
Parámetros para "List IdP groups for a team (Legacy)"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
team_id integer RequeridoThe unique identifier of the team. |
Códigos de estado de respuesta HTTP para "List IdP groups for a team (Legacy)"
status code | Descripción |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Ejemplos de código para "List IdP groups for a team (Legacy)"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/teams/TEAM_ID/team-sync/group-mappings
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
},
{
"group_id": "456",
"group_name": "Octocat docs members",
"group_description": "The people who make your octoworld come to life."
}
]
}
Create or update IdP group connections (Legacy)
Warning
Endpoint 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 Create or update IdP group connections
endpoint.
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.
Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty groups
array will remove all connections for a team.
Parámetros para "Create or update IdP group connections (Legacy)"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
team_id integer RequeridoThe unique identifier of the team. |
Nombre, Tipo, Descripción | |||||||
---|---|---|---|---|---|---|---|
groups array of objects RequeridoThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
Nombre, Tipo, Descripción |
---|
group_id string RequeridoID of the IdP group. |
group_name string RequeridoName of the IdP group. |
group_description string RequeridoDescription of the IdP group. |
id string |
name string |
description string |
synced_at
string Códigos de estado de respuesta HTTP para "Create or update IdP group connections (Legacy)"
status code | Descripción |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Ejemplos de código para "Create or update IdP group connections (Legacy)"
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/teams/TEAM_ID/team-sync/group-mappings \
-d '{"groups":[{"group_id":"123","group_name":"Octocat admins","description":"The people who configure your octoworld.","group_description":"string"}]}'
Response
Status: 200
{
"groups": [
{
"group_id": "123",
"group_name": "Octocat admins",
"group_description": "The people who configure your octoworld."
}
]
}