Patch user
Partly update a user record, identified by its user ID, by a specified property value or attribute.
| Method | PATCH
|
| URL | /v1/user/{siteId}/{userId}
|
How this endpoint works
Property value validations
-
If a property’s value is set to:
-
null, then the field's value in the database is deleted
-
null or
[](empty array) for properties that accept arrays -
null or
{}(empty object) for properties that accept objects -
null for everything else
-
-
-
nothing (value is not sent), then the value in the database is not unchanged
-
some value, then the value in the database is replaced for that property (subject to validations)
agentAttributes parameter validations
-
If the
agentAttributesparameter contains a non-existentAgentAttributeId, then the 422 status code is returned. -
If the
agentAttributesparameter contains anAgentAttributeIdthat the site cannot access, then the 422 status code is returned.
Agent attributes, which are the keys within the
agentAttributesparameter, are case sensitive.There is no validation to check if the
AgentAttributeIdsprovided in theAgentAttributeNameproperty's values correspond to each other.
Request parameters
|
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
|
JSONWithChangeReason |
Body containing the change reason and the user properties to update in a JSON format. |
yes |
|
|
integer |
Site ID. Unique identifier assigned during client-account creation in Nuance Portal. |
yes |
|
|
integer |
User ID. |
yes |
JSONWithChangeReason model
|
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
|
JSON |
Most of the writable properties of the User model. The ones that are guaranteed to be supported are specified in "User patch properties," below. |
yes |
|
|
string |
Reason of changes. Maximum length: 512 characters. |
yes |
User patch properties
|
Parameter |
Type |
Description |
Required |
|---|---|---|---|
|
|
string |
User's first name. Maximum length: 50 characters. |
no |
|
|
string |
User's last name. Maximum length: 50 characters. |
no |
|
|
String |
User password, as described in the UserPassword model.
|
no |
|
|
array |
Site IDs (described above) of sites that the user can access. |
no |
|
|
array |
IDs of agent groups to which the user is assigned. |
no |
|
|
array |
IDs of business units to which the user is assigned. |
no |
|
|
array |
Role IDs to which the user is assigned. |
no |
|
|
Contains the following properties:
Note: Forced chats are the total number of chats an agent can have including additional chats above the |
no | |
|
|
JSON object |
Contains the |
no |
Response codes
|
Status |
Description |
|---|---|
|
204 |
Request succeeded, and there is no content to send in the response. |
|
400 |
Bad request. The server cannot process the request due to a client error. |
|
404 |
The server cannot find the requested user. This user may not exist. |
|
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 /portal/configuration/api/v1/user/123/12345678
body { "changedRecord": {"firstname": "UpdatedFirstName",
"lastname": "UpdatedLastName",
"roleIds": [19],
"siteIds": [123],
"businessUnitIds": [87654321],
"organizationId": 0,
"agentGroupIds": [10004321]
},
"reason": "Sample Update operation"
}
Status code is 204. Returns no content in the response.
{
"error": "HTTP 404 Not Found",
"code": 404
}