Конечные точки REST API для синхронизации групп
Используйте REST API для управления подключениями между GitHub Enterprise Cloud команд и группами внешнего поставщика удостоверений (IdP).
Синхронизация команд
Чтобы использовать эти конечные точки, прошедший проверку подлинности пользователь должен быть ответственный за команду или владельцем организации, связанной с командой. Маркер, используемый для проверки подлинности, также должен быть авторизован для использования с поставщиком удостоверений (SSO). Дополнительные сведения см. в разделе Авторизация личного токена доступа для использования с документами единого входа SAML.
Вы можете управлять участниками команды GitHub Enterprise Cloud с помощью поставщика удостоверений с помощью синхронизации команд. Синхронизация команд должна быть включена для использования этих конечных точек. Дополнительные сведения см. в разделе Управление синхронизацией команд в организации.
Примечание. Эти конечные точки нельзя использовать с данными Enterprise Managed Users. Дополнительные сведения об управлении данными организация с управляемыми пользователямисм. в разделе "Конечные точки REST API для внешних групп".
List IdP groups for an organization
Lists IdP groups available in an organization.
Подробные маркеры доступа для "List IdP groups for an organization
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Members" organization permissions (write)
Параметры для "List IdP groups for an organization"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
Имя., Тип, Description |
---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
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 |
Коды состояния http-ответа для "List IdP groups for an organization"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List IdP groups for an organization"
Пример запроса
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
.
Параметры для "List IdP groups for a team"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
team_slug string Обязательное полеThe slug of the team name. |
Коды состояния http-ответа для "List IdP groups for a team"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List IdP groups for a team"
Пример запроса
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
.
Параметры для "Create or update IdP group connections"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
org string Обязательное полеThe organization name. The name is not case sensitive. |
team_slug string Обязательное полеThe slug of the team name. |
Имя., Тип, Description | ||||
---|---|---|---|---|
groups array of objects The IdP groups you want to connect to a GitHub team. When updating, the new | ||||
Properties of |
Имя., Тип, Description |
---|
group_id string Обязательное полеID of the IdP group. |
group_name string Обязательное полеName of the IdP group. |
group_description string Обязательное полеDescription of the IdP group. |
Коды состояния http-ответа для "Create or update IdP group connections"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "Create or update IdP group connections"
Пример запроса
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
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 Enterprise Cloud.
Параметры для "List IdP groups for a team (Legacy)"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
team_id integer Обязательное полеThe unique identifier of the team. |
Коды состояния http-ответа для "List IdP groups for a team (Legacy)"
Код состояния | Описание |
---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
Примеры кода для "List IdP groups for a team (Legacy)"
Пример запроса
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
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.
Параметры для "Create or update IdP group connections (Legacy)"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
team_id integer Обязательное полеThe unique identifier of the team. |
Имя., Тип, Description | |||||||
---|---|---|---|---|---|---|---|
groups array of objects Обязательное полеThe IdP groups you want to connect to a GitHub team. When updating, the new | |||||||
Properties of |
Имя., Тип, Description |
---|
group_id string Обязательное полеID of the IdP group. |
group_name string Обязательное полеName of the IdP group. |
group_description string Обязательное полеDescription of the IdP group. |
id string |
name string |
description string |
synced_at
string Коды состояния http-ответа для "Create or update IdP group connections (Legacy)"
Код состояния | Описание |
---|---|
200 | OK |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Create or update IdP group connections (Legacy)"
Пример запроса
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."
}
]
}