PATCH
/admin/users/{username}Update a user account
Updates an existing user account identified by username. Supply only the account properties you want to change, such as active, email, password, or administrative permissions; omitted properties remain unchanged. A 200 response returns the updated user object.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
usernamestringrequired
The username identifying the user account to update.
Partial user account update containing the account, profile, authentication, and administrative properties to change.
activebooleanoptional
Whether the user account is active.
adminbooleanoptional
Whether the user has administrator privileges.
allow_create_organizationbooleanoptional
Whether the user may create organizations.
allow_git_hookbooleanoptional
Whether the user may use Git hooks.
allow_import_localbooleanoptional
Whether the user may import local repositories.
descriptionstringoptional
The user's profile description.
emailstringoptional
The user's email address in valid email format.
full_namestringoptional
The user's full name.
hide_emailbooleanoptional
Whether to hide the user's email address from public profile views.
locationstringoptional
The user's location.
login_namestringoptional
The user's login name.
max_repo_creationintegeroptional
The maximum number of repositories the user may create, represented as an integer.
must_change_passwordbooleanoptional
Whether the user must change the password at the next sign-in.
passwordstringoptional
The new password for the user account.
prohibit_loginbooleanoptional
Whether to prohibit the user from signing in.
pronounsstringoptional
restrictedbooleanoptional
source_idintegeroptional
visibilitystringoptional
websitestringoptional
200Returns the updated user object, including account status, profile details, permissions, identifiers, and timestamps.
activebooleanoptional
Is user active
avatar_urlstringoptional
URL to the user's avatar
createdstringoptional
descriptionstringoptional
the user's description
emailstringoptional
followers_countintegeroptional
user counts
following_countintegeroptional
full_namestringoptional
the user's full name
html_urlstringoptional
URL to the user's profile page
idintegeroptional
the user's id
is_adminbooleanoptional
Is the user an administrator
languagestringoptional
User locale
last_loginstringoptional
locationstringoptional
the user's location
loginstringoptional
the user's username
login_namestringoptional
the user's authentication sign-in name.
prohibit_loginbooleanoptional
Is user login prohibited
pronounsstringoptional
the user's pronouns
restrictedbooleanoptional
Is user restricted
source_idintegeroptional
The ID of the user's Authentication Source
starred_repos_countintegeroptional
visibilitystringoptional
User visibility level option: public, limited, private
websitestringoptional
the user's website
400Returned when the request is malformed or cannot be parsed as user update options.
messagestringoptional
urlstringoptional
403Returned when the authenticated user is not permitted to edit user accounts.
messagestringoptional
urlstringoptional
422Returned when a supplied user value fails input validation.
messagestringoptional
urlstringoptional
Error handling
A 400 is returned when the request is malformed, a 403 when the authenticated user is not permitted to edit users, and a 422 when the supplied values fail validation. username must identify the user to update, and email must use a valid email format when provided.