Delete Role
Delete or restore a role definition in RSA Governance & Lifecycle.
POST https://instance.securid.com/aveksa/command.submit?cmd=deleteRole
Purpose
The deleteRole command deletes the role associated with the specified Role ID. It also supports restoring a previously deleted role by using the undoDelete query parameter.
Parameters are passed as URL query parameters using an HTTP POST request, not in the request body.
Request
Parameters (URL Query)
| Parameter | Type | Requirement | Description |
|---|---|---|---|
cmd | string | Command name: deleteRole. | |
roleId | integer | The ID of the role to delete or restore. | |
undoDelete | string | Optional | Controls deletion behavior:false: (Default) Deletes the role.true: Restores (undoes deletion of) the role.Value is case-insensitive. |
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>. | |
Accept | string | Optional | Desired response MIME type (for example, application/json or text/plain). |
Content-Type | string | Optional | Content type header: application/x-www-form-urlencoded or application/json. |
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 (Couldn't perform delete action on role).
Response
Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Execution result: success or failure. |
message | string | Optional diagnostic or informational details returned by the server. |
Examples
Request
- Curl
- Python
- Node.js
- PowerShell
# Delete a role
curl -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=deleteRole&roleId=3&format=json" \
-H "Authorization: Bearer <user-token>" \
-H "Accept: application/json"
# Restore (undo delete) a role
curl -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=deleteRole&roleId=3&undoDelete=true&format=json" \
-H "Authorization: Bearer <user-token>" \
-H "Accept: application/json"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
# Delete a role
params = {
"cmd": "deleteRole",
"roleId": 3,
"format": "json"
}
headers = {
"Authorization": "Bearer <user-token>",
"Accept": "application/json"
}
response = requests.post(url, params=params, headers=headers)
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: 'deleteRole',
roleId: 3,
format: 'json'
};
const headers = {
Authorization: 'Bearer <user-token>',
Accept: 'application/json'
};
axios.post(url, null, { 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=deleteRole&roleId=3&format=json"
$headers = @{
"Authorization" = "Bearer <user-token>"
"Accept" = "application/json"
}
$response = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers
$response
Response
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 412 Precondition Failed
JSON Format (format=json):
{
"status": "success",
"message": "Role 3 deleted successfully."
}
Properties Format (format=properties):
status=success
message=Role 3 deleted successfully.
Missing Token:
<html>
<head><title>Error</title></head>
<body>The token is required for the command 'deleteRole'</body>
</html>
Invalid or Expired Token:
<html>
<head><title>Error</title></head>
<body>The token is not valid for the command 'deleteRole'. Token is invalid or expired</body>
</html>
Returned when calling with a Trusted Application token without user delegation, or when the user lacks role deletion privileges:
<html>
<head><title>Error</title></head>
<body>Couldn't perform delete action on role. Check user authorization.
Query String=cmd=deleteRole&roleId=3&format=json</body>
</html>
<html>
<head><title>Error</title></head>
<body>The role with ID 3 could not be found.</body>
</html>
<html>
<head><title>Error</title></head>
<body>The parameter roleId is required and should be a number.</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.
References
- Create Role: Create a new role definition
- Commit Role: Commit changes to a role
- Edit Role: Modify an existing role definition
- RFC 6750: OAuth 2.0 Bearer Token Usage
- RFC 7235: Hypertext Transfer Protocol (HTTP/1.1) Authentication