Skip to main content

Get organization membership for a user

In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.

GET/orgs/{org}/memberships/{username}
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
org string
required
username string
required

Responses

application/json Org Membership object

Response

organization Organization Simple object
required

Organization Simple

avatar_url string
required

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

description string
requirednullable

Example: A great organization

events_url string<uri>
required

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

hooks_url string
required

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

id integer
required

Example: 1

issues_url string
required

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

login string
required

Example: github

members_url string
required

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

node_id string
required

Example: MDEyOk9yZ2FuaXphdGlvbjE=

public_members_url string
required

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

repos_url string<uri>
required

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

url string<uri>
required

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

organization_url string<uri>
required

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

permissions object
optional
can_create_repository boolean
required
role string
required

The user's membership type in the organization.

Example: admin

state string
required

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

Example: active

url string<uri>
required

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

user Simple User object
requirednullable

Simple User

avatar_url string<uri>
required

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

email string
optionalnullable
events_url string
required

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

followers_url string<uri>
required

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

following_url string
required

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

gists_url string
required

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

gravatar_id string
requirednullable

Example: 41d064eb2195891e12d0413f63227ea7

html_url string<uri>
required

Example: https://github.com/octocat

id integer
required

Example: 1

login string
required

Example: octocat

name string
optionalnullable
node_id string
required

Example: MDQ6VXNlcjE=

organizations_url string<uri>
required

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

received_events_url string<uri>
required

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

repos_url string<uri>
required

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

site_admin boolean
required
starred_at string
optional

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

starred_url string
required

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

subscriptions_url string<uri>
required

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

type string
required

Example: User

url string<uri>
required

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

application/json Basic Error object

Forbidden

documentation_url string
optional
message string
optional
status string
optional
url string
optional
application/json Basic Error object

Resource not found

documentation_url string
optional
message string
optional
status string
optional
url string
optional