Function github_rest::methods::add_to_org
source · pub async fn add_to_org<T>(
client: &T,
org: impl Into<String>,
username: impl Into<String>,
role: Option<Role>
) -> Result<AddToOrgResponse, GithubRestError>where
T: Requester,
Expand description
- tags orgs
- put
/orgs/{org}/memberships/{username}
- docs https://docs.github.com/rest/reference/orgs#set-organization-membership-for-a-user
Set organization membership for a user 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 toadmin
, 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 tomember
, 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.