Skip to content

List teams that are assigned to an organization role

GET
/orgs/{org}/organization-roles/{role_id}/teams

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.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

role_id
required
integer

The unique identifier of the role.

per_page
integer
default: 30

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

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

Response - List of assigned teams

Media type application/json

List of teams assigned to the organization role

Array<object>
A Role Assignment for a Team

The Relationship a Team has with a role.

object
assignment

Determines if the team has a direct, indirect, or mixed relationship to a role

string
Allowed values: direct indirect mixed
id
required
integer
node_id
required
string
name
required
string
slug
required
string
description
required
string
nullable
privacy
string
notification_setting
string
permission
required
string
permissions
object
pull
required
boolean
triage
required
boolean
push
required
boolean
maintain
required
boolean
admin
required
boolean
url
required
string format: uri
html_url
required
string format: uri
members_url
required
string
repositories_url
required
string format: uri
parent
required
Team Simple

Groups of organization members that gives permissions on specified repositories.

object
id
required

Unique identifier of the team

integer
node_id
required
string
url
required

URL for the team

string format: uri
members_url
required
string
name
required

Name of the team

string
description
required

Description of the team

string
nullable
permission
required

Permission that the team will have for its repositories

string
privacy

The level of privacy this team should have

string
notification_setting

The notification setting the team has set

string
html_url
required
string format: uri
repositories_url
required
string format: uri
slug
required
string
ldap_dn

Distinguished Name (DN) that team maps to within LDAP environment

string
type
required

The ownership type of the team

string
Allowed values: enterprise organization
organization_id

Unique identifier of the organization to which this team belongs

integer
enterprise_id

Unique identifier of the enterprise to which this team belongs

integer
type
required

The ownership type of the team

string
Allowed values: enterprise organization
organization_id

Unique identifier of the organization to which this team belongs

integer
enterprise_id

Unique identifier of the enterprise to which this team belongs

integer
Examples
Example default
[
{
"id": 1,
"node_id": "MDQ6VGVhbTE=",
"url": "https://api.github.com/teams/1",
"html_url": "https://github.com/orgs/github/teams/justice-league",
"name": "Justice League",
"slug": "justice-league",
"description": "A great team.",
"privacy": "closed",
"notification_setting": "notifications_enabled",
"permission": "admin",
"members_url": "https://api.github.com/teams/1/members{/member}",
"repositories_url": "https://api.github.com/teams/1/repos",
"parent": null
}
]
Link
string
Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"

Response if the organization or role does not exist.

Response if the organization roles feature is not enabled or validation failed.