Creating a Role

To create a role, send the PUT request to the rest_v2/roles service with the intended role ID (name) 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 create roles in the root organization.

Roles do not have any properties to specify other than the role ID, but the request must include a descriptor that can be empty.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest_v2/roles/roleID

http://<host>:<port>/jasperserver[-pro]/rest_v2/organizations/orgID/roles/roleID

Content-Type

Content

application/xml

application/json

An empty role descriptor, either <role></role> or {}. Do not specify the following properties:

name – Specified in the URL and should not be modified in the descriptor.
tenantID – Specified in the URL and cannot be modified in the descriptor.
externallyDefined – Computed automatically by the server.

Return Value on Success

Typical Return Values on Failure

201 Created – The role was successfully created. The response contains the full descriptor of the new role.

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

Version: 
Feedback