Software Secure Workload
Activity Configure

Add role to the user account

This endpoint is used to add a role to a user account.

PUT /openapi/v1/users/{user_id}/add_role

Parameters: The request URL contains the following parameters

Name

Type

Description

user_id

string

ID of the user object being modified.

The JSON request body contains the following parameters

Name

Type

Description

role_id

string

ID of the role object to be added.

Response object: Returns the modified user object associated with the specified ID.

Sample python code


  user_id = '5ce480db497d4f1ca1fc2b2b'
  req_payload = {
      "role_id": "5ce480d4497d4f1c155d0cef",
  }
  resp = restclient.put('/users/%s/add_role' % user_id,
                        json_body=json.dumps(req_payload))