跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 21.11.0, which is no longer the latest release. See the latest release.

Create a user

POST
/admin/users
curl --request POST \
--url https://gitea.example.com/api/v1/admin/users \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "created_at": "2026-04-15T12:00:00Z", "email": "hello@example.com", "full_name": "example", "login_name": "example", "must_change_password": true, "password": "example", "restricted": true, "send_notify": true, "source_id": 1, "username": "example", "visibility": "example" }'
Media typeapplication/json

CreateUserOption create user options

object
created_at

For explicitly setting the user creation timestamp. Useful when users are migrated from other systems. When omitted, the user’s creation timestamp will be set to “now”.

string format: date-time
email
required
string format: email
full_name
string
login_name
string
must_change_password
boolean
password
string
restricted
boolean
send_notify
boolean
source_id
integer format: int64
username
required
string
visibility
string
Examplegenerated
{
"created_at": "2026-04-15T12:00:00Z",
"email": "hello@example.com",
"full_name": "example",
"login_name": "example",
"must_change_password": true,
"password": "example",
"restricted": true,
"send_notify": true,
"source_id": 1,
"username": "example",
"visibility": "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
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
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