Users

Update an existing user.

Changed on

Updates an existing user's information including personal details, roles, and account settings. Only admin users or users with appropriate portlet access can perform this operation. The optional roles list carries role KEYS and is the user's complete desired set of user-assignable roles (editUsers=true): omit the field to leave roles untouched, send a non-empty list to replace the user-assignable role set, or send an empty list to remove all of the user's user-assignable roles. System-managed memberships (e.g. the user's individual role) are never modified, keys that resolve to no role are ignored, and null or blank entries are rejected with 400. Note that roles without a key cannot be expressed in this list — manage those through the role-centric /v1/roles/{roleId}/users endpoints instead.

put/api/v1/users

Request

Request body

userIdstring
activeboolean
firstNamestring required
middleNamestring
lastNamestring required
nickNamestring
emailstring required
maleboolean
birthdaystring
languageIdstring
timeZoneIdstring
passwordstring[]
additionalInfoobject
rolesstring[]

Role keys or role IDs (roles created without a key can only be referenced by ID). On update: field absent = roles untouched; [] = remove all user-assignable roles; otherwise the complete user-assignable role set. On create: absent or empty = default Front-end User role. Unknown entries are ignored.

Example request

{
  "roles": [
    "DOTCMS_BACK_END_USER",
    "48190c8c-42c4-46af-8d1a-0cd5db894797"
  ]
}

Response

If success returns a map with the user + user id.

entityobject
i18nMessagesMapobject
permissionsstring[]

Changes

    • breaking

      request body became required

    • breaking

      removed the media type */* from the request body

    • breaking

      the response's property type changed from array to object for status

    • info

      api operation id udpate removed and replaced with updateUser

    • info

      api tag Users added

    • info

      added the media type application/json to the request body