Sample - GitHub REST API
GET/orgs/{org}/organization-roles/{role_id}/teams

List teams that are assigned to an organization role

Lists the teams that are assigned to an organization role. For more information on organization roles, see "Using organization roles."

To use this endpoint, you must be an administrator for the organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
orgstringrequired
The organization name. The name is not case sensitive.
role_idintegerrequired
The unique identifier of the role.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:30
pageintegeroptional
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:1

3 status codes
200Response - List of assigned teams
assignmentstringoptional
Determines if the team has a direct, indirect, or mixed relationship to a role
Allowed:directindirectmixed
idintegerrequired
node_idstringrequired
namestringrequired
slugstringrequired
descriptionstringrequired
privacystringoptional
notification_settingstringoptional
permissionstringrequired
permissionsobjectoptional
urlstringrequired
html_urlstringrequired
members_urlstringrequired
repositories_urlstringrequired
parentobjectrequired
Groups of organization members that gives permissions on specified repositories.
typestringrequired
The ownership type of the team
Allowed:enterpriseorganization
organization_idintegeroptional
Unique identifier of the organization to which this team belongs
enterprise_idintegeroptional
Unique identifier of the enterprise to which this team belongs
404Response if the organization or role does not exist.
422Response if the organization roles feature is not enabled or validation failed.

Error handling

A 404 is returned: Response if the organization or role does not exist. A 422 is returned: Response if the organization roles feature is not enabled or validation failed.