v56

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

List users that are assigned to an organization role

Lists organization members 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}/users

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 users

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

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

namestring nullable
emailstring nullable
loginstring required
idinteger required
node_idstring required
avatar_urlstring uri required
gravatar_idstring nullable required
urlstring uri required
html_urlstring uri required
followers_urlstring uri required
following_urlstring required
gists_urlstring required
starred_urlstring required
subscriptions_urlstring uri required
organizations_urlstring uri required
repos_urlstring uri required
events_urlstring required
received_events_urlstring uri required
typestring required
site_adminboolean required
starred_atstring
user_view_typestring

Example response

[
  {
    "assignment": "direct",
    "inherited_from": [
      {
        "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
      }
    ],
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  }
]