{"meta":{"title":"Endpoints de API REST para grupos externos","intro":"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.","product":"API REST","breadcrumbs":[{"href":"/pt/enterprise-cloud@latest/rest","title":"API REST"},{"href":"/pt/enterprise-cloud@latest/rest/teams","title":"Teams"},{"href":"/pt/enterprise-cloud@latest/rest/teams/external-groups","title":"Grupos externos"}],"documentType":"article"},"body":"# Endpoints de API REST para grupos externos\n\nUse 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.\n\n## Sobre os grupos externos\n\nPara usar esses endpoints, o usuário autenticado precisa ser um mantenedor da equipe ou um dono da organização associada à equipe.\n\n> \\[!NOTE]\n>\n> * Esses endpoints só estão disponíveis para organizações que fazem parte de um Enterprise usando Enterprise Managed Users. Para saber mais, confira [Sobre o Enterprise Managed Users](/pt/enterprise-cloud@latest/admin/concepts/identity-and-access-management/enterprise-managed-users).\n> * Se sua organização usar a sincronização de equipe, será possível usar a API para gerenciar essa sincronização. Para saber mais, confira [Pontos de extremidade de API REST para sincronização de equipe](/pt/enterprise-cloud@latest/rest/teams/team-sync).\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Get an external group\n\n```\nGET /orgs/{org}/external-group/{group_id}\n```\n\nDisplays 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.\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`group_id`** (integer) (required)\n  The unique identifier of the group.\n\n* **`per_page`** (integer)\n  The number of results per page for the \"members\" array (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  The page number of the \"members\" array results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/external-group/GROUP_ID\n```\n\n**Response schema (Status: 200):**\n\n* `group_id`: required, integer\n* `group_name`: required, string\n* `updated_at`: string\n* `teams`: required, array of objects:\n  * `team_id`: required, integer\n  * `team_name`: required, string\n* `members`: required, array of objects:\n  * `member_id`: required, integer\n  * `member_login`: required, string\n  * `member_name`: required, string\n  * `member_email`: required, string\n\n## List external groups available to an organization\n\n```\nGET /orgs/{org}/external-groups\n```\n\nLists external groups provisioned on the enterprise that are available to 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.\"\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n* **`page`** (integer)\n  Page token\n\n* **`display_name`** (string)\n  Limits the list to groups containing the text in the group name\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/external-groups\n```\n\n**Response schema (Status: 200):**\n\n* `groups`: array of objects:\n  * `group_id`: required, integer\n  * `group_name`: required, string\n  * `updated_at`: required, string\n\n## List a connection between an external group and a team\n\n```\nGET /orgs/{org}/teams/{team_slug}/external-groups\n```\n\nLists a connection between a team and an external group.\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List external groups available to an organization](#list-external-groups-available-to-an-organization).\n\n## Update the connection between an external group and a team\n\n```\nPATCH /orgs/{org}/teams/{team_slug}/external-groups\n```\n\nCreates a connection between a team and an external group.  Only one external group can be linked to a team.\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n#### Body parameters\n\n* **`group_id`** (integer) (required)\n  External Group Id\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups \\\n  -d '{\n  \"group_id\": 123\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get an external group](#get-an-external-group).\n\n## Remove the connection between an external group and a team\n\n```\nDELETE /orgs/{org}/teams/{team_slug}/external-groups\n```\n\nDeletes a connection between a team and an external group.\nYou 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`team_slug`** (string) (required)\n  The slug of the team name.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **422** - Unprocessable entity if you attempt to modify an enterprise team at the organization level.\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/external-groups\n```\n\n**Response schema (Status: 204):**"}