Skip to content

Create a user

POST
/api/v4/users

Creates a user. Administrators only.

Media type multipart/form-data
object
email
required

The email of the user

string
nullable
password

The password of the new user

string
nullable
reset_password

Flag indicating the user will be sent a password reset token

boolean
nullable
skip_confirmation

Flag indicating the account is confirmed

boolean
nullable
force_random_password

Flag indicating a random password will be set

boolean
nullable
name
required

The name of the user

string
nullable
username
required

The username of the user

string
nullable
linkedin

The LinkedIn username

string
nullable
twitter

The Twitter username

string
nullable
discord

The Discord user ID

string
nullable
website_url

The website of the user

string
nullable
github

The GitHub username

string
nullable
organization

The organization of the user. Empty string or nil clears the field.

string
nullable
projects_limit

The number of projects a user can create

integer
nullable
extern_uid

The external authentication provider UID

string
nullable
provider

The external provider

string
nullable
bio

The biography of the user

string
nullable
location

The location of the user

string
nullable
pronouns

The pronouns of the user

string
nullable
public_email

The public email of the user

string
nullable
commit_email

The commit email, _private for private commit email

string
nullable
admin

Flag indicating the user is an administrator

boolean
nullable
can_create_group

Flag indicating the user can create groups

boolean
nullable
external

Flag indicating the user is an external user

boolean
nullable
avatar

Avatar image for user

string format: binary
nullable
theme_id

The GitLab theme for the user

integer
nullable
color_scheme_id

The color scheme for the file viewer

integer
nullable
private_profile

Flag indicating the user has a private profile

boolean
nullable
note

Admin note for this user

string
nullable
view_diffs_file_by_file

Flag indicating the user sees only one file diff per page

boolean
nullable
policy_advanced_editor

Flag indicating that advanced editor is enabled

boolean
nullable
shared_runners_minutes_limit

Compute minutes quota for this user

integer
nullable
extra_shared_runners_minutes_limit

(admin-only) Extra compute minutes quota for this user

integer
nullable
group_id_for_saml

ID for group where SAML has been configured

integer
nullable
auditor

Flag indicating auditor status of the user

boolean
nullable

Created

Media type application/json
object
id
integer format: int64
username
string
public_email
string
name
string
state
string
locked
boolean
avatar_url
string
avatar_path
string
custom_attributes
Array<object>
object
key
string
value
string
web_url
string
created_at
string
bio
string
location
string
linkedin
string
twitter
string
discord
string
website_url
string
github
string
job_title
string
pronouns
string
organization
string
bot
boolean
work_information
string
followers
string
following
string
is_followed
string
local_time
string
last_sign_in_at
string format: date-time
confirmed_at
string format: date-time
last_activity_on
string format: date-time
email
string
theme_id
integer
color_scheme_id
integer
projects_limit
integer
current_sign_in_at
string format: date-time
identities
object
provider
string
extern_uid
string
saml_provider_id
string
can_create_group
boolean
can_create_project
boolean
two_factor_enabled
boolean
external
boolean
private_profile
boolean
commit_email
string
preferred_language
string
shared_runners_minutes_limit
string
extra_shared_runners_minutes_limit
string
scim_identities
object
extern_uid
string
group_id
string
active
string
is_admin
string
note
string
namespace_id
string
created_by
object
id
integer format: int64
username
string
public_email
string
name
string
state
string
locked
boolean
avatar_url
string
avatar_path
string
custom_attributes
Array<object>
object
key
string
value
string
web_url
string
using_license_seat
string
is_auditor
string
provisioned_by_group_id
string
enterprise_group_id
string
enterprise_group_associated_at
string
Example
{
"id": 1,
"username": "admin",
"public_email": "john@example.com",
"name": "Administrator",
"state": "active",
"avatar_url": "https://gravatar.com/avatar/1",
"avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
"custom_attributes": [
{
"key": "foo",
"value": "bar"
}
],
"web_url": "https://gitlab.example.com/root",
"last_sign_in_at": "2015-09-03T07:24:01.670Z",
"confirmed_at": "2015-09-03T07:24:01.670Z",
"last_activity_on": "2015-09-03T07:24:01.670Z",
"email": "john@example.com",
"theme_id": 2,
"color_scheme_id": 1,
"projects_limit": 10,
"current_sign_in_at": "2015-09-03T07:24:01.670Z",
"can_create_group": true,
"can_create_project": true,
"two_factor_enabled": true,
"private_profile": false,
"preferred_language": "en",
"created_by": {
"id": 1,
"username": "admin",
"public_email": "john@example.com",
"name": "Administrator",
"state": "active",
"avatar_url": "https://gravatar.com/avatar/1",
"avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
"custom_attributes": [
{
"key": "foo",
"value": "bar"
}
],
"web_url": "https://gitlab.example.com/root"
}
}

Bad Request