Is there an API to remove a user from the Enterprise?

Hi,
I was looking through the API documentation, and I do see there are APIs to remove a user from an organization. But is there a way we can remove a user from the enterprise altogether? The API call should remove the user from all of the organizations within the enterprise he previously had access to, and also from the enterprise.

At the moment, I am able to remove the user from all organizations, but the user still is a part of the enterprise. When querying using GraphQL’s query enterprise>ownerInfo>samlIdentityProvider>externalIdentities, I still find the user listed in the response. Can the user be removed from the enterprise such that this query does not list the user anymore?

Hi Sushant,

Apologies for the delay in replying! Normally when a user is removed from all organization, the user will automatically be removed from the enterprise account too. If this is not the case, we’ll have to look into it further.

Since you’re an GitHub Enterprise customer, you’re eligible for our technical support from the Enterprise Support team. Would you mind opening a new support ticket via GitHub Enterprise Support Portal, including this thread’s URL: Is there an API to remove a user from the Enterprise? ?

Thanks,
Sho

1 Like

Hi Sushant,

Since you’ve mentioned enterprise>ownerInfo>samlIdentityProvider>externalIdentities, it’s likely that the user’s Linked SSO identity still exists in the organization’s SAML configuration. Please confirm that by browsing https://github.com/orgs/[organization]/people/[username]/sso. If you’d like to remove it, click the Revoke button. Please also refer to Viewing and managing a user’s SAML access to your enterprise - GitHub Docs for more information.

Thanks,
Sho

1 Like