Set a User Role

Cortex Xpanse REST API

post /public_api/v1/rbac/set_user_role

Add or remove one or more users from a role.

Required license: Cortex Xpanse Expander

CURL
curl -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ "https://api-yourfqdn/public_api/v1/rbac/set_user_role" \ -d '{ "request_data" : { "role_name" : "role_name", "user_emails" : [ "user_emails", "user_emails" ] } }'
Request
Body
optional
Example: {"request_data":{"user_emails":["user1@acme.com","user2@acme.com"],"role_name":"Role1"}}
request_data
required
A dictionary containing the API request fields.
user_emails
optional
Array of strings
List of one or more user emails of users you want to add to or remove from a role.
role_name
optional
String
Name of the role you want to add a user to. Send an empty field to remove the user.
Responses

OK

Body
reply
optional
JSON object containing the query result.
update_count
optional
String
Number of updated users.

Bad Request. Got an invalid JSON.

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
err_extra
optional
String
Additional information describing the error.

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

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
err_extra
optional
String
Additional information describing the error.

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

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
err_extra
optional
String
Additional information describing the error.

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

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
err_extra
optional
String
Additional information describing the error.

Internal Server Error

Body
The query result upon error.
err_code
optional
String
HTTP response code.
err_msg
optional
String
Error message.
err_extra
optional
String
Additional information describing the error.