Create a user
const url = 'https://gitea.example.com/api/v1/admin/users';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”CreateUserOption create user options
object
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”.
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"}Responses
Section titled “Responses”User
User represents a user
object
Is user active
URL to the user’s avatar
The user’s description
User counts
The user’s full name
URL to the user’s gitea page
The user’s id
Is the user an administrator
User locale
The user’s location
The user’s username
The user’s authentication sign-in name.
Is user login prohibited
Is user restricted
The ID of the user’s Authentication Source
User visibility level option: public, limited, private
The user’s website
Example
{ "login_name": "empty"}APIError is error format response
Headers
Section titled “Headers”APIForbiddenError is a forbidden error response
Headers
Section titled “Headers”APIValidationError is error format response related to input validation