Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Конечные точки 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

Эта конечная точка работает со следующими типами маркеров:

Маркер должен иметь следующий набор разрешений.:

  • members:write

Параметры для "List IdP groups for an organization"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, 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."

По умолчанию.: 30

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 ab will return results that begin with "ab".

Коды состояния http-ответа для "List IdP groups for an organization"

Код состоянияОписание
200

OK

Примеры кода для "List IdP groups for an organization"

Пример запроса

get/orgs/{org}/team-sync/groups
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 application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, 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"

Пример запроса

get/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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 application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, 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 groups object will replace the original one. You must include any existing groups that you don't want to remove.

Имя., Тип, 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"

Пример запроса

patch/orgs/{org}/teams/{team_slug}/team-sync/group-mappings
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)

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 application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, 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)"

Пример запроса

get/teams/{team_id}/team-sync/group-mappings
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)

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 application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, 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 groups object will replace the original one. You must include any existing groups that you don't want to remove.

Имя., Тип, 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)"

Пример запроса

patch/teams/{team_id}/team-sync/group-mappings
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." } ] }