Skip to main content

Update user

The endpoint provides functionality for user modification.

HTTP request

PATCH https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId

Parameters

ParameterInTypeRequired / OptionalDescription
instanceIdpathstringrequiredThe ID of your Identity Cloud instance
userIdpathstringrequiredThe ID of the user

Request body

ParameterTypeRequired / OptionalDescription
versionintegeroptionalThe version of the user data, used for optimistic locking
loginIdstringoptionalThe email of the user
languageCodestringoptionalThe language of the user
name.titlestringoptionalThe title of the user
name.firstNamestringoptionalThe first name of the user
name.lastNamestringoptionalThe last name of the user
genderenumoptionalThe gender of the user Values: female, male, other
birthDatestringoptionalThe birth date of the user in ISO 8601 date format YYYYY-MM-DD
address.countryCodestringoptionalThe country code of the user in ISO 3166-1 format
address.citystringoptionalThe city of the user's address
address.postalCodestringoptionalThe postal code of the user
address.addressline1stringoptionalFirst free text for supplementary address information of the user
address.addressline2stringoptionalSecond free text for supplementary address information of the user
address.streetstringoptionalThe street of the user
address.houseNumberstringoptionalThe house number of the user
address.dwellingNumberstringoptionalThe dwelling number of the user
address.postOfficeBoxTextstringoptionalThe post office box text of the user
address.postOfficeBoxNumberstringoptionalThe post office box number of the user
address.localitystringoptionalThe locality of the user address
contacts.telephonestringoptionalThe landline telephone number of the user in E.164 format starting with the plus + sign and having no spaces
contacts.telefaxstringoptionalThe telefax number of the user in E.164 format starting with the plus + sign and having no spaces
remarksstringoptionalThe short metadata; Additional information field for the user Example Remarks to a food delivery
modificationCommentstringoptionalAdditional metadata regarding user modification Note This can be seen in the history.
propertiesmap<string,string>optionalCustom 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": ""
}
}
note

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.