Skip to main content

Grupos externos

A API de grupos externos permite que você visualize os grupos de provedores de identidade externos que estão disponíveis para sua organização e gerencie a conexão entre grupos externos e equipes na sua organização.

Sobre a API de grupos externos

Para usar esta API, o usuário autenticado deve ser um mantenedor de equipe ou um proprietário da organização associada à equipe.

Notas:

  • A API de grupos externos está disponível apenas para organizações que fazem parte de uma empresa que usa Enterprise Managed Users. Para obter mais informações, consulteSobre usuários gerenciados pela empresa".
  • Se sua organização usar a sincronização de equipe, você poderá usar a API de sincronização de equipe. Para obter mais informações, consulte "API de sincronização de equipe".

Get an external group

Works with GitHub Apps

Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

Parâmetros

Headers
Nome, Tipo, Descrição
acceptstring

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

Path parameters
Nome, Tipo, Descrição
orgstringObrigatório

The organization name. The name is not case sensitive.

group_idintegerObrigatório

The unique identifier of the group.

HTTP response status codes

Status codeDescrição
200

OK

Amostras de código

get/orgs/{org}/external-group/{group_id}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/orgs/ORG/external-group/GROUP_ID

Response

Status: 200
{ "group_id": "123", "group_name": "Octocat admins", "updated_at": "2021-01-24T11:31:04-06:00", "teams": [ { "team_id": 1, "team_name": "team-test" }, { "team_id": 2, "team_name": "team-test2" } ], "members": [ { "member_id": 1, "member_login": "mona-lisa_eocsaxrs", "member_name": "Mona Lisa", "member_email": "mona_lisa@github.com" }, { "member_id": 2, "member_login": "octo-lisa_eocsaxrs", "member_name": "Octo Lisa", "member_email": "octo_lisa@github.com" } ] }

List external groups in an organization

Works with GitHub Apps

Lists external groups available in an organization. You can query the groups using the display_name parameter, only groups with a group_name containing the text provided in the display_name parameter will be returned. You can also 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."

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

Parâmetros

Headers
Nome, Tipo, Descrição
acceptstring

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

Path parameters
Nome, Tipo, Descrição
orgstringObrigatório

The organization name. The name is not case sensitive.

Parâmetros de consulta
Nome, Tipo, Descrição
per_pageinteger

The number of results per page (max 100).

Padrão: 30

pageinteger

Page token

display_namestring

Limits the list to groups containing the text in the group name

HTTP response status codes

Status codeDescrição
200

OK

Amostras de código

get/orgs/{org}/external-groups
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/orgs/ORG/external-groups

Response

Status: 200
{ "groups": [ { "group_id": "123", "group_name": "Octocat admins", "updated_at": "2021-01-24T11:31:04-06:00" }, { "group_id": "456", "group_name": "Octocat docs members", "updated_at": "2021-03-24T11:31:04-06:00" } ] }

List a connection between an external group and a team

Works with GitHub Apps

Lists a connection between a team and an external group.

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

Parâmetros

Headers
Nome, Tipo, Descrição
acceptstring

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

Path parameters
Nome, Tipo, Descrição
orgstringObrigatório

The organization name. The name is not case sensitive.

team_slugstringObrigatório

The slug of the team name.

HTTP response status codes

Status codeDescrição
200

OK

Amostras de código

get/orgs/{org}/teams/{team_slug}/external-groups
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups

Response

Status: 200
{ "groups": [ { "group_id": "123", "group_name": "Octocat admins", "updated_at": "2021-01-24T11:31:04-06:00" }, { "group_id": "456", "group_name": "Octocat docs members", "updated_at": "2021-03-24T11:31:04-06:00" } ] }

Update the connection between an external group and a team

Creates a connection between a team and an external group. Only one external group can be linked to a team.

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "GitHub's products" in the GitHub Help documentation.

Parâmetros

Headers
Nome, Tipo, Descrição
acceptstring

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

Path parameters
Nome, Tipo, Descrição
orgstringObrigatório

The organization name. The name is not case sensitive.

team_slugstringObrigatório

The slug of the team name.

Body parameters
Nome, Tipo, Descrição
group_idintegerObrigatório

External Group Id

HTTP response status codes

Status codeDescrição
200

OK

Amostras de código

patch/orgs/{org}/teams/{team_slug}/external-groups
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups \ -d '{"group_id":123}'

Response

Status: 200
{ "group_id": "123", "group_name": "Octocat admins", "updated_at": "2021-01-24T11:31:04-06:00", "teams": [ { "team_id": 1, "team_name": "team-test" }, { "team_id": 2, "team_name": "team-test2" } ], "members": [ { "member_id": 1, "member_login": "mona-lisa_eocsaxrs", "member_name": "Mona Lisa", "member_email": "mona_lisa@github.com" }, { "member_id": 2, "member_login": "octo-lisa_eocsaxrs", "member_name": "Octo Lisa", "member_email": "octo_lisa@github.com" } ] }

Remove the connection between an external group and a team

Deletes a connection between a team and an external group.

You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

Parâmetros

Headers
Nome, Tipo, Descrição
acceptstring

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

Path parameters
Nome, Tipo, Descrição
orgstringObrigatório

The organization name. The name is not case sensitive.

team_slugstringObrigatório

The slug of the team name.

HTTP response status codes

Status codeDescrição
204

No Content

Amostras de código

delete/orgs/{org}/teams/{team_slug}/external-groups
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups

Response

Status: 204