Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы, возможно, еще выполняется. Актуальные сведения см. в документации на английском языке.
REST API теперь имеет версию. Дополнительные сведения см. в разделе Сведения об управлении версиями API.

Синхронизация команд

Используйте REST API для управления подключениями между командами GitHub Enterprise Cloud и группами внешних поставщиков удостоверений (IdP).

Синхронизация команд

Чтобы использовать эти конечные точки, пользователь, прошедший проверку подлинности, должен быть руководителем команды или владельцем организации, связанной с командой. Маркер, используемый для проверки подлинности, также должен быть авторизован для использования с поставщиком удостоверений (SSO). Дополнительные сведения см. в разделе Авторизация личного токена доступа для использования с документами единого входа SAML.

Вы можете управлять участниками команды GitHub Enterprise Cloud через поставщика удостоверений с помощью синхронизации команды. Для использования этих конечных точек необходимо включить синхронизацию команд. Дополнительные сведения см. в разделе Управление синхронизацией команд в организации.

Примечание: Эти конечные точки нельзя использовать с Enterprise Managed Users. Дополнительные сведения об управлении организация с управляемыми пользователями см. в разделе Внешние группы.

List IdP groups for an organization

Работа с GitHub Apps

Lists IdP groups available in an organization.

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

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

Параметры запроса
Имя, Тип, Описание
per_page integer

The number of results per page (max 100).

Значение по умолчанию: 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"

Заголовки
Имя, Тип, Описание
accept string

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

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

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

team_slug string Обязательно

The slug of the team name.

Параметры запроса
Имя, Тип, Описание
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.

Имя, Тип, Описание
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)"

Заголовки
Имя, Тип, Описание
accept string

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

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

Заголовки
Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
team_id integer Обязательно

The unique identifier of the team.

Параметры запроса
Имя, Тип, Описание
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.

Имя, Тип, Описание
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." } ] }