Skip to main content

"listAccounts" (JSON Action)

List all accounts that the logged-in account is authorized to see

Links: Concepts | Tutorials | FAQs

Request examples

{
  "api": "admin",
  "action": "listAccounts",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
{
  "api": "admin",
  "action": "listAccounts",
  "params": {
    "partialNames": [
      "adm",
      "NewAccount"
    ]
  },
  "requestId": "1",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

Use the listAccounts API action to list all accounts that the logged-in account is authorized to see

listAccountslistAccountlist accountAPI actionJSON ADMIN APINosferatuJSON Action
Table 1. listAccounts "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

partialNames

(optional) returns accounts with usernames that match at least part of one or more of the specified values.

[]

array

1 to 64 bytes



The "partialNames" property is an optional query filter that returns accounts with usernames that match the specified partial usernames. The match starts at the name's beginning, making it a "starts with" match instead of a "substring" match. If the property is empty, null, or omitted, it returns all the accounts.

  "params": {
    "partialNames": [
      "adm",
      "NewAccount"
    ]
  },
Table 2. listAccounts "result" property summaries

Property

Description

Type

Contents

accounts

lists each account that matches the request parameters as its own object.

array of objects

One object per matching account.

accounts
.roleNames

specifies which roles have been assigned to the specified account for access control.

array of strings

An array of 1 or more strings between 1 and 64 bytes.

accounts
.username

specifies the name of the account.

string

1 to 64 bytes



The "accounts" property returns each account that matches one of the usernames or partial usernames specified in the request. Each account is returned as an object, containing all the properties relevant to the account.

    "accounts": [
      {
        "username": "admin",
        "accountDescription": "",
        "lockoutAfterNFailedAttempts": 0,
        "maxDaysBeforePasswordMustChange": 0,
        "maxMinutesBeforeNextLogin": 0,
        "memoryLimit": 0,
        "memoryRule": "default",
        "roles": [
          {
            "roleName": "ADMIN"
          }
        ]
      }

The "roleNames" property lists the roles given to the accounts specified by the "partialNames" property. This property can specify one or more roles, each between 1 and 64 bytes.

  "params": {
    "partialNames": [
      "adm",
      "NewAccount"
    ]
  },

The "username" property is a required string up to 64 bytes long. It is the name that uniquely identifies the account.

Note

See System limits for user name and other system properties requirements.