Create user
Create a new user.
| Method | POST
|
| URL | /v1/user/{siteId}
|
The User model describes all properties required in a request payload to create a user.
-
The new user must belong to at least 1 site, 1 agent group, 1 business unit, and 1 role.
-
The new user can belong to a maximum combination of 20 agent groups and 10 business units.
Request parameters
All parameters are required.
|
Parameter |
Type |
Description |
|---|---|---|
|
|
UserWithChangeReason |
Body containing change reason and new-user data. |
|
|
integer |
Site ID. Unique identifier assigned during client-account creation in Nuance Portal. |
UserWithChangeReason model
|
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
user |
yes |
Writable properties described in the User model. |
|
|
string |
yes |
Reason for creating a new user. Maximum length is 512 characters. |
Response codes
|
Status |
Description |
|---|---|
|
201 |
Request succeeded. The |
|
400 |
Bad request. The server cannot process the request due to a client error. |
|
422 |
The request was well-formed, but there were validation errors, so it could not be followed. |
For a full list of supported response codes for UMAPI, see Response codes.
Samples
Note: Authentication is required to try out samples. For details, see API token authentication.
url /v1/user/123
body { "changedRecord": {"password": "1Zz123fZ$a@!",
"defaultSiteId": 123,
"username": "createuser",
"firstname": "create",
"lastname": "user",
"skillIds": [
1234,
1235,
1236
],
"siteIds": [
123
],
"agentGroupIds": [
10004321
],
"businessUnitIds": [
87654321
],
"roleIds": [
17,
19
]
},
"reason": "create new user",
"siteId": 123
}
Status code is 201. Response includes “location” header which contains the location information of the newly created user.
| Header | location |
| Content | https://portal.touchcommerce.com/portal/configuration/api/v1/user/123/12345678 |
Where:
-
123is thesiteId. -
12345678is theuserIdof the new user.
{"error": "A validation error occurred",
"code": 422,
"details": [
{"message": "Required",
"wrongValues": [
"123"
]
},
{"message": "You must define at least one Business Unit per Site"
}
]
}