Users

User defines a subject entitled to connect to servers within monitored IT infrastructure. Detailed object definition (i.e. unique login and domain combination, full name, email address etc.) enables precise accountability of user actions when login and password are substituted with a shared account login credentials.

Data structures

UserModel
Parameter Type Description
id string Object Identifier. Read only
name string Unique name. Required
email EMail  
language string{en, pl, ru, ua} Interface language. Required
qual_name string Read only
is_deleted string Read only
blocked bool  
reason string The reason a user is blocked. Optional if blocked == true
full_name string  
organization string  
phone string  
ad_domain string  
ldap_base string  
failures int Number of authentication failures
password_complexity bool Enable password complexity settings
external_sync bool Enable external synchronization
valid_since DateTime Beginning access time
valid_to DateTime Ending access time
domain string  
role string{superadmin, admin, operator, user} Required
UserSafeAssignment
Parameter Type Description
password_visible bool Allow a user to use Secret Checkout feature and view passwords in the User Portal.
position int mandatory, 0 or a negative value
safe_id int
  • write only
  • required
safe   Read only
      id int  
      name string  
use_time_policy bool  

Creating a user

Request

Method
POST
Path
/api/system/users
Headers
Content-Type: Application/JSON
Body
UserModel

Possible Response

Status
201 CREATED
Headers
Content-Type: Application/JSON
Body
UserModel
Description Object successfully created. Resultant object’s attributes are included in response body.

Possible Response

Status
400 BAD REQUEST
Headers
Content-Type: Application/JSON
Body
ValidationErrors
Description Validation didn’t pass.

Example:

curl -k -X POST -H "Content-Type:application/json"
https://10.0.150.150/api/system/users?sessionid={{sessionid}} -d
{"name":"john", "role":"user", "language":"en"}

Result: {
"id":"68719476747",
"email":"",
"language":"en",
"qual_name":"john",
"is_deleted":false,
"blocked":false,
"reason":"",
"name":"john",
"full_name":"",
"organization":null,
"phone":"",
"ad_domain":"",
"ldap_base":"",
"failures":0,
"password_complexity":false,
"external_sync":false,
"valid_since":"0001-01-01T00:00:00",
"valid_to":"9999-12-31T23:59:59.999999",
"domain":null,
"role":"user",
"ldap_server":null
}

Retrieving users list

Request

Method
GET
Path
/api/system/users
pattern Optional parameter allowing for narrowing down the users list based on user login.

Note

Results pagination

Every GET request, which returns a collection of objects can be optionally paginated. To achieve it add a pagination parameter to the request path:

/api/system/objects?page=3&page_size=10
Pagination parameters
page int
page_size int

Possible Response

Status
200 OK
Headers
Content-Type: Application/JSON
Body
[
     UserModel,
     ...
]

Example:

    curl -k -X GET -H "Content-Type:application/json"
    "https://10.0.150.150/api/system/users?sessionid={{sessionid}}"

    Result: {
"count": 1,
"next": null,
"previous": null,
"results": [
            "id":"68719476747",
            "email":"",
            "language":"en",
            "qual_name":"john",
            "is_deleted":false,
            "blocked":false,
            "reason":"",
            "name":"john",
            "full_name":"",
            "organization":null,
            "phone":"",
            "ad_domain":"",
            "ldap_base":"",
            "failures":0,
            "password_complexity":false,
            "external_sync":false,
            "valid_since":"0001-01-01T00:00:00",
            "valid_to":"9999-12-31T23:59:59.999999",
            "domain":null,
            "role":"user",
            "ldap_server":null
            ]}

Retrieving a user

Request

Method
GET
Path
/api/system/users/user_id

Possible Response

Status
200 OK
Headers
Content-Type: Application/JSON
Body
UserModel

Possible Response

Status
404 NOT FOUND
Description No user with given id.

Example:

curl -k -X GET "https://10.0.150.150/api/system/users/68719476737?sessionid={{sessionid}}"

Result: {
"id":"68719476737",
"email":null,
"language":"en",
"qual_name":"admin",
"is_deleted":false,
"blocked":false,
"reason":null,
"name":"admin",
"full_name":null,
"organization":null,
"phone":null,
"ad_domain":null,
"ldap_base":null,
"failures":-1,
"password_complexity":false,
"external_sync":false,
"valid_since":"0001-01-01T00:00:00",
"valid_to":"9999-12-31T23:59:59.999999",
"domain":null,
"role":"superadmin",
"ldap_server":null
        }

Modifying a user

Request

Method
PUT, PATCH
Path
/api/system/users/user_id

Possible Response

Status
200 OK
Headers
Content-Type: Application/JSON
Body
UserModel

Possible Response

Status
400 BAD REQUEST
Headers
Content-Type: Application/JSON
Body
UserModel

Possible Response

Status
404 NOT FOUND
Description No user with given id.

Example:

curl -k -X PATCH -H "Content-Type:application/json"
https://10.0.150.150/api/system/users/68719476745?sessionid={{sessionid}} -d
{"name":"brian"}
Result: {
        "id":"68719476745",
        "email":"",
        "language":"en",
        "qual_name":"brian",
        "is_deleted":false,
        "blocked":false,
        "reason":"",
        "name":"brian",
        "full_name":"",
        "organization":null,
        "phone":"",
        "ad_domain":"",
        "ldap_base":"",
        "failures":0,
        "password_complexity":false,
        "external_sync":false,
        "valid_since":"0001-01-01T00:00:00",
        "valid_to":"9999-12-31T23:59:59.999999",
        "domain":null,
        "role":"user",
        "ldap_server":null
                }

Deleting a user

Request

Method
DELETE
Path
/api/system/users/user_id

Possible Response

Status
204 NO CONTENT

Possible Response

Status
404 NOT FOUND
Description Object with specified identifier was not found.

Example:

curl -k -X DELETE https://10.0.150.150/api/system/users/68719476745?sessionid={{sessionid}}

Retrieving users allowed to manage users

Request

Method
GET
Path
/api/system/users/user_id/granted_users

Note

Results pagination

Every GET request, which returns a collection of objects can be optionally paginated. To achieve it add a pagination parameter to the request path:

/api/system/objects?page=3&page_size=10
Pagination parameters
page int
page_size int

Possible Response

Status
200 OK
Headers
Content-Type: Application/JSON
Body
[{
        'name': 'username',
        'id': :id
},  ...]

Example:

curl -k -X GET
"https://10.0.150.150/api/system/users/68719476740/granted_users?sessionid={{sessionid}}"
{"id":68719476748,"name":"awesome"}

Granting management privileges

Request

Method
POST
Path
/api/system/users/user_id/granted_users
Body
{
        ''user_id'': :user_id
}

Possible Response

Status
201 CREATED

Example:

curl -k -X POST -H "Content-Type:application/json"
https://10.0.150.150/api/system/users/68719476740/granted_users?sessionid={{sessionid}} -d
{"user_id":68719476748}

Result: {"id":68719476748,"name":"awesome"}

Revoking management privileges

Request

Method
DELETE
Path
/api/system/users/user_id/granted_users/user_id

Possible Response

Status
204 NO CONTENT

Possible Response

Status
404 NOT FOUND

Example:

curl -k -X DELETE
https://10.0.150.150/api/system/users/68719476740/granted_users/68719476748?sessionid={{sessionid}}

Retrieving user-safe assignments list

Request

Method
GET
Path
/api/system/users/:user_id/safes

Note

Results pagination

Every GET request, which returns a collection of objects can be optionally paginated. To achieve it add a pagination parameter to the request path:

/api/system/objects?page=3&page_size=10
Pagination parameters
page int
page_size int

Possible Response

Status
200 OK
Headers
Content-Type: Application/JSON
Body
[
        UserSafeAssignment,
        ...
]

Example:

curl -k -X GET
"https://10.0.150.150./api/system/users/68719476740/safes?sessionid={{sessionid}}"

Creating a user-safe assignment

Request

Method
POST
Path
/api/system/users/:user_id/safes
Body
UserSafeAssignment

Possible Response

Status
201 CREATED
Headers
Content-Type: Application/JSON
Body
UserSafeAssignment

Possible Response

Status
400 BAD REQUEST
Headers
Content-Type: Application/JSON
Body
ValidationErrors

Possible Response

Status
404 NOT FOUND

Example:

curl -k -X POST -H "Content-Type:application/json"
https://10.0.150.150/api/system/users/68719476740/safes?sessionid={{sessionid}} -d
{"safe_id":2, "position":0}

Result: {
        "safe":
        {"id":2,
        "name":"portal"
        },
"password_visible":false,
"use_time_policy":false,
"position":0,
"blocked":false,
"valid_since":"0001-01-01T00:00:00",
"valid_to":"9999-12-31T23:59:59.999999"
        }

Deleting a user-safe assignment

Request

Method
DELETE
Path
/api/system/users/:user_id/safes/:safe_id

Possible Response

Status
204 NO CONTENT

Possible Response

Status
404 NOT FOUND

Example:

curl -k -X DELETE -H
https://10.0.150.150/api/system/users/68719476740/safes/2?sessionid={{sessionid}}