Organization member email information through API

Hello,

         I am working on a script to pull the user information for my organization. I have the “owner” privileges for my org. If the user has not set a public email in their profile, I cannot get the email information through the API calls (both v3 and v4) . We do not want our org members to have to make their email visible / public ( under Settings > Account ) . Is there a way for me to pull the email addresses for all the org members , without making them visible / public.

Thank you

The email address (or addresses) that a user associates with their account belong to the user account, not to the organization. So no, there is no way to get the email addresses of all members of an organization without those users’ prior authorization.

I hope that helps.

Hi @lee-dohm . Thank you for the information . 

Hi @lee-dohm, I have exactly the same request. We have domain verified to our Org and able to see all the emails thru github GUI.
But we want to use API to get the email of Org members for audit reason.
Is there any way we can get email from API in domain verified org ?

thanks,

1 Like

Some of the responses here are not clear. When you have a verified domain attached to an Organization, the registered email is viewable by the admin of the Org. This has no relation to the users list of emails AFAIK. It is viewable in the People tab attached to the Org if you are an admin. This should be available to the API for auditing purposes in my mind otherwise you have a list like “maddogbob, janelovescats, depechemodelover”, etc… as your Org user list.

Updated the solution: we changed to use GraphQL API and query samlIdentity object to get email info for SAML Authenticated user. That give us the email as unique identifier instead of github handler. And then we can use the info to do other audit or automation.