# List organization memberships for the authenticated user

From **GitHub v3 REST API**.

`GET /user/memberships/orgs`

List organization memberships for the authenticated user

## Parameters

### `state`

- Location: query
- Required: false
- Type: `string`
- Allowed values: `"active"`, `"pending"`

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.

### `per_page`

- Location: query
- Required: false
- Type: `integer`
- Default: `30`

Results per page (max 100)

### `page`

- Location: query
- Required: false
- Type: `integer`
- Default: `1`

Page number of the results to fetch.

## Responses

### `200`

Response

#### Headers

##### `Link`

- Type: `string`

- Example: `<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"`

### `application/json`

- Type: `array`

```json
[
  {
    "organization": {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "description": "A great organization",
      "events_url": "https://api.github.com/orgs/github/events",
      "hooks_url": "https://api.github.com/orgs/github/hooks",
      "id": 1,
      "issues_url": "https://api.github.com/orgs/github/issues",
      "login": "github",
      "members_url": "https://api.github.com/orgs/github/members{/member}",
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
      "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
      "repos_url": "https://api.github.com/orgs/github/repos",
      "url": "https://api.github.com/orgs/github"
    },
    "organization_url": "https://api.github.com/orgs/octocat",
    "role": "admin",
    "state": "active",
    "url": "https://api.github.com/orgs/octocat/memberships/defunkt",
    "user": {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "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}",
      "gravatar_id": "",
      "html_url": "https://github.com/octocat",
      "id": 1,
      "login": "octocat",
      "node_id": "MDQ6VXNlcjE=",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "site_admin": false,
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "type": "User",
      "url": "https://api.github.com/users/octocat"
    }
  },
  {
    "organization": {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "description": "A great organization",
      "events_url": "https://api.github.com/orgs/github/events",
      "hooks_url": "https://api.github.com/orgs/github/hooks",
      "id": 1,
      "issues_url": "https://api.github.com/orgs/github/issues",
      "login": "github",
      "members_url": "https://api.github.com/orgs/github/members{/member}",
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
      "public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
      "repos_url": "https://api.github.com/orgs/github/repos",
      "url": "https://api.github.com/orgs/github"
    },
    "organization_url": "https://api.github.com/orgs/invitocat",
    "role": "admin",
    "state": "pending",
    "url": "https://api.github.com/orgs/invitocat/memberships/defunkt",
    "user": {
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "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}",
      "gravatar_id": "",
      "html_url": "https://github.com/octocat",
      "id": 1,
      "login": "octocat",
      "node_id": "MDQ6VXNlcjE=",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "site_admin": false,
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "type": "User",
      "url": "https://api.github.com/users/octocat"
    }
  }
]
```

```json
{"items":{"$ref":"#/components/schemas/org-membership"},"type":"array"}
```

### `304`

Not modified

### `401`

Requires authentication

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `403`

Forbidden

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

### `422`

Validation failed

### `application/json`

- Type: `object`

Validation Error

```json
{"description":"Validation Error","properties":{"documentation_url":{"type":"string"},"errors":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"},"index":{"type":"integer"},"message":{"type":"string"},"resource":{"type":"string"},"value":{"oneOf":[{"nullable":true,"type":"string"},{"nullable":true,"type":"integer"},{"items":{"type":"string"},"nullable":true,"type":"array"}]}},"required":["code"],"type":"object"},"type":"array"},"message":{"type":"string"}},"required":["message","documentation_url"],"title":"Validation Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/user/memberships/orgs
```
