Software Secure Workload
Activity Configure

Create a new user account

This endpoint is used to create a new user account.

POST /openapi/v1/users

Parameters: The JSON request body contains the following parameters

Name

Type

Description

email

string

Email associated with user account.

first_name

string

First name.

last_name

string

Last name.

app_scope_id

string

(optional) Root scope to which user belongs.

role_ids

list

(optional) The list of roles that should be assigned to the user.

The app_scope_id is the ID of the root scope to which the user is to be assigned. If the app_scope_id is not present then the user is a ‘Service Provider user.’ Only site admins can create service provider users. The role_ids are the ids of the roles that were created under the specified app scope.

Response object: Returns the newly created user object.

Sample python code


  req_payload = {
      "first_name": "fname",
      "last_name": "lname",
      "email": "foo@bar.com"
      "app_scope_id": "root_appscope_id",
      "role_ids": ["roleid1", "roleid2"]
  }
  resp = restclient.post('/users', json_body=json.dumps(req_payload))