Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DescriptionCreate a user

URL

/api/users/create

HTTP MethodPOST

Security

Requires Administer System administration permission

Available sinceVersion 3.7

Examples

Use CaseExample Request
Get all the active users of the SonarQube instanceGET

Create a new user:

  • Login: myuser
  • Password: mypassword
  • Name: My Name
  • Email: myname@email.com

curl -X POST -v -u admin:admin 'http://localhost:9000/api/users/search

Response Format

...

titleJSON
languagejavascript

...

create?login=myuser&password=mypassword&password_confirmation=mypassword&name=My%20Name&email=myname@email.com'

Parameters

Parameter

Description

Required

Default Value

Example Value
login

User login.

Yes

None

myuser

password

User password.

YesNonemypassword
password_confirmation

Must be the same value as "password".

YesNonemypassword
nameUser name.NoNoneMy Name
emailUser email.NoNonemyname@email.com

Update a User

DescriptionUpdate a user

URL

/api/users/update

HTTP MethodPOST

Security

Requires Administer System permission

Available sinceVersion 3.7

Examples

Use CaseExample Request

Update user "myuser":

  • New name: My New Name
  • New email: mynewname@email.com

curl -X POST -v -u admin:admin 'http://localhost:9000/api/users/update?login=myuser&name=My%20New%20Name&email=mynewname@email.com'

Parameters

Comma-separated list of user logins

Parameter

Description

Required

Default Value

Example Value
includeDeactivated

Include deactivated users

No

false

true

loginslogin

User login.

Yes

None

myuser

nameUser name.NoNoneMy New Name
emailUser email.NoNoneadmin,sbrandhofformat

Response format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejsonmynewname@email.com

Deactivate a User

DescriptionDeactivate a user

URL

/api/users/deactivate

HTTP MethodPOST

Security

Requires Administer System permission

Available sinceVersion 3.7

Examples

Use CaseExample Request

Deactivate user "myuser"

curl -X POST -v -u admin:admin 'http://localhost:9000/api/users/deactivate?login=myuser'

Parameters

Parameter

Description

Required

Default Value

Example Value
login

User login.

Yes

None

myuser