Search for users

Use the Search for Users API to search for all users in the Control Room.

Prerequisites

View Users
Users who have view users permissions can retrieve all users.
JSON Web Token (JWT)
All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Authentication API. See Enterprise 11 Authentication API.
  • URL: http://<your_control_room_url>/v1/usermanagement/users/list.

    Replace the content in the angle brackets with your Control Room URL.

  • Method: POST.
  • Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at: http://<your_control_room_url>/swagger/.
  • You can also use a REST client to complete this task.

Procedure

  1. Add an authentication token to the request header.
    Use the Authentication API to generate a JSON Web Token. See Enterprise 11 Authentication API.
  2. Select POST as the method.
    Apply filters to perform basic conditional queries and pagination control for processing web pages. There are three basic features related to filtering: filtering conditions, sorting columns, and pagination parameters. See Filters in an API request body.
    POST http://<your_control_room_url>/v1/usermanagement/users/list
  3. Send the request.
    • In a REST client, click SEND.
    • In the Swagger interface, click Execute.

    Request body:

    The following request finds all users with a username that contains doc and who were created between December 1 and December 31, 2019.
    {
      "fields": [],
      "filter": {
        "operator": "and",
        "operands": [
          {
            "operator": "substring",
            "field": "username",
            "value": "doc"
          },
          {
            "operator": "gt",
            "field": "createdOn",
            "value": "2019-12-01T00:00:00.989Z"
          },
          {
            "operator": "lt",
            "field": "createdOn",
            "value": "2019-12-06T23:00:00.123Z"
          }
        ]
      }
    }

    The response in this example returned data for the doc username.

    Response body:
    {
      "page": {
        "offset": 0,
        "total": 24,
        "totalFilter": 5
      },
      "list": [{
        "id": 29,
        "username": "docs-2fa-vm1",
        "domain": "",
        "firstName": "",
        "lastName": "",
        "version": 2,
        "principalId": 29,
        "email": "tm@automationanywhere.com",
        "emailVerified": true,
        "passwordSet": true,
        "questionsSet": true,
        "enableAutoLogin": true,
        "disabled": false,
        "clientRegistered": true,
        "description": "",
        "createdBy": 4,
        "createdOn": "2019-12-05T05:24:49.330Z",
        "updatedBy": 0,
        "updatedOn": "2019-12-05T05:27:58.687Z",
        "licenseFeatures": ["DEVELOPMENT"],
        "roles": [{
          "id": 31,
          "name": "2fa-role-basic-bot-permission",
          "version": "0"
        }],
        "deleted": false
      }, {
        "id": 30,
        "username": "docs-test-02",
        "domain": "",
        "firstName": "",
        "lastName": "",
        "version": 0,
        "principalId": 30,
        "email": "a@a.com",
        "emailVerified": true,
        "passwordSet": false,
        "questionsSet": false,
        "enableAutoLogin": true,
        "disabled": false,
        "clientRegistered": false,
        "description": "Docs resource",
        "createdBy": 4,
        "createdOn": "2019-12-05T23:15:53.907Z",
        "updatedBy": 4,
        "updatedOn": "2019-12-05T23:15:53.907Z",
        "licenseFeatures": ["RUNTIME", "IQBOTRUNTIME"],
        "roles": [{
          "id": 2,
          "name": "AAE_Basic",
          "version": "0"
        }, {
          "id": 13,
          "name": "AAE_Meta Bot Designer",
          "version": "0"
        }],
        "deleted": false
      }, {
        "id": 31,
        "username": "docs-test-04",
        "domain": "",
        "firstName": "",
        "lastName": "",
        "version": 0,
        "principalId": 31,
        "email": "a@a.com",
        "emailVerified": true,
        "passwordSet": false,
        "questionsSet": false,
        "enableAutoLogin": true,
        "disabled": false,
        "clientRegistered": false,
        "description": "Docs resource",
        "createdBy": 4,
        "createdOn": "2019-12-05T23:16:26.543Z",
        "updatedBy": 4,
        "updatedOn": "2019-12-05T23:16:26.543Z",
        "licenseFeatures": ["RUNTIME", "IQBOTRUNTIME"],
        "roles": [{
          "id": 2,
          "name": "AAE_Basic",
          "version": "0"
        }, {
          "id": 13,
          "name": "AAE_Meta Bot Designer",
          "version": "0"
        }],
        "deleted": false
      }, {
        "id": 32,
        "username": "docs-user-md",
        "domain": "",
        "firstName": "",
        "lastName": "",
        "version": 0,
        "principalId": 32,
        "email": "a@a.com",
        "emailVerified": true,
        "passwordSet": false,
        "questionsSet": false,
        "enableAutoLogin": true,
        "disabled": false,
        "clientRegistered": false,
        "description": "Docs resource",
        "createdBy": 4,
        "createdOn": "2019-12-05T23:45:44.267Z",
        "updatedBy": 4,
        "updatedOn": "2019-12-05T23:45:44.267Z",
        "licenseFeatures": ["RUNTIME", "IQBOTRUNTIME"],
        "roles": [{
          "id": 2,
          "name": "AAE_Basic",
          "version": "0"
        }, {
          "id": 13,
          "name": "AAE_Meta Bot Designer",
          "version": "0"
        }],
        "deleted": false
      }, {
        "id": 33,
        "username": "docs-tm-admin",
        "domain": "",
        "firstName": "",
        "lastName": "",
        "version": 2,
        "principalId": 33,
        "email": "tr@automationanywhere.com",
        "emailVerified": true,
        "passwordSet": true,
        "questionsSet": true,
        "enableAutoLogin": false,
        "disabled": false,
        "clientRegistered": false,
        "description": "",
        "createdBy": 4,
        "createdOn": "2019-12-06T19:05:36.217Z",
        "updatedBy": 4,
        "updatedOn": "2019-12-06T19:07:21.097Z",
        "licenseFeatures": [],
        "roles": [{
          "id": 33,
          "name": "apiKey-Docs",
          "version": "0"
        }, {
          "id": 1,
          "name": "AAE_Admin",
          "version": "0"
        }],
        "deleted": false
      }]
    }
    Response body parameters:
    Parameter Name Description
    id System-generated ID number who created a user.
    username User name for a new user.
    domain Active directory domain name.
    version System-generated version number for a new user.
    email New user email address.
    passwordSet String: 8-15 characters; a-z, A-Z, 0-9, @, -, _, !, #, $, %, &, and . (period). Set a password for a new user only.
    PrincipalId System-generated ID number of an active directory principal user who created a new user.
    Permission A specific permission ID.
    licenseFeature Automation Anywhere license associated with this role.
    Roles: id System-generated role ID number associated with this user. Not every user has an associated role.
    createdBy System-generated ID number of an admin user who created a new user.
    updatedBy System-generated ID number of an admin user who updated the user.
Note: You can also run REST requests from a command terminal. The following is a curl request example. This example is formatted for readability. Replace the text inside the angle brackets, <authentication_token>, with your authentication token.
curl -X POST "http://<your_control_room_url>/v1/usermanagment/users/list" 
-H "accept: application/json" 
-H "X-Authorization: <authentication_token>" 
-H "Content-Type: application/json" -d "{
  "fields": [],
  "filter": {
    "operator": "and",
    "operands": [
      {
        "operator": "substring",
        "field": "username",
        "value": "doc"
      },
      {
        "operator": "gt",
        "field": "createdOn",
        "value": "2019-12-01T00:00:00.989Z"
      },
      {
        "operator": "lt",
        "field": "createdOn",
        "value": "2019-12-06T23:00:00.123Z"
      }
    ]
  }
}'