Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade de API REST para grupos externos

Use a API REST a fim de exibir os grupos de provedores de identidade externos disponíveis para sua organização e a fim de gerenciar a conexão entre os grupos externos e suas equipes.

Sobre os grupos externos

Para usar esses pontos de extremidade, o usuário autenticado deve ser responsável pela manutenção da equipe ou proprietário da organização associada a ela.

Observações:

Get an external group

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.

Tokens de acesso refinados para "Get an external group"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "Get an external group"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

group_id integer Obrigatório

The unique identifier of the group.

Códigos de status de resposta HTTP para "Get an external group"

Código de statusDescrição
200

OK

Exemplos de código para "Get an external group"

Exemplo de solicitação

get/orgs/{org}/external-group/{group_id}
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/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

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 Enterprise Cloud 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.

Tokens de acesso refinados para "List external groups in an organization"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "List external groups in an organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

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

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Padrão: 30

page integer

Page token

display_name string

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

Códigos de status de resposta HTTP para "List external groups in an organization"

Código de statusDescrição
200

OK

Exemplos de código para "List external groups in an organization"

Exemplo de solicitação

get/orgs/{org}/external-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/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

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.

Tokens de acesso refinados para "List a connection between an external group and a team"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "List a connection between an external group and a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "List a connection between an external group and a team"

Código de statusDescrição
200

OK

Exemplos de código para "List a connection between an external group and a team"

Exemplo de solicitação

get/orgs/{org}/teams/{team_slug}/external-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/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.

Tokens de acesso refinados para "Update the connection between an external group and a team"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "Update the connection between an external group and a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Parâmetros do corpo
Nome, Tipo, Descrição
group_id integer Obrigatório

External Group Id

Códigos de status de resposta HTTP para "Update the connection between an external group and a team"

Código de statusDescrição
200

OK

Exemplos de código para "Update the connection between an external group and a team"

Exemplo de solicitação

patch/orgs/{org}/teams/{team_slug}/external-groups
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/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.

Tokens de acesso refinados para "Remove the connection between an external group and a team"

Esse ponto de extremidade funciona com os seguintes tipos de token:

O token deve ter os seguintes conjuntos de permissões:

  • members:write

Parâmetros para "Remove the connection between an external group and a team"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

team_slug string Obrigatório

The slug of the team name.

Códigos de status de resposta HTTP para "Remove the connection between an external group and a team"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove the connection between an external group and a team"

Exemplo de solicitação

delete/orgs/{org}/teams/{team_slug}/external-groups
curl -L \ -X DELETE \ -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/external-groups

Response

Status: 204