Amazon Cognito · Schema

ListUsersRequest

Represents the request to list users.

AuthenticationIdentityOAuthOIDCSAMLUser ManagementFederated Identity

Properties

Name Type Description
UserPoolId object
AttributesToGet object
Limit object
PaginationToken object
Filter object
View JSON Schema on GitHub

JSON Schema

user-pools-list-users-request-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amazon-cognito/refs/heads/main/json-schema/user-pools-list-users-request-schema.json",
  "title": "ListUsersRequest",
  "description": "Represents the request to list users.",
  "type": "object",
  "properties": {
    "UserPoolId": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UserPoolIdType"
        },
        {
          "description": "The user pool ID for the user pool on which the search should be performed."
        }
      ]
    },
    "AttributesToGet": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SearchedAttributeNamesListType"
        },
        {
          "description": "A JSON array of user attribute names, for example <code>given_name</code>, that you want Amazon Cognito to include in the response for each user. When you don't provide an <code>AttributesToGet</code> parameter, Amazon Cognito returns all attributes for each user."
        }
      ]
    },
    "Limit": {
      "allOf": [
        {
          "$ref": "#/components/schemas/QueryLimitType"
        },
        {
          "description": "Maximum number of users to be returned."
        }
      ]
    },
    "PaginationToken": {
      "allOf": [
        {
          "$ref": "#/components/schemas/SearchPaginationTokenType"
        },
        {
          "description": "An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list."
        }
      ]
    },
    "Filter": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UserFilterType"
        },
        {
          "description": "<p>A filter string of the form \"<i>AttributeName</i> <i>Filter-Type</i> \"<i>AttributeValue</i>\"\". Quotation marks within the filter string must be escaped using the backslash (\\) character. For example, \"<code>family_name</code> = \\\"Reddy\\\"\".</p> <ul> <li> <p> <i>AttributeName</i>: The name of the attribute to search for. You can only search for one attribute at a time.</p> </li> <li> <p> <i>Filter-Type</i>: For an exact match, use =, for example, \"<code>given_name</code> = \\\"Jon\\\"\". For a prefix (\"starts with\") match, use ^=, for example, \"<code>given_name</code> ^= \\\"Jon\\\"\". </p> </li> <li> <p> <i>AttributeValue</i>: The attribute value that must be matched for each user.</p> </li> </ul> <p>If the filter string is empty, <code>ListUsers</code> returns all users in the user pool.</p> <p>You can only search for the following standard attributes:</p> <ul> <li> <p> <code>username</code> (case-sensitive)</p> </li> <li> <p> <code>email</code> </p> </li> <li> <p> <code>phone_number</code> </p> </li> <li> <p> <code>name</code> </p> </li> <li> <p> <code>given_name</code> </p> </li> <li> <p> <code>family_name</code> </p> </li> <li> <p> <code>preferred_username</code> </p> </li> <li> <p> <code>cognito:user_status</code> (called <b>Status</b> in the Console) (case-insensitive)</p> </li> <li> <p> <code>status (called <b>Enabled</b> in the Console) (case-sensitive)</code> </p> </li> <li> <p> <code>sub</code> </p> </li> </ul> <p>Custom attributes aren't searchable.</p> <note> <p>You can also list users with a client-side filter. The server-side filter matches no more than one attribute. For an advanced search, use a client-side filter with the <code>--query</code> parameter of the <code>list-users</code> action in the CLI. When you use a client-side filter, ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results. Repeat the query with each pagination token that is returned until you receive a null pagination token value, and then review the combined result. </p> <p>For more information about server-side and client-side filtering, see <a href=\"https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html\">FilteringCLI output</a> in the <a href=\"https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html\">Command Line Interface User Guide</a>. </p> </note> <p>For more information, see <a href=\"https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-using-listusers-api\">Searching for Users Using the ListUsers API</a> and <a href=\"https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-listusers-api-examples\">Examples of Using the ListUsers API</a> in the <i>Amazon Cognito Developer Guide</i>.</p>"
        }
      ]
    }
  },
  "required": [
    "UserPoolId"
  ]
}