Creating a User

Use the PUT method of the user service to create a new user. In commercial editions, specify the user’s organization in the tenantId element of the user descriptor.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest/user/

Content-Type

Content

text/plain

A well-formed user descriptor that describes the properties of the desired user. You can set the following properties on the user account:

username – Required.
password – Required.
fullName – Required.
tenantId – Required on commercial editions with multiple organizations.
enabled – Optional.
emailAddress – Optional.
roles – Optional list of roles. The ROLE_USER is assigned automatically.

All other properties seen in user descriptors are generated by the server and should not be set.

Return Value on Success

Typical Return Values on Failure

201 Created

404 Not Found – When the organization ID in the descriptor is not found in the server.

The following example shows a user descriptor for creating a user:

<user>
  <username>Alice</username>
  <password>myPassword</password>
  <fullName>Alice Adams</fullName>
  <tenantId>organization_1</tenantId>
  <emailAddress>alice@example.com</emailAddress>
  <roles>
    <roleName>ROLE_DEMO</roleName>
  </roles>
</user>
Version: 
Feedback
randomness