> ## Documentation Index
> Fetch the complete documentation index at: https://docs.finsync.ar/llms.txt
> Use this file to discover all available pages before exploring further.

# Get clients with their accounts

> Retrieves a paginated list of clients with their associated accounts for the company



## OpenAPI

````yaml /openapi/openapi.json get /api/clients
openapi: 3.0.0
info:
  title: FinSync API Documentation
  version: 1.0.0
  description: API documentation for FinSync application
  contact:
    name: FinSync Support
    email: support@finsync.com
servers:
  - url: https://finsync.ar
    description: API server
security:
  - apiKey: []
tags:
  - name: Clients
    description: Operations related to clients and their accounts
  - name: Accounts
    description: Operations related to account balances
  - name: Operations
    description: Operations for creating and managing financial operations
  - name: Operation Types
    description: Company operation types management
  - name: Transaction Types
    description: Company transaction types management
  - name: Superadmin
    description: Cross-tenant operations (JWT + email allowlist)
  - name: External client
    description: >-
      Exports for external (portal-linked) clients. Authenticate with
      `x-api-key` (company-owned client ID) or `Authorization: Bearer` (Supabase
      access token with an ExternalClient invite).
paths:
  /api/clients:
    get:
      tags:
        - Clients
      summary: Get clients with their accounts
      description: >-
        Retrieves a paginated list of clients with their associated accounts for
        the company
      parameters:
        - in: query
          name: page
          schema:
            type: integer
            default: 1
          description: Page number for pagination
        - in: query
          name: pageSize
          schema:
            type: integer
            default: 10
          description: Number of items per page
        - in: query
          name: description
          schema:
            type: string
          description: Filter clients by description (case-insensitive partial match)
      responses:
        '200':
          description: Paginated list of clients with their accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Client ID
                        name:
                          type: string
                          description: Client name
                        description:
                          type: string
                          nullable: true
                          description: Client description
                        company_id:
                          type: integer
                          description: Company ID the client belongs to
                        type:
                          type: integer
                          description: Client type (0 = Internal, 1 = External)
                        created_at:
                          type: string
                          format: date-time
                          description: Creation timestamp
                        updated_at:
                          type: string
                          format: date-time
                          description: Last update timestamp
                        accounts:
                          type: array
                          description: List of accounts associated with this client
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                                description: Account ID
                              name:
                                type: string
                                description: Account name
                              currency_name:
                                type: string
                                description: Currency name
                              client_id:
                                type: integer
                                description: Client ID the account belongs to
                              balance:
                                type: number
                                description: Account balance
                              created_at:
                                type: string
                                format: date-time
                                description: Creation timestamp
                              updated_at:
                                type: string
                                format: date-time
                                description: Last update timestamp
                  count:
                    type: integer
                    description: Total count of clients matching the query
        '401':
          description: Unauthorized - Missing or invalid API key
        '500':
          description: Server error
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````