Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

REST API endpoints for external groups

Use the REST API to view the external identity provider groups that are available to your organization and manage the connection between external groups and teams in your organization.

About external groups

To use these endpoints, the authenticated user must be a team maintainer or an owner of the organization associated with the team.

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.

Fine-grained access tokens for "Get an external group"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Members" organization permissions (write)

Parameters for "Get an external group"

Headers
Name, Type, Description
accept string

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

Path parameters
Name, Type, Description
org string Required

The organization name. The name is not case sensitive.

group_id integer Required

The unique identifier of the group.

Query parameters
Name, Type, Description
per_page integer

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

Default: 30

page integer

The page number of the "members" array results to fetch. For more information, see "Using pagination in the REST API."

Default: 1

HTTP response status codes for "Get an external group"

Status codeDescription
200

OK

Code samples for "Get an external group"

Request example

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" \ http(s)://HOSTNAME/api/v3/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" } ] }