Administration (Enterprise)

The User Administration API allows you to promote, demote, suspend, and unsuspend users on a GitHub Enterprise appliance. It is only available to authenticated site administrators. Normal users will receive a 403 response if they try to access it.

Prefix all the endpoints for this API with the following URL:

http(s)://hostname/api/v3

Promote an ordinary user to a site administrator

PUT /users/:username/site_admin

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Response

Status: 204 No Content

Demote a site administrator to an ordinary user

DELETE /users/:username/site_admin

You can demote any user account except your own.

Response

Status: 204 No Content

Suspend a user

If your GitHub Enterprise appliance has LDAP Sync with Active Directory LDAP servers, this API is disabled and will return a 403 response. Users managed by an external account cannot be suspended via the API.

PUT /users/:username/suspended

You can suspend any user account except your own.

Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Response

Status: 204 No Content

Unsuspend a user

If your GitHub Enterprise appliance has LDAP Sync with Active Directory LDAP servers, this API is disabled and will return a 403 response. Users managed by an external account cannot be unsuspended via the API.

DELETE /users/:username/suspended

Response

Status: 204 No Content