Members
- 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
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
[
{
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
]
Response if requester is not an organization member
Status: 302 Found
Location: https://api.centelar.com/orgs/centelar/public_members
Check membership
Check if a user is, publicly or privately, a member of the organization.
GET /orgs/:org/members/:username
Response if requester is an organization member and user is a member
Status: 204 No Content
Response if requester is an organization member and user is not a member
Status: 404 Not Found
Response if requester is not an organization member and is inquiring about themselves
Status: 404 Not Found
Response if requester is not an organization member
Status: 302 Found
Location: https://api.centelar.com/orgs/centelar/public_members/pezra
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/:username
Response
Status: 204 No Content
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
[
{
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
]
Check public membership
GET /orgs/:org/public_members/:username
Response if user is a public member
Status: 204 No Content
Response if user is not a public member
Status: 404 Not Found
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/:username
Response
Status: 204 No Content
Conceal a user’s membership
DELETE /orgs/:org/public_members/:username
Response
Status: 204 No Content