Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of 1.24.7, which is no longer the latest release. See the latest release.

Edit an existing user

PATCH
/admin/users/{username}
curl --request PATCH \
--url https://gitea.com/api/v1/admin/users/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "active": true, "admin": true, "allow_create_organization": true, "allow_git_hook": true, "allow_import_local": true, "description": "example", "email": "hello@example.com", "full_name": "example", "location": "example", "login_name": "example", "max_repo_creation": 1, "must_change_password": true, "password": "example", "prohibit_login": true, "restricted": true, "source_id": 1, "visibility": "example", "website": "example" }'
username
required
string

Username of user to edit

Media typeapplication/json

EditUserOption edit user options

object
active
boolean
admin
boolean
allow_create_organization
boolean
allow_git_hook
boolean
allow_import_local
boolean
description
string
email
string format: email
full_name
string
location
string
login_name
required
string
max_repo_creation
integer format: int64
must_change_password
boolean
password
string
prohibit_login
boolean
restricted
boolean
source_id
required
integer format: int64
visibility
string
website
string
Examplegenerated
{
"active": true,
"admin": true,
"allow_create_organization": true,
"allow_git_hook": true,
"allow_import_local": true,
"description": "example",
"email": "hello@example.com",
"full_name": "example",
"location": "example",
"login_name": "example",
"max_repo_creation": 1,
"must_change_password": true,
"password": "example",
"prohibit_login": true,
"restricted": true,
"source_id": 1,
"visibility": "example",
"website": "example"
}

User

Media typeapplication/json

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s gitea page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
Example
{
"login_name": "empty"
}

APIError is error format response

Media typeapplication/json
message
string
url
string

APIForbiddenError is a forbidden error response

Media typeapplication/json
message
string
url
string

APIValidationError is error format response related to input validation

Media typeapplication/json
message
string
url
string