REST API endpoints for organization members

Use the REST API to manage memberships in your organization.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List failed organization invitations

GET /orgs/{org}/failed_invitations

The return hash contains failed_at and failed_reason fields which represent the time at which the invitation failed and the reason for the failure.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/failed_invitations

Response schema (Status: 200):

Array of Organization Invitation:

List pending organization invitations

GET /orgs/{org}/invitations

The return hash contains a role field which refers to the Organization
Invitation role and will be one of the following values: direct_member, admin,
billing_manager, or hiring_manager. If the invitee is not a GitHub
member, the login field in the return hash will be null.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/invitations

Response schema (Status: 200):

Same response schema as List failed organization invitations.

Create an organization invitation

POST /orgs/{org}/invitations

Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API"
and "Best practices for using the REST API."

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/invitations \
  -d '{
  "email": "octocat@github.com",
  "role": "direct_member",
  "team_ids": [
    12,
    26
  ]
}'

Response schema (Status: 201):

Cancel an organization invitation

DELETE /orgs/{org}/invitations/{invitation_id}

Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
This endpoint triggers notifications.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/invitations/INVITATION_ID

Response schema (Status: 204):

List organization invitation teams

GET /orgs/{org}/invitations/{invitation_id}/teams

List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/invitations/INVITATION_ID/teams

Response schema (Status: 200):

Array of Team:

List organization members

GET /orgs/{org}/members

List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/members

Response schema (Status: 200):

Array of Simple User:

Check organization membership for a user

GET /orgs/{org}/members/{username}

Check if a user is, publicly or privately, a member of the organization.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/members/USERNAME

Response schema (Status: 204):

Remove an organization member

DELETE /orgs/{org}/members/{username}

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
Note

If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/members/USERNAME

Response schema (Status: 204):

Get organization membership for a user

GET /orgs/{org}/memberships/{username}

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/memberships/USERNAME

Response schema (Status: 200):

Set organization membership for a user

PUT /orgs/{org}/memberships/{username}

Only authenticated organization owners can add a member to the organization or update the member's role.

If the authenticated user is adding a member to the organization, the invited user will receive an email inviting them to the organization. The user's membership status will be pending until they accept the invitation.

Authenticated users can update a user's membership by passing the role parameter. If the authenticated user changes a member's role to admin, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to member, no email will be sent.

Rate limits
To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Set an organization membership role for a user

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/memberships/USERNAME \
  -d '{
  "role": "member"
}'

Response schema (Status: 200):

Same response schema as Get organization membership for a user.

Remove organization membership for a user

DELETE /orgs/{org}/memberships/{username}

In order to remove a user's membership with an organization, the authenticated user must be an organization owner.
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
Note

If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/memberships/USERNAME

Response schema (Status: 204):

List public organization members

GET /orgs/{org}/public_members

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

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/public_members

Response schema (Status: 200):

Same response schema as List organization members.

Check public organization membership for a user

GET /orgs/{org}/public_members/{username}

Check if the provided user is a public member of the organization.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/public_members/USERNAME

Response schema (Status: 204):

Set public organization membership for the authenticated user

PUT /orgs/{org}/public_members/{username}

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 method."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/public_members/USERNAME

Response schema (Status: 204):

Remove public organization membership for the authenticated user

DELETE /orgs/{org}/public_members/{username}

Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/public_members/USERNAME

Response schema (Status: 204):

List organization memberships for the authenticated user

GET /user/memberships/orgs

Lists all of the authenticated user's organization memberships.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/memberships/orgs

Response schema (Status: 200):

Array of Org Membership:

Get an organization membership for the authenticated user

GET /user/memberships/orgs/{org}

If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a 404 is returned. This endpoint will return a 403 if the request is made by a GitHub App that is blocked by the organization.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/memberships/orgs/ORG

Response schema (Status: 200):

Same response schema as Get organization membership for a user.

Update an organization membership for the authenticated user

PATCH /user/memberships/orgs/{org}

Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X PATCH \
  https://api.github.com/user/memberships/orgs/ORG \
  -d '{
  "state": "active"
}'

Response schema (Status: 200):

Same response schema as Get organization membership for a user.

Example 2: Status Code 202

Request:

curl -L \
  -X PATCH \
  https://api.github.com/user/memberships/orgs/ORG \
  -d '{
  "state": "active"
}'

Response schema (Status: 202):

Same response schema as Get organization membership for a user.