Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning centerThe endpoint Create User is used to create a new Leapwork user (with no team(s)). After the successful creation of a Leapwork user, the Id of the user is returned in the response. The details of the created user can be validated with the help of the 'Get All Users' endpoint.
Please note that for Leapwork Enterprise Edition, this ‘Create User’ endpoint along with ‘Add User To Teams’ endpoint is used to a create user with different teams.
You can refer to this user management settings article:
https://www.leapwork.com/product/documentation/administration/user-management
(PUT) http://{controllerMachine}:{controllerPort}/api/v4/user/new
Field |
Type |
Description |
Comment |
accessKey |
string |
An access key is required to restrict unauthorized access to the API. |
Access Key should include user scope to access user related APIs. |
requestBody |
application/json |
Unique identifiers for the Leapwork User comprising the following parameters: |
|
|
|
FullName |
|
|
|
UserName |
UserName should be unique |
|
|
Password |
Password should meet password complexity security policy |
|
|
ForceChangePasswordOnFirstLogin |
Possible values: true| false |
|
|
Access |
Possible values: Reader, NoAccess, Contributor, Administrator |
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'accessKey: UsctfG8Mg1LVa29L' -d '{ \
"FullName": "Test User", \
"UserName": "User01", \
"Password": "Test%40123", \
"ForceChangePasswordOnFirstLogin": true, \
"Access": "reader" \
}' 'http://localhost:9001/api/v4/user/new'
$headers = @{}
$headers.Add("accessKey","UsctfG8Mg1LVa29L")
$requestBody = @'
{
"FullName": "Test User",
"UserName": "User01",
"Password": "Test%40123",
"ForceChangePasswordOnFirstLogin": true,
"Access": "reader"
}
'@
Invoke-WebRequest -Uri "http://localhost:9001/api/v4/user/new" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody
Create a new user by returning UserId in the response.
{
"$id": "1",
"UserId": "3940e00a-164c-4693-be0b-14ff4746c4a6",
"OperationCompleted": true
}
Field |
Type |
Description |
Values |
$id |
string |
ID of internal object |
|
UserId |
string |
Unique Id of user created |
|
OperationCompleted |
bool |
Returns ‘true’ if the user is created successfully |
true | false |
©2024, Leapwork. All rights reserved.