Skip to main content

memberships

Overview

Namememberships
TypeResource
Idgithub.orgs.memberships

Fields

NameDatatypeDescription
rolestringThe user's membership type in the organization.
statestringThe state of the member in the organization. The pending state indicates the user has not yet accepted an invitation.
urlstring
userobjectSimple User
organizationobjectOrganization Simple
organization_urlstring
permissionsobject

Methods

NameAccessible byRequired ParamsDescription
get_membership_for_authenticated_userSELECTorg
get_membership_for_userSELECTorg, usernameIn 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.
list_memberships_for_authenticated_userSELECT
remove_membership_for_userDELETEorg, usernameIn 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.
check_membership_for_userEXECorg, usernameCheck if a user is, publicly or privately, a member of the organization.
set_membership_for_userEXECorg, usernameOnly 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, the authenticated user is limited to 50 organization invitations per 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.
update_membership_for_authenticated_userEXECorg, data__state