Modifying User Properties

To modify the properties of a user account, put all desired information in a user descriptor, and include it in a PUT request to the rest_v2/users service, with the existing user ID (username) specified in the URL.

In the community edition of the server, or commercial editions without organizations, use the first form of the URL.
In commercial editions with organizations, use the second URL to specify the user’s organization. When specifying the organization, use its unique ID, not its path. When logged in as the system admin (superuser), use the first URL to modify users of the root organization.

To modify a user, the user ID in the URL must already exist on the server or in the organization. If the user ID doesn’t exist, a user account will be created, as described in section Creating a User.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest_v2/users/userID

http://<host>:<port>/jasperserver[-pro]/rest_v2/organizations/orgID/users/userID

Content-Type

Content

application/xml

application/json

A user descriptor that includes the properties you want to change. Do not specify the following properties:

username – Specified in the URL and cannot be modified in the descriptor.
tenantID – Specified in the URL and cannot be modified in the descriptor.
externallyDefined – Computed automatically by the server.
previousPasswordChangeTime – Computed automatically by the server.

Return Value on Success

Typical Return Values on Failure

200 OK – The user properties were successfully updated.

404 Not Found – When the organization ID cannot be resolved.

To add a role to the user, specify the entire list of roles with the desired role added. To remove a role from a user, specify the entire list of roles with the desired role removed. The following example shows the descriptor in JSON format:

{
  "enabled":true,
  "password":"newPassword",
  "roles":[
    {"name":"ROLE_USER"}]
    {"name":"ROLE_STOREMANAGER"}]
}
Version: 
Feedback