0

I am attempting to use the following endpoint https://developer.github.com/v3/teams/members/#add-or-update-team-membership in order to add members to a team. I notice that this requires a GitHub username, and gives me an error if I try this request using an email.

If you are going through the GitHub UI, you are able to invite someone to a team using just their email. Is this something that is not exposed in the API? Is there a way around this? Essentially, I want to send the invite directly to their email, and not assume they have a GitHub account already set up.

1 Answers1

0

Yes, GitHub has an endpoint API that will let you invite a user via their email address to the organization and team(s). Please refer to the link below. I've already tried it and it works. In the post request body, you basically specify the user's email address and the org team id that you want them to join. The link below has all the details.

https://developer.github.com/v3/orgs/members/#create-organization-invitation