Sincronização de equipes
A API de sincronização de equipe permite que você gerencie as conexões entre as equipes de GitHub e os grupos de provedor de identidade externo (IdP).
Sobre a API de sincronização da equipe
Para usar esta API, o usuário autenticado deve ser um mantenedor de equipe ou um proprietário da organização associada à equipe. O token que você usa para efetuar a autenticação também deverá ser autorizado para uso com o provedor de IdP (SSO). Para obter mais informações, consulte "Autorizando um token de acesso pessoal para uso com uma organização de logon único SAML".
Você pode gerenciar os integrantes da equipe do GitHub através do seu IdP com a sincronização de equipe. A sincronização de equipe deve estar habilitada para usar a API de sincronização de equipe. Para obter mais informações, consulte "Sincronizar equipes entre seu provedor de identidade e o GitHub".
Observação: A API de sincronização de equipe não pode ser usada com Enterprise Managed Users. Para saber mais sobre como gerenciar um organization with managed users, consulte "API de grupos externos".
List IdP groups for an organization
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 available in an organization. You can limit your page results using the per_page parameter. GitHub generates a url-encoded page token using a cursor value for where the next page begins. For more information on cursor pagination, see "Offset and Cursor Pagination explained."
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
orgstringObrigatórioThe organization name. The name is not case sensitive. |
| Parâmetros de consulta |
| Nome, Tipo, Descrição |
per_pageintegerThe number of results per page (max 100). Padrão: |
pagestringPage token |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/team-sync/groupsResponse
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
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.
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
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
orgstringObrigatórioThe organization name. The name is not case sensitive. |
team_slugstringObrigatórioThe slug of the team name. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/team-sync/group-mappingsResponse
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
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.
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
| Headers | |||||||
|---|---|---|---|---|---|---|---|
| Nome, Tipo, Descrição | |||||||
acceptstringSetting to | |||||||
| Path parameters | |||||||
| Nome, Tipo, Descrição | |||||||
orgstringObrigatórioThe organization name. The name is not case sensitive. | |||||||
team_slugstringObrigatórioThe slug of the team name. | |||||||
| Body parameters | |||||||
| Nome, Tipo, Descrição | |||||||
groupsarray of objectsThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of the | |||||||
| Nome, Tipo, Descrição |
|---|
group_idstringObrigatórioID of the IdP group. |
group_namestringObrigatórioName of the IdP group. |
group_descriptionstringObrigatórioDescription of the IdP group. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
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)
Deprecation Notice: This endpoint route is deprecated 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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
team_idintegerObrigatórioThe unique identifier of the team. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Amostras de código
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/teams/TEAM_ID/team-sync/group-mappingsResponse
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)
Deprecation Notice: This endpoint route is deprecated 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
| Headers | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Nome, Tipo, Descrição | ||||||||||
acceptstringSetting to | ||||||||||
| Path parameters | ||||||||||
| Nome, Tipo, Descrição | ||||||||||
team_idintegerObrigatórioThe unique identifier of the team. | ||||||||||
| Body parameters | ||||||||||
| Nome, Tipo, Descrição | ||||||||||
groupsarray of objectsObrigatórioThe IdP groups you want to connect to a GitHub team. When updating, the new | ||||||||||
Properties of the | ||||||||||
| Nome, Tipo, Descrição |
|---|
group_idstringObrigatórioID of the IdP group. |
group_namestringObrigatórioName of the IdP group. |
group_descriptionstringObrigatórioDescription of the IdP group. |
idstring |
namestring |
descriptionstring |
synced_atstringHTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed |
Amostras de código
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
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."
}
]
}