Skip to main content
PATCH
/
admin
/
users
/
{username}
Edit an existing user
curl --request PATCH \
  --url https://gogs.example.com/api/v1/admin/users/{username} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "source_id": 123,
  "login_name": "<string>",
  "full_name": "<string>",
  "password": "<string>",
  "website": "<string>",
  "location": "<string>",
  "active": true,
  "admin": true,
  "allow_git_hook": true,
  "allow_import_local": true,
  "max_repo_creation": 123
}
'
{
  "id": 123,
  "username": "<string>",
  "login": "<string>",
  "full_name": "<string>",
  "email": "[email protected]",
  "avatar_url": "<string>"
}

Authorizations

Authorization
string
header
required

Personal access token. Use format: token {YOUR_ACCESS_TOKEN}

Path Parameters

username
string
required

Username

Body

application/json
email
string<email>
required
source_id
integer
login_name
string
full_name
string
password
string
website
string
location
string
active
boolean
admin
boolean
allow_git_hook
boolean
allow_import_local
boolean
max_repo_creation
integer

Maximum number of repositories the user can create. -1 means no limit.

Response

Success

id
integer
username
string
login
string

Alias of username for GitHub API compatibility

full_name
string
email
string<email>
avatar_url
string