WorkMail / Client / list_users

list_users#

WorkMail.Client.list_users(**kwargs)#

Returns summaries of the organization’s users.

See also: AWS API Documentation

Request Syntax

response = client.list_users(
    OrganizationId='string',
    NextToken='string',
    MaxResults=123,
    Filters={
        'UsernamePrefix': 'string',
        'DisplayNamePrefix': 'string',
        'PrimaryEmailPrefix': 'string',
        'State': 'ENABLED'|'DISABLED'|'DELETED',
        'IdentityProviderUserIdPrefix': 'string'
    }
)
Parameters:
  • OrganizationId (string) –

    [REQUIRED]

    The identifier for the organization under which the users exist.

  • NextToken (string) – The token to use to retrieve the next page of results. The first call does not contain any tokens.

  • MaxResults (integer) – The maximum number of results to return in a single call.

  • Filters (dict) –

    Limit the user search results based on the filter criteria. You can only use one filter per request.

    • UsernamePrefix (string) –

      Filters only users with the provided username prefix.

    • DisplayNamePrefix (string) –

      Filters only users with the provided display name prefix.

    • PrimaryEmailPrefix (string) –

      Filters only users with the provided email prefix.

    • State (string) –

      Filters only users with the provided state.

    • IdentityProviderUserIdPrefix (string) –

      Filters only users with the ID from the IAM Identity Center.

Return type:

dict

Returns:

Response Syntax

{
    'Users': [
        {
            'Id': 'string',
            'Email': 'string',
            'Name': 'string',
            'DisplayName': 'string',
            'State': 'ENABLED'|'DISABLED'|'DELETED',
            'UserRole': 'USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER',
            'EnabledDate': datetime(2015, 1, 1),
            'DisabledDate': datetime(2015, 1, 1),
            'IdentityProviderUserId': 'string',
            'IdentityProviderIdentityStoreId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Users (list) –

      The overview of users for an organization.

      • (dict) –

        The representation of an WorkMail user.

        • Id (string) –

          The identifier of the user.

        • Email (string) –

          The email of the user.

        • Name (string) –

          The name of the user.

        • DisplayName (string) –

          The display name of the user.

        • State (string) –

          The state of the user, which can be ENABLED, DISABLED, or DELETED.

        • UserRole (string) –

          The role of the user.

        • EnabledDate (datetime) –

          The date indicating when the user was enabled for WorkMail use.

        • DisabledDate (datetime) –

          The date indicating when the user was disabled from WorkMail use.

        • IdentityProviderUserId (string) –

          User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.

        • IdentityProviderIdentityStoreId (string) –

          Identity store ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.

    • NextToken (string) –

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.

Exceptions

  • WorkMail.Client.exceptions.InvalidParameterException

  • WorkMail.Client.exceptions.OrganizationNotFoundException

  • WorkMail.Client.exceptions.OrganizationStateException