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
- Get organization membership
- Add or update organization membership
- Remove organization membership
- List your organization memberships
- Get your organization membership
- Edit your organization 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.
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 organization admins.* all : All members the authenticated user can see.Default: all
|
role |
string |
Filter members returned by their role. If specified, must be set to admin , which will only return users with admin permissions on the org. This parameter requires a custom media type to be specified. Please see more in the alert below.
|
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. This functionality will apply to all API consumers beginning February 24, 2015. Please see the blog post for full details.
To access the API during the migration period, you must provide a custom media type in the Accept
header:
application/vnd.github.moondragon+json
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"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/:username
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/:username
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
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"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/:username
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/:username
Note that you’ll need to set Content-Length
to zero when calling out to this endpoint. For more information, see “HTTP verbs.”
Response
Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
Conceal a user’s membership
DELETE /orgs/:org/public_members/:username
Response
Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
Get organization membership
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. Please see the blog post for full details.
To access this API method during the migration period, you must provide a custom media type in the Accept
header:
application/vnd.github.moondragon+json
In order to get a user’s membership with an organization, the authenticated user must be an organization admin.
GET /orgs/:org/memberships/:username
Response if user has an active admin membership with organization
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"state": "active",
"role": "admin",
"organization_url": "https://api.github.com/orgs/octocat",
"organization": {
"login": "octocat",
"url": "https://api.github.com/orgs/octocat",
"id": 1,
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"members_url": "https://api.github.com/users/octocat/members{/member}",
"public_members_url": "https://api.github/com/users/octocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Response if user has an active membership with organization
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"state": "active",
"role": "limited_member",
"organization_url": "https://api.github.com/orgs/octocat",
"organization": {
"login": "octocat",
"url": "https://api.github.com/orgs/octocat",
"id": 1,
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"members_url": "https://api.github.com/users/octocat/members{/member}",
"public_members_url": "https://api.github/com/users/octocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Response if user has a pending membership with organization
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/invitocat/memberships/defunkt",
"state": "pending",
"role": "limited_member",
"organization_url": "https://api.github.com/orgs/invitocat",
"organization": {
"login": "invitocat",
"url": "https://api.github.com/orgs/invitocat",
"id": 2,
"repos_url": "https://api.github.com/users/invitocat/repos",
"events_url": "https://api.github.com/users/invitocat/events{/privacy}",
"members_url": "https://api.github.com/users/invitocat/members{/member}",
"public_members_url": "https://api.github/com/users/invitocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Add or update organization membership
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. Please see the blog post for full details.
To access this API method during the migration period, you must provide a custom media type in the Accept
header:
application/vnd.github.moondragon+json
In order to create or update a user’s membership with an organization, the authenticated user must be an organization admin.
PUT /orgs/:org/memberships/:username
Parameters
Name | Type | Description |
---|---|---|
role |
string |
Required. The role to give the user in the organization. Can be one of: * admin - The user will become an administrator of the organization.* member - The user will become a non-admin member of the organization. Use this only to demote an existing admin to a non-admin. |
Response if user was previously unaffiliated with organization
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/invitocat/memberships/defunkt",
"state": "pending",
"role": "admin",
"organization_url": "https://api.github.com/orgs/invitocat",
"organization": {
"login": "invitocat",
"url": "https://api.github.com/orgs/invitocat",
"id": 2,
"repos_url": "https://api.github.com/users/invitocat/repos",
"events_url": "https://api.github.com/users/invitocat/events{/privacy}",
"members_url": "https://api.github.com/users/invitocat/members{/member}",
"public_members_url": "https://api.github/com/users/invitocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Response if user already had membership with organization
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"state": "active",
"role": "admin",
"organization_url": "https://api.github.com/orgs/octocat",
"organization": {
"login": "octocat",
"url": "https://api.github.com/orgs/octocat",
"id": 1,
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"members_url": "https://api.github.com/users/octocat/members{/member}",
"public_members_url": "https://api.github/com/users/octocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Remove organization membership
We're currently offering a migration period allowing applications to opt in to the Organization Permissions API. Please see the blog post for full details.
To access this API method during the migration period, you must provide a custom media type in the Accept
header:
application/vnd.github.moondragon+json
In order to remove a user’s membership with an organization, the authenticated user must be an organization admin.
DELETE /orgs/:org/memberships/:username
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation.
Response
Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
List your organization memberships
GET /user/memberships/orgs
Input
Name | Type | Description |
---|---|---|
state |
string |
Indicates the state of the memberships to return. Can be either active or pending . If not specified, both active and pending memberships are returned. |
Response
Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
<https://api.github.com/resource?page=5>; rel="last"
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"state": "active",
"role": "admin",
"organization_url": "https://api.github.com/orgs/octocat",
"organization": {
"login": "octocat",
"url": "https://api.github.com/orgs/octocat",
"id": 1,
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"members_url": "https://api.github.com/users/octocat/members{/member}",
"public_members_url": "https://api.github/com/users/octocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
},
{
"url": "https://api.github.com/orgs/invitocat/memberships/defunkt",
"state": "pending",
"role": "admin",
"organization_url": "https://api.github.com/orgs/invitocat",
"organization": {
"login": "invitocat",
"url": "https://api.github.com/orgs/invitocat",
"id": 2,
"repos_url": "https://api.github.com/users/invitocat/repos",
"events_url": "https://api.github.com/users/invitocat/events{/privacy}",
"members_url": "https://api.github.com/users/invitocat/members{/member}",
"public_members_url": "https://api.github/com/users/invitocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
]
Get your organization membership
GET /user/memberships/orgs/:org
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/invitocat/memberships/defunkt",
"state": "pending",
"role": "admin",
"organization_url": "https://api.github.com/orgs/invitocat",
"organization": {
"login": "invitocat",
"url": "https://api.github.com/orgs/invitocat",
"id": 2,
"repos_url": "https://api.github.com/users/invitocat/repos",
"events_url": "https://api.github.com/users/invitocat/events{/privacy}",
"members_url": "https://api.github.com/users/invitocat/members{/member}",
"public_members_url": "https://api.github/com/users/invitocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}
Edit your organization membership
PATCH /user/memberships/orgs/:org
Input
Name | Type | Description |
---|---|---|
state |
string |
Required. The state that the membership should be in. Only "active" will be accepted. |
Example
{
"state": "active"
}
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/orgs/octocat/memberships/defunkt",
"state": "active",
"role": "admin",
"organization_url": "https://api.github.com/orgs/octocat",
"organization": {
"login": "octocat",
"url": "https://api.github.com/orgs/octocat",
"id": 1,
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"members_url": "https://api.github.com/users/octocat/members{/member}",
"public_members_url": "https://api.github/com/users/octocat/public_members{/member}",
"avatar_url": "https://secure.gravatar.com/avatar/7ad39074b0584bc555d0417ae3e7d974?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"
},
"user": {
"login": "defunkt",
"id": 3,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/defunkt",
"html_url": "https://github.com/defunkt",
"followers_url": "https://api.github.com/users/defunkt/followers",
"following_url": "https://api.github.com/users/defunkt/following{/other_user}",
"gists_url": "https://api.github.com/users/defunkt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/defunkt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defunkt/subscriptions",
"organizations_url": "https://api.github.com/users/defunkt/orgs",
"repos_url": "https://api.github.com/users/defunkt/repos",
"events_url": "https://api.github.com/users/defunkt/events{/privacy}",
"received_events_url": "https://api.github.com/users/defunkt/received_events",
"type": "User",
"site_admin": false
}
}