v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
orgs

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.

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

Path parameters

orgstring required

The organization name. The name is not case sensitive.

role_idinteger required

The unique identifier of the role.

Query parameters

per_pageinteger

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

pageinteger

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

Response

Response - List of assigned teams

assignment'direct' | 'indirect' | 'mixed'

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

idinteger required
node_idstring required
namestring required
slugstring required
descriptionstring nullable required
privacystring
notification_settingstring
permissionstring required
urlstring uri required
html_urlstring uri required
members_urlstring required
repositories_urlstring uri required
type'enterprise' | 'organization' required

The ownership type of the team

organization_idinteger

Unique identifier of the organization to which this team belongs

enterprise_idinteger

Unique identifier of the enterprise to which this team belongs

Example response

[
  {
    "assignment": "direct",
    "html_url": "https://github.com/orgs/rails/teams/core",
    "parent": {
      "id": 1,
      "node_id": "MDQ6VGVhbTE=",
      "url": "https://api.github.com/organizations/1/team/1",
      "members_url": "https://api.github.com/organizations/1/team/1/members{/member}",
      "name": "Justice League",
      "description": "A great team.",
      "permission": "admin",
      "privacy": "closed",
      "notification_setting": "notifications_enabled",
      "html_url": "https://github.com/orgs/rails/teams/core",
      "repositories_url": "https://api.github.com/organizations/1/team/1/repos",
      "slug": "justice-league",
      "ldap_dn": "uid=example,ou=users,dc=github,dc=com",
      "organization_id": 37,
      "enterprise_id": 42
    },
    "organization_id": 37,
    "enterprise_id": 42
  }
]