GitHub v3 REST API

List public organization members

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

get
{protocol}://{hostname}/api/v3/orgs/{org}/public_members

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired

Response

200 application/json

Response

Simple User

namestring | null
emailstring | null
loginstringrequired

Example:octocat

idintegerrequired

Example:1

node_idstringrequired

Example:MDQ6VXNlcjE=

avatar_urlstring(uri)required

Example:https://github.com/images/error/octocat_happy.gif

gravatar_idstring | nullrequired

Example:41d064eb2195891e12d0413f63227ea7

urlstring(uri)required

Example:https://api.github.com/users/octocat

html_urlstring(uri)required

Example:https://github.com/octocat

followers_urlstring(uri)required

Example:https://api.github.com/users/octocat/followers

following_urlstringrequired

Example:https://api.github.com/users/octocat/following{/other_user}

gists_urlstringrequired

Example:https://api.github.com/users/octocat/gists{/gist_id}

starred_urlstringrequired

Example:https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_urlstring(uri)required

Example:https://api.github.com/users/octocat/subscriptions

organizations_urlstring(uri)required

Example:https://api.github.com/users/octocat/orgs

repos_urlstring(uri)required

Example:https://api.github.com/users/octocat/repos

events_urlstringrequired

Example:https://api.github.com/users/octocat/events{/privacy}

received_events_urlstring(uri)required

Example:https://api.github.com/users/octocat/received_events

typestringrequired

Example:User

site_adminbooleanrequired
starred_atstring

Example:"2020-07-09T00:17:55Z"

get/orgs/{org}/public_members
 
200 application/json

Check public organization membership for a user

get
{protocol}://{hostname}/api/v3/orgs/{org}/public_members/{username}

Path Parameters

orgstringrequired
usernamestringrequired

Response

Response if user is a public member

get/orgs/{org}/public_members/{username}
 

Set public organization membership for the authenticated user

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

Note that you’ll need to set Content-Length to zero when calling out to this endpoint. For more information, see “HTTP verbs.”

put
{protocol}://{hostname}/api/v3/orgs/{org}/public_members/{username}

Path Parameters

orgstringrequired
usernamestringrequired

Response

Response

put/orgs/{org}/public_members/{username}
 

Remove public organization membership for the authenticated user

delete
{protocol}://{hostname}/api/v3/orgs/{org}/public_members/{username}

Path Parameters

orgstringrequired
usernamestringrequired

Response

204

Response

delete/orgs/{org}/public_members/{username}
 
204

List organization memberships for the authenticated user

get
{protocol}://{hostname}/api/v3/user/memberships/orgs

Query Parameters

statestring

Indicates the state of the memberships to return. Can be either active or pending. If not specified, the API returns both active and pending memberships.

Allowed values:activepending

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Org Membership

urlstring(uri)required

Example:https://api.github.com/orgs/octocat/memberships/defunkt

statestringrequired

The state of the member in the organization. The pending state indicates the user has not yet accepted an invitation.

Allowed values:activepending

Example:active

rolestringrequired

The user’s membership type in the organization.

Allowed values:adminmemberbilling_manager

Example:admin

organization_urlstring(uri)required

Example:https://api.github.com/orgs/octocat

organizationobjectrequired

Organization Simple

Show Child Parameters
userobject | nullrequired

Simple User

Show Child Parameters
permissionsobject
Show Child Parameters
get/user/memberships/orgs
 
application/json