# Retrieve all brands with optional filters

Endpoint: GET /brands
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Query parameters:

  - `userId` (number)
    Filter by related userId (via UserBrand relation)

  - `title` (string)
    The title of the brand

  - `organizationId` (array)
    The organizationId of the brand

  - `clientAccountId` (array)
    The clientAccountId of the brand

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

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

  - `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 brands retrieved successfully.

## Response 200 fields (application/json):

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

  - `data.id` (number, required)
    The ID of the brand to be updated
    Example: 456

  - `data.title` (string, required)
    The title of the brand
    Example: HealthCorp

  - `data.clientAccountId` (number, required)
    The client account id of the brand
    Example: 1

  - `data.clientAccount` (object, required)
    The client account of the brand

  - `data.clientAccount.id` (number, required)
    The ID of the client account
    Example: 123

  - `data.clientAccount.title` (string, required)
    The title of the client account
    Example: Downtown Clinic

  - `data.organization` (object, required)
    The organization the brand

  - `data.organization.id` (number)
    The ID of the organization the brand is associated with
    Example: 123

  - `data.organization.title` (string, required)
    The title of the organization the brand is associated with
    Example: HealthCorp

  - `data.organization.clientAccountId` (number)
    The ID of the client account the brand is associated with
    Example: 123

  - `data.organization.website` (string)
    The website of the organization the brand is associated with
    Example: www.healthcorp.com

  - `data.organization.isEnabled` (boolean, required)
    Indicates whether the organization is enabled
    Example: true

  - `data.organization.createdAt` (string, required)
    The date and time the brand was created
    Example: 2021-05-01T12:00:00Z

  - `data.organization.updatedAt` (string, required)
    The date and time the brand was last updated
    Example: 2021-05-01T12:00:00Z

  - `data.sites` (array, required)
    The sites associated with the brand

  - `data.sites.id` (number, required)
    The ID of the site the brand is associated with
    Example: 123

  - `data.sites.name` (string, required)
    The name of the site
    Example: Downtown Clinic

  - `data.sites.address` (object, required)
    The address information of the site

  - `data.sites.address.lat` (number, required)
    The latitude coordinate of the address
    Example: 37.7749

  - `data.sites.address.lng` (number, required)
    The longitude coordinate of the address
    Example: -122.4194

  - `data.sites.address.url` (string, required)
    The URL associated with the address
    Example: https://maps.google.com/?q=123+Main+St

  - `data.sites.address.formatted_address` (string, required)
    The formatted address string
    Example: 123 Main St, San Francisco, CA 94103

  - `data.sites.googlePlaceId` (string, required)
    The Google Place ID for the site
    Example: ChIJN1t_tDeuEmsRUsoyG83frY4

  - `data.sites.phoneNumber` (string)
    The phone number of the site
    Example: +1 (555) 123-4567

  - `data.sites.website` (string)
    The website of the site
    Example: https://downtownclinic.com

  - `data.sites.anyDeskIp` (string)
    The AnyDesk IP address for remote access
    Example: 192.168.1.100

  - `data.sites.createdByUserId` (number, required)
    The ID of the user who created the site
    Example: 456

  - `data.sites.createdAt` (string, required)
    The date and time the site was created
    Example: 2021-05-01T12:00:00Z

  - `data.sites.updatedAt` (string, required)
    The date and time the site was last updated
    Example: 2021-05-01T12:00:00Z

  - `data.sites.deletedAt` (string)
    The date and time the site was deleted, if applicable
    Example: null

  - `data.sites.organizationId` (number, required)
    The ID of the organization the site belongs to
    Example: 789

  - `data.sites.clientAccountId` (number, required)
    The ID of the client account the site is associated with
    Example: 101

  - `data.sites.brandId` (number, required)
    The ID of the brand the site is associated with
    Example: 202

  - `data.sites.practiceManagementSystemId` (number, required)
    The ID of the practice management system used by the site
    Example: 303

  - `data.sites.licenseKey` (string, required)
    The license key for the site
    Example: XXX-YYY-ZZZ-AAA-BBB

  - `data.sites.fhirStoreId` (string, required)
    The ID of the FHIR store associated with the site
    Example: fhir-store-123

  - `data.sites.firstSyncDate` (string)
    The date of the first sync with the site
    Example: 2021-05-15T12:00:00Z

  - `data.sites.latestSyncDate` (string)
    The date of the most recent sync with the site
    Example: 2021-06-01T12:00:00Z

  - `data.sites.siteManagerUserId` (number, required)
    The ID of the user who manages the site
    Example: 505

  - `data.sites.cloudUserName` (string)
    The cloud username for the site
    Example: downtown.clinic

  - `data.sites.cloudOrganizationName` (string)
    The name of the cloud organization for the site
    Example: HealthCorp Cloud

  - `data.sites.cloudLoginUrl` (string)
    The URL for cloud login
    Example: https://cloud.healthcorp.com/login

  - `data.sites.practiceManagementSystem` (object, required)
    The practice management system used by the site

  - `data.sites.practiceManagementSystem.id` (number, required)
    The ID of the practice management system
    Example: 789

  - `data.sites.practiceManagementSystem.title` (string, required)
    The title of the practice management system
    Example: MedicalSoft Pro

  - `data.sites.practiceManagementSystem.isCloudBased` (boolean, required)
    Indicates whether the system is cloud-based
    Example: true

  - `data.sites.practiceManagementSystem.isEnabled` (boolean, required)
    Indicates whether the system is enabled
    Example: true

  - `data.sites.practiceManagementSystem.createdAt` (string, required)
    The date and time the system was created
    Example: 2021-05-01T12:00:00Z

  - `data.sites.practiceManagementSystem.updatedAt` (string, required)
    The date and time the system was last updated
    Example: 2021-05-01T12:00:00Z

  - `data.isEnabled` (boolean, required)
    Indicates whether the brand is enabled
    Example: true

  - `data.createdAt` (string, required)
    The date and time the brand was created
    Example: 2021-05-01T12:00:00Z

  - `data.updatedAt` (string, required)
    The date and time the brand was last updated
    Example: 2021-05-01T12:00:00Z

  - `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 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: Access denied due to unaccepted Terms or insufficient permissions.

## Response 403 fields (application/json):

  - `statusCode` (number, required)
    HTTP status code indicating forbidden access due to unaccepted Terms of Service.
    Example: 403

  - `message` (string, required)
    Human-readable explanation of the error.
    Example: User must accept Terms of Service before continuing

  - `reason` (string, required)
    Machine-readable reason code for the error.
    Example: tos_required

  - `termsOfServicesLink` (string, required)
    URL to the Terms of Service the user must accept.
    Example: https://heydonto.com/terms-of-use/

  - `timestamp` (string, required)
    Timestamp when the error occurred (ISO 8601).
    Example: 2025-01-01T00:00:00.000Z

  - `statusCode` (number, required)
    HTTP status code indicating forbidden access.
    Example: 403

