GitHub v3 REST API

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

List organizations for the authenticated user

List organizations for the authenticated user.

OAuth scope requirements

This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope. OAuth requests with insufficient scope receive a 403 Forbidden response.

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

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Organization Simple

loginstringrequired

Example:github

idintegerrequired

Example:1

node_idstringrequired

Example:MDEyOk9yZ2FuaXphdGlvbjE=

urlstring(uri)required

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

repos_urlstring(uri)required

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

events_urlstring(uri)required

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

hooks_urlstringrequired

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

issues_urlstringrequired

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

members_urlstringrequired

Example:https://api.github.com/orgs/github/members{/member}

public_members_urlstringrequired

Example:https://api.github.com/orgs/github/public_members{/member}

avatar_urlstringrequired

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

descriptionstring | nullrequired

Example:A great organization

get/user/orgs
 
application/json