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

# List all sub-accounts for a given account



## OpenAPI

````yaml /openapi-v2.json get /api/v2/account/sub-accounts/{username}/{bank_account_id}
openapi: 3.1.0
info:
  title: LedgerSync V2 API
  version: '2.0'
servers:
  - url: https://ledgersyncappv2.com
    description: Production
  - url: https://staging.ledgersyncappv2.com
    description: Sandbox
security: []
tags:
  - name: account-api
    description: Account REST APIs
  - name: password-api
    description: Password REST APIs
  - name: transaction-api
    description: Transaction REST APIs
  - name: phone-verification-api
    description: Phone Verification REST APIs
  - name: employee-api
    description: Employee REST APIs
  - name: client-api
    description: Client REST APIs
  - name: check-api
    description: Check REST APIs
  - name: accounting-ai-api
    description: AI rule suggestion endpoints for external accounting integrations
  - name: institution-api
    description: Institution REST APIs
  - name: statement-api
    description: Statement REST APIs
  - name: authentication-api
    description: Auth REST APIs
paths:
  /api/v2/account/sub-accounts/{username}/{bank_account_id}:
    get:
      tags:
        - account-api
      summary: List all sub-accounts for a given account
      operationId: listSubAccounts
      parameters:
        - name: username
          in: path
          required: true
          schema:
            type: string
        - name: bank_account_id
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: source
          in: query
          required: false
          schema:
            type: string
            enum:
              - DEFAULT
              - FINICITY
              - FDE
              - MX
        - name: Auth-Token
          in: header
          description: Authentication token provided during the authentication process
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A list of accounts for the given user
          content:
            '*/*':
              schema:
                type: string
        '400':
          description: Bad request.
          content:
            '*/*':
              schema:
                type: string
        '401':
          description: Unauthorized. Bad credentials or the authentication system is down
          content:
            '*/*':
              schema:
                type: string
        '404':
          description: Invalid bank account id / username
          content:
            '*/*':
              schema:
                type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.