Update user
The endpoint provides functionality for user modification.
HTTP request
PATCH https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId
Parameters
Parameter | In | Type | Required / Optional | Description |
---|---|---|---|---|
instanceId | path | string | required | The ID of your Identity Cloud instance |
userId | path | string | required | The ID of the user |
Request body
Parameter | Type | Required / Optional | Description |
---|---|---|---|
version | integer | optional | The version of the user data, used for optimistic locking |
loginId | string | optional | The email of the user |
languageCode | string | optional | The language of the user |
name.title | string | optional | The title of the user |
name.firstName | string | optional | The first name of the user |
name.lastName | string | optional | The last name of the user |
gender | enum | optional | The gender of the user Values: female , male , other |
birthDate | string | optional | The birth date of the user in ISO 8601 date format YYYYY-MM-DD |
address.countryCode | string | optional | The country code of the user in ISO 3166-1 format |
address.city | string | optional | The city of the user's address |
address.postalCode | string | optional | The postal code of the user |
address.addressline1 | string | optional | First free text for supplementary address information of the user |
address.addressline2 | string | optional | Second free text for supplementary address information of the user |
address.street | string | optional | The street of the user |
address.houseNumber | string | optional | The house number of the user |
address.dwellingNumber | string | optional | The dwelling number of the user |
address.postOfficeBoxText | string | optional | The post office box text of the user |
address.postOfficeBoxNumber | string | optional | The post office box number of the user |
address.locality | string | optional | The locality of the user address |
contacts.telephone | string | optional | The landline telephone number of the user in E.164 format starting with the plus + sign and having no spaces |
contacts.telefax | string | optional | The telefax number of the user in E.164 format starting with the plus + sign and having no spaces |
remarks | string | optional | The short metadata; Additional information field for the user Example Remarks to a food delivery |
modificationComment | string | optional | Additional metadata regarding user modification Note This can be seen in the history. |
properties | map<string,string> | optional | Custom attributes of the user You can only update a value for a custom user attribute that is already added. Otherwise, the request will fail. You can request custom user attributes on the management console. For more information, see Custom user attributes. |
Example
Setting up or modifying a user's address
{
"address": {
"dwellingNumber": "31",
"city": "Budapest",
"street": "Corvin sétány",
"countryCode": "hu",
"postalCode": "1082",
"postOfficeBoxText": "133",
"houseNumber": "1/b",
"locality": "Corvin-negyed",
"addressline2": "Main building",
"addressline1": "Corvin sétány 1/b",
"postOfficeBoxNumber": 9
}
}
Setting up or modifying a user's custom attribute
{
"properties": {
"preferredContactChannel": "email"
}
}
Deleting a user's custom attribute
{
"properties": {
"preferredContactChannel": ""
}
}
You can only create or update a value for a custom attribute that is already defined. Otherwise, the request fails. The custom attribute definition can be requested as a white glove service in Identity Cloud by an administrator.
Example request
Set the ID of the user. In addition, you can set any supported parameter to be updated.
userId=your-user-id-123 \
telephone=+3611234568
curl --request PATCH "https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $accessKey" \
--data "{ \"contacts\" : { \"telephone\" : \"$telephone\" } }"
HTTP response
On success
HTTP/1.1 200
is returned if the user is successfully modified.
The response contains all attributes of the user. The version
and lastModified
parameters are updated automatically.
Example response
{
"loginId": "[email protected]",
"address": {
"dwellingNumber": "31",
"city": "Budapest",
"street": "Corvin sétány",
"countryCode": "hu",
"postalCode": "1082",
"postOfficeBoxText": "133",
"houseNumber": "1/b",
"locality": "Corvin-negyed",
"addressline2": "Main building",
"addressline1": "Corvin sétány 1/b",
"postOfficeBoxNumber": 9
},
"gender": "other",
"modificationComment": "simply created modification",
"created": "2021-10-15T07:54:12Z",
"languageCode": "en",
"version": 1,
"birthDate": "2000-01-01",
"userState": "active",
"name": {
"firstName": "Jane",
"lastName": "Doe",
"title": "Dr."
},
"lastModified": "2021-10-15T07:54:12Z",
"userId": "4a5e7346-488b-46f9-914f-79ddb1131e0b",
"contacts": {
"telephone": "+3611234567",
"telefax": "+441619998888"
},
"remarks": "My first user!",
"properties": {
"preferredContactChannel": "email"
}
}
On failure
HTTP/1.1 401
is returned if the authorization fails due to an invalid access key.
HTTP/1.1 409
is returned if update fails with conflict.
HTTP/1.1 422
is returned if invalid request content is given.
HTTP/1.1 500
is returned if an unexpected error occurs.