GitHub v3 REST API

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

Get an organization membership for the authenticated user

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

Path Parameters

orgstringrequired

Response

application/json

Response

Org Membership

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/{org}
 
application/json

Update an organization membership for the authenticated user

patch
{protocol}://{hostname}/api/v3/user/memberships/orgs/{org}

Path Parameters

orgstringrequired

Body

application/json
statestringrequired

The state that the membership should be in. Only "active" will be accepted.

Allowed values:active

Response

application/json

Response

Org Membership

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
patch/user/memberships/orgs/{org}

Body

{ "state": "active" }
 
application/json