# Retrieve all users with optional filters and pagination

Endpoint: GET /users
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Query parameters:

  - `search` (string)
    Search across firstName, lastName, and email

  - `role` (array)
    Filter by user role(s)

  - `isEnabled` (boolean, required)
    Filter by enabled status

  - `isAdmin` (boolean, required)
    Filter by admin status

  - `clientAccountId` (array)
    Filter by client account IDs

  - `organizationId` (array)
    Filter by organization IDs

  - `brandId` (array)
    Filter by brand IDs

  - `siteId` (array)
    Filter by site IDs

  - `onlyAcceptedTOS` (boolean, required)
    Accepted TOS

  - `page` (number)
    Page number (0-based)

  - `pageSize` (number)
    Number of items per page

  - `field` (string)
    Field to sort by

  - `sortBy[0][field]` (string)
    First sort field

  - `sortBy[0][dir]` (string)
    First sort direction

  - `sortBy[1][field]` (string)
    Second sort field

  - `sortBy[1][dir]` (string)
    Second sort direction

## Response 200:

  - `200` (unknown)
    List of users retrieved successfully.

## Response 200 fields (application/json):

  - `data` (array, required)
    Array of users

  - `data.id` (number, required)
    Unique identifier for the user
    Example: 1

  - `data.email` (string, required)
    Email address of the user
    Example: admin@admin.com

  - `data.firstName` (string, required)
    First name of the user
    Example: John

  - `data.lastName` (string, required)
    Last name of the user
    Example: Doe

  - `data.role` (string, required)
    Role of the user
    Enum: "ORGANIZATION_USER", "BRAND_USER", "SITE_USER", "CLIENT_ACCOUNT_USER", "SITE_MANAGER_USER"

  - `data.isEnabled` (boolean, required)
    Is the user enabled
    Example: true

  - `data.createdAt` (string, required)
    Creation date of the user
    Example: 2024-01-01T00:00:00.000Z

  - `data.updatedAt` (string, required)
    Last update date of the user
    Example: 2024-01-02T00:00:00.000Z

  - `data.userOrganizations` (array)
    Organizations associated with the user

  - `data.userBrands` (array)
    Brands associated with the user

  - `data.userSites` (array)
    Sites associated with the user

  - `data.userClientAccounts` (array)
    Client accounts associated with the user

  - `data.userClientAccounts.clientAccountId` (number, required)
    Client Account ID
    Example: 1

  - `data.userClientAccounts.clientAccount` (object, required)
    Client Account details

  - `data.userClientAccounts.ownedClientAccounts` (array)
    Client Accounts owned by this user (only present if user is owner)

  - `data.managedSites` (array)
    Sites associated with the user

  - `data.tosAcceptedAt` (string, required)
    Time stamp of the Terms of Services acceptance
    Example: 2024-01-02T00:00:00.000Z

  - `meta` (object, required)
    Pagination metadata

  - `meta.page` (number, required)
    Current page number (0-based)
    Example: 0

  - `meta.pageSize` (number, required)
    Number of items per page
    Example: 10

  - `meta.total` (number, required)
    Total number of items
    Example: 150

  - `meta.totalPages` (number, required)
    Total number of pages
    Example: 15

  - `meta.hasNext` (boolean, required)
    Whether there is a next page
    Example: true

  - `meta.hasPrevious` (boolean, required)
    Whether there is a previous page
    Example: false

## Response 400:

  - `400` (unknown)
    Bad request.

## Response 401:

  - `401` (unknown)
    Unauthorized: Invalid or missing token.

## Response 401 fields (application/json):

  - `message` (string, required)
    Error message indicating unauthorized access.
    Example: Unauthorized

  - `statusCode` (number, required)
    HTTP status code for unauthorized access.
    Example: 401

## Response 403:

  - `403` (unknown)
    Forbidden: You do not have the right permissions.

