Create Role
Create a new role definition in RSA Governance & Lifecycle.
POST https://instance.securid.com/aveksa/command.submit?cmd=createRole
Purpose
The createRole command creates a new role definition in the system. The newly created role is placed in a draft (New) state and requires the commitRole command to transition into a committed state.
This command parses the role attributes from a JSON payload in the request body, while endpoint routing parameters are passed as URL query parameters. Only authorized users with role creation privileges can execute this command.
Request
Parameters (URL Query)
| Parameter | Type | Requirement | Description |
|---|---|---|---|
cmd | string | Command name: createRole. | |
format | string | Optional | The response format:properties: (Default) Key-value format (key=value). If multiple objects return, values are comma-separated.json: JavaScript Object Notation format. Suitable for programmatic parsing. |
token | string | Deprecated | Session token retrieved from loginUser. Deprecated. Use the Authorization request header instead. |
Request Headers
| Header | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Bearer token for a user with system administrator privileges, obtained via loginUser. Format: Bearer <token>. | |
Content-Type | string | Must be application/json. | |
Accept | string | Optional | Desired response MIME type (for example, application/json or text/plain). |
The Authorization request header replaces the deprecated token URL query parameter.
Role management commands currently require an authenticated user session token obtained via loginUser with the Role Administrator capability. While the Web Services Administration console allows mapping Role commands to a Trusted Application, requests using a Trusted Application token (loginTrustedApp) currently return HTTP 403 (Not authorized to create role).
Request Body (JSON)
The request body must contain a JSON object defining the role attributes.
| Field | Type | Requirement | Description |
|---|---|---|---|
roleName | string | Display name of the role. Maximum 256 characters. | |
roleRawName | string | Unique identifier name of the role. Maximum 256 characters. | |
roleSetId | integer | ID of the role set to which this role belongs. Must be an existing role set ID. | |
availableForRequest | integer | Indicates whether the role is available for user requests: 1 (yes) or 0 (no). | |
roleType | string | Optional | Role type code. Acceptable values: "GR" (Global Role), "TR" (Technical Role), or "BR" (Business Role). Defaults to "BR" if null or omitted. |
longDescription | string | Optional | Detailed description of the role. Maximum 4000 characters. |
shortDescription | string | Optional | Short summary describing the role. Maximum 256 characters. |
helpLink | string | Optional | URL pointing to help documentation for the role (e.g., https://help.example.com/role). Maximum 256 characters. |
owner | integer | Optional | User ID of the primary owner. If omitted, no owner is assigned. |
backupOwner | integer | Optional | User ID of the backup owner. If omitted, no backup owner is assigned. |
disabled | boolean | Optional | Whether the role is disabled: true (disabled) or false (enabled, default). |
Request Payload Example
{
"roleName": "Financial Auditor",
"roleRawName": "ROLE_FIN_AUDITOR",
"longDescription": "Grants read access to general ledger and compliance audit records.",
"shortDescription": "Financial auditing business role",
"helpLink": "https://help.example.com/roles/auditor",
"availableForRequest": 1,
"owner": 1001,
"backupOwner": 1002,
"disabled": false,
"roleSetId": 101,
"roleType": "BR"
}
Response
Parameters
| Parameter | Type | Description |
|---|---|---|
roleVersionId | integer | Version ID of the newly created role in pending state. Required when calling commitRole. |
status | string | Execution result: success or failure. |
message | string | Optional diagnostic or informational details regarding the operation. |
Examples
Request
- Curl
- Python
- Node.js
- PowerShell
curl -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=createRole&format=json" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"roleName": "Financial Auditor",
"roleRawName": "ROLE_FIN_AUDITOR",
"longDescription": "Grants read access to general ledger and compliance audit records.",
"shortDescription": "Financial auditing business role",
"helpLink": "https://help.example.com/roles/auditor",
"availableForRequest": 1,
"owner": 1001,
"backupOwner": 1002,
"disabled": false,
"roleSetId": 101,
"roleType": "BR"
}'
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "createRole",
"format": "json"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"roleName": "Financial Auditor",
"roleRawName": "ROLE_FIN_AUDITOR",
"longDescription": "Grants read access to general ledger and compliance audit records.",
"shortDescription": "Financial auditing business role",
"helpLink": "https://help.example.com/roles/auditor",
"availableForRequest": 1,
"owner": 1001,
"backupOwner": 1002,
"disabled": False,
"roleSetId": 101,
"roleType": "BR"
}
response = requests.post(url, params=params, headers=headers, json=payload)
if response.status_code == 200:
print(response.json())
else:
print(f"Request failed: {response.status_code} - {response.text}")
const axios = require('axios');
const url = "https://instance.securid.com/aveksa/command.submit";
const params = {
cmd: 'createRole',
format: 'json'
};
const headers = {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
Accept: 'application/json'
};
const payload = {
roleName: 'Financial Auditor',
roleRawName: 'ROLE_FIN_AUDITOR',
longDescription: 'Grants read access to general ledger and compliance audit records.',
shortDescription: 'Financial auditing business role',
helpLink: 'https://help.example.com/roles/auditor',
availableForRequest: 1,
owner: 1001,
backupOwner: 1002,
disabled: false,
roleSetId: 101,
roleType: 'BR'
};
axios.post(url, payload, { params, headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Request failed:', error.response ? error.response.data : error.message);
});
$uri = "https://instance.securid.com/aveksa/command.submit?cmd=createRole&format=json"
$headers = @{
"Authorization" = "Bearer <token>"
"Content-Type" = "application/json"
"Accept" = "application/json"
}
$body = @{
roleName = "Financial Auditor"
roleRawName = "ROLE_FIN_AUDITOR"
longDescription = "Grants read access to general ledger and compliance audit records."
shortDescription = "Financial auditing business role"
helpLink = "https://help.example.com/roles/auditor"
availableForRequest = 1
owner = 1001
backupOwner = 1002
disabled = $false
roleSetId = 101
roleType = "BR"
} | ConvertTo-Json
$response = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $body
$response
Response
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 412 Precondition Failed
JSON Format (format=json):
{
"status": "success",
"roleVersionId": 5012,
"message": "Role created successfully in pending state."
}
Properties Format (format=properties):
status=success
roleVersionId=5012
message=Role created successfully in pending state.
Missing Token:
<html>
<head><title>Error</title></head>
<body>The token is required for the command 'createRole'</body>
</html>
Invalid or Expired Token:
<html>
<head><title>Error</title></head>
<body>The token is not valid for the command 'createRole'. Token is invalid or expired</body>
</html>
Returned when calling with a Trusted Application token without user delegation, or when the user lacks role creation privileges:
<html>
<head><title>Error</title></head>
<body>Not authorized to create role
Query String=cmd=createRole&format=json</body>
</html>
<html>
<head><title>Error</title></head>
<body>The parameter roleName is required and must not be empty.</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.
References
- Commit Role: Commit pending changes to make the newly created role active
- Edit Role: Modify an existing role definition
- Get Role Version: Retrieve role definition and version details
- RFC 6750: OAuth 2.0 Bearer Token Usage
- RFC 7235: Hypertext Transfer Protocol (HTTP/1.1) Authentication