Members

Members list

List all users who are members of an organization. A member is a user that belongs to at least 1 team in the organization. If the authenticated user is also an owner of this organization then both concealed and public members will be returned. If the requester is not an owner of the organization the query will be redirected to the public members list.

GET /orgs/:org/members

Parameters

Name Type Description
filter string Filter members returned in the list. Can be one of:
* 2fa_disabled: Members without two-factor authentication enabled. Available for owners of organizations with private repositories.
* all: All members the authenticated user can see.

Default: all

Response

Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
  {
    "login": "octocat",
    "id": 1,
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "somehexcode",
    "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",
    "site_admin": false
  }
]

Response if requester is not an organization member

Status: 302 Found
Location: https://api.github.com/orgs/github/public_members
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Check membership

Check if a user is, publicly or privately, a member of the organization.

GET /orgs/:org/members/:user

Response if requester is an organization member and user is a member

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Response if requester is an organization member and user is not a member

Status: 404 Not Found
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Response if requester is not an organization member and is inquiring about themselves

Status: 404 Not Found
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Response if requester is not an organization member

Status: 302 Found
Location: https://api.github.com/orgs/github/public_members/pezra
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Add a member

To add someone as a member to an org, you must add them to a team.

Remove a member

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization’s repositories.

DELETE /orgs/:org/members/:user

Response

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Public members list

Members of an organization can choose to have their membership publicized or not.

GET /orgs/:org/public_members

Response

Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
  {
    "login": "octocat",
    "id": 1,
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "somehexcode",
    "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",
    "site_admin": false
  }
]

Check public membership

GET /orgs/:org/public_members/:user

Response if user is a public member

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Response if user is not a public member

Status: 404 Not Found
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Publicize a user’s membership

The user can publicize their own membership. (A user cannot publicize the membership for another user.)

PUT /orgs/:org/public_members/:user

Response

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999

Conceal a user’s membership

DELETE /orgs/:org/public_members/:user

Response

Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999