getUserList method

Future<List<User>?> getUserList({
  1. List<String>? emailAddress,
  2. List<String>? phoneNumber,
  3. List<String>? externalId,
  4. List<String>? username,
  5. List<String>? web3Wallet,
  6. List<String>? userId,
  7. List<String>? organizationId,
  8. String? query,
  9. String? emailAddressQuery,
  10. String? phoneNumberQuery,
  11. String? usernameQuery,
  12. String? nameQuery,
  13. bool? banned,
  14. int? lastActiveAtBefore,
  15. int? lastActiveAtAfter,
  16. int? lastActiveAtSince,
  17. int? createdAtBefore,
  18. int? createdAtAfter,
  19. int? limit,
  20. int? offset,
  21. String? orderBy,
})

List all users

Returns a list of all users. The users are returned sorted by creation date, with the newest users appearing first.

Parameters:

  • List<String> emailAddress: Returns users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • List<String> phoneNumber: Returns users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • List<String> externalId: Returns users with the specified external ids. For each external id, the + and - can be prepended to the id, which denote whether the respective external id should be included or excluded from the result set. Accepts up to 100 external ids. Any external ids not found are ignored.

  • List<String> username: Returns users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • List<String> web3Wallet: Returns users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • List<String> userId: Returns users with the user ids specified. For each user id, the + and - can be prepended to the id, which denote whether the respective user id should be included or excluded from the result set. Accepts up to 100 user ids. Any user ids not found are ignored.

  • List<String> organizationId: Returns users that have memberships to the given organizations. For each organization id, the + and - can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids.

  • String query: Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well.

  • String emailAddressQuery: Returns users with emails that match the given query, via case-insensitive partial match. For example, email_address_query=ello will match a user with the email HELLO@example.com.

  • String phoneNumberQuery: Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, phone_number_query=555 will match a user with the phone number +1555xxxxxxx.

  • String usernameQuery: Returns users with usernames that match the given query, via case-insensitive partial match. For example, username_query=CoolUser will match a user with the username SomeCoolUser.

  • String nameQuery: Returns users with names that match the given query, via case-insensitive partial match.

  • bool banned: Returns users which are either banned (banned=true) or not banned (banned=false).

  • int lastActiveAtBefore: Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23.

  • int lastActiveAtAfter: Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23.

  • int lastActiveAtSince: Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of last_active_at_after.

  • int createdAtBefore: Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29.

  • int createdAtAfter: Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29.

  • int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with offset.

  • int offset: Skip the first offset results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with limit.

  • String orderBy: Allows to return users in a particular order. At the moment, you can order the returned users by their created_at,updated_at,email_address,web3wallet,first_name,last_name,phone_number,username,last_active_at,last_sign_in_at. In order to specify the direction, you can use the +/- symbols prepended in the property to order by. For example, if you want users to be returned in descending order according to their created_at property, you can use -created_at. If you don't use + or -, then + is implied. We only support one order_by parameter, and if multiple order_by parameters are provided, we will only keep the first one. For example, if you pass order_by=username&order_by=created_at, we will consider only the first order_by parameter, which is username. The created_at parameter will be ignored in this case.

Implementation

Future<List<User>?> getUserList({
  List<String>? emailAddress,
  List<String>? phoneNumber,
  List<String>? externalId,
  List<String>? username,
  List<String>? web3Wallet,
  List<String>? userId,
  List<String>? organizationId,
  String? query,
  String? emailAddressQuery,
  String? phoneNumberQuery,
  String? usernameQuery,
  String? nameQuery,
  bool? banned,
  int? lastActiveAtBefore,
  int? lastActiveAtAfter,
  int? lastActiveAtSince,
  int? createdAtBefore,
  int? createdAtAfter,
  int? limit,
  int? offset,
  String? orderBy,
}) async {
  final response = await getUserListWithHttpInfo(
    emailAddress: emailAddress,
    phoneNumber: phoneNumber,
    externalId: externalId,
    username: username,
    web3Wallet: web3Wallet,
    userId: userId,
    organizationId: organizationId,
    query: query,
    emailAddressQuery: emailAddressQuery,
    phoneNumberQuery: phoneNumberQuery,
    usernameQuery: usernameQuery,
    nameQuery: nameQuery,
    banned: banned,
    lastActiveAtBefore: lastActiveAtBefore,
    lastActiveAtAfter: lastActiveAtAfter,
    lastActiveAtSince: lastActiveAtSince,
    createdAtBefore: createdAtBefore,
    createdAtAfter: createdAtAfter,
    limit: limit,
    offset: offset,
    orderBy: orderBy,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty &&
      response.statusCode != HttpStatus.noContent) {
    final responseBody = await _decodeBodyBytes(response);
    return (await apiClient.deserializeAsync(responseBody, 'List<User>')
            as List)
        .cast<User>()
        .toList(growable: false);
  }
  return null;
}