Org Members API
- Members list
- Check membership
- Add a member
- Remove a member
- Public members list
- Check public membership
- Publicize a user’s membership
- Conceal a user’s membership
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
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"
}
]
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"
}
]
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
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