Get Roles

Cortex XDR REST API

post /public_api/v1/rbac/get_roles

Retrieve information about one or more roles created in your environment.

Required license: Cortex XDR Pro per Endpoint, Cortex XDR Pro, or Cortex XDR Pro per GB

Body parameters
request_dataObject

A dictionary containing the API request fields.

role_namesArray[string]

List of one or more role names in your environment for which you want detailed information.

REQUEST BODY
{ "request_data": { "role_names": [ "Role1", "Role2" ] } }
CURL
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
'https://api-yourfqdn/public_api/v1/rbac/get_roles'
-d ''
Responses

OK

Body
replyArray

JSON object containing the query result.

pretty_nameString

Name of the role as it appears in the Management Console.

permissionsArray[string]

List of permissions associated with this role.

insert_timeInteger

Timestamp of when the Role was created.

update_timeInteger

Timestamp of when the Role was last updated.

created_byString

Email of the user who created the Role.

descriptionString

Description of the Role, if available.

groupsArray[string]

Group names associated with the Role.

usersArray[string]

Email address of users associated with the Role.

RESPONSE
{ "reply": [ [ { "pretty_name": "Role1", "permissions": [ "Reports", "Playbooks", "Datasets Access Control", "Dashboards", "Scripts" ], "insert_time": 1658315576844, "update_time": null, "created_by": "user1@acme.com", "description": "", "groups": [ "group1", "group2" ], "users": [] } ], [ { "pretty_name": "Role2", "permissions": [ "Dashboards", "Datasets Access Control" ], "insert_time": 1661435660656, "update_time": null, "created_by": "user1@acme.com", "description": "", "groups": [], "users": [] } ] ] }

Bad Request. Got an invalid JSON.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Unauthorized access. User does not have the required license type to run this API.equired

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Internal server error. A unified status for API communication type errors.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }