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 abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.
POST /orgs/:org/invitations
| Name | Type | Description |
|---|---|---|
invitee_id |
integer |
Required unless you provide email. GitHub user ID for the person you are inviting. |
email |
string |
Required unless you provide invitee_id. Email address of the person you are inviting, which can be an existing GitHub user. |
role |
string |
Specify role for new member. Can be one of: * admin - Organization owners with full administrative rights to the organization and complete access to all repositories and teams.* direct_member - Non-owner organization members with ability to see other members and join teams by invitation.* billing_manager - Non-owner organization members with ability to manage the billing settings of your organization. Default: direct_member. |
team_ids |
array |
Specify IDs for the teams you want to invite new members to. |
{
"email": "octocat@github.com",
"role": "direct_member",
"team_ids": [
12,
26
]
}
Status: 201 Created
{
"id": 1,
"login": "monalisa",
"email": "octocat@github.com",
"role": "direct_member",
"created_at": "2016-11-30T06:46:10-08:00",
"inviter": {
"login": "other_user",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/other_user_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/other_user",
"html_url": "https://github.com/other_user",
"followers_url": "https://api.github.com/users/other_user/followers",
"following_url": "https://api.github.com/users/other_user/following{/other_user}",
"gists_url": "https://api.github.com/users/other_user/gists{/gist_id}",
"starred_url": "https://api.github.com/users/other_user/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/other_user/subscriptions",
"organizations_url": "https://api.github.com/users/other_user/orgs",
"repos_url": "https://api.github.com/users/other_user/repos",
"events_url": "https://api.github.com/users/other_user/events{/privacy}",
"received_events_url": "https://api.github.com/users/other_user/received_events",
"type": "User",
"site_admin": false
},
"team_count": 2,
"invitation_team_url": "https://api.github.com/organizations/2/invitations/1/teams"
}