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

# List all Ledgers

> Lists all of an Instance's Ledgers.



## OpenAPI

````yaml GET /v0/ledgers
openapi: 3.1.0
info:
  title: Teal API
  version: '0.1'
servers:
  - url: https://api.sandbox.teal.dev
    description: Sandbox
  - url: https://api.teal.dev
    description: Production
security: []
paths:
  /v0/ledgers:
    get:
      tags:
        - Ledgers
      summary: List all Ledgers
      description: Lists all of an Instance's Ledgers.
      operationId: get_ledgers_v0_ledgers_get
      parameters:
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/LedgerType'
              - type: 'null'
            description: Optional ledger type used for filtering.
            title: Type
          description: Optional ledger type used for filtering.
        - name: sub_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/LedgerSubType'
              - type: 'null'
            description: Optional ledger sub type used for filtering.
            title: Sub Type
          description: Optional ledger sub type used for filtering.
        - name: financial_account_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/FinancialAccountType'
              - type: 'null'
            description: Optional financial account type used for filtering.
            title: Financial Account Type
          description: Optional financial account type used for filtering.
        - name: debit_credit
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/DebitCredit'
              - type: 'null'
            description: Optional ledger debit/credit used for filtering.
            title: Debit Credit
          description: Optional ledger debit/credit used for filtering.
        - name: sort
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/LedgerSort'
              - type: 'null'
            description: A comma separated list of sort orders for the results.
            teal_explode: false
            title: Sort
          description: A comma separated list of sort orders for the results.
        - name: expand
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/LedgerExpandPath'
              - type: 'null'
            description: Comma-separated list of Ledger expand paths.
            teal_explode: false
            title: Expand
          description: Comma-separated list of Ledger expand paths.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            exclusiveMaximum: 1001
            description: The number of records to return. Max limit is 1000.
            default: 50
            title: Limit
          description: The number of records to return. Max limit is 1000.
        - name: page_token
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque page token
            title: Page Token
          description: Opaque page token
        - name: teal-instance-id
          in: header
          required: true
          schema:
            type: string
            description: The Teal instance ID
            title: Teal-Instance-Id
          description: The Teal instance ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerPage'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TealErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    LedgerType:
      type: string
      enum:
        - asset
        - liability
        - equity
        - revenue
        - expense
      title: LedgerType
    LedgerSubType:
      type: string
      enum:
        - current_assets
        - non-current_assets
        - transfers_between_accounts
        - uncategorized_assets
        - current_liabilities
        - non-current_liabilities
        - equity
        - operating_revenues
        - other_income
        - cost_of_goods_sold
        - operating_expenses
        - other_expenses
        - retained_earnings
      title: LedgerSubType
    FinancialAccountType:
      type: string
      enum:
        - bank_account
        - credit_card
        - payments
        - payroll
        - loan
        - prepaid_card
        - accounts_receivable
        - accounts_payable
        - treasury
        - investment
      title: FinancialAccountType
    DebitCredit:
      type: string
      enum:
        - debit
        - credit
      title: DebitCredit
    LedgerSort:
      type: string
      enum:
        - name
        - '-name'
        - type
        - '-type'
        - sub_type
        - '-sub_type'
        - debit_credit
        - '-debit_credit'
      title: LedgerSort
    LedgerExpandPath:
      type: string
      enum:
        - parent
        - parent.parent
        - details
      title: LedgerExpandPath
    LedgerPage:
      properties:
        next_page_token:
          anyOf:
            - type: string
            - type: 'null'
          description: The token to use to request the next page
          examples:
            - ikal0NEVfMhF8dJf4yQ6KQZmGD
        prev_page_token:
          anyOf:
            - type: string
            - type: 'null'
          description: The token to use to request the previous page
          examples:
            - vuA7JeKI5c6FLnPt5JfRcZcJxW
        records:
          items:
            $ref: '#/components/schemas/Ledger'
          type: array
          title: Records
          description: List of ledgers
          examples:
            - - created_at: '2024-01-01T00:00:00'
                debit_credit: debit
                editable: false
                financial_account_type: bank_account
                id: 7JRNsKwy2Lw66caxVU7WGC
                is_required: false
                name: Pluto Checking 4242
                report_cash_flow: true
                sort_code: '2240'
                sub_type: current_assets
                type: asset
      type: object
      required:
        - next_page_token
        - prev_page_token
        - records
      title: LedgerPage
    TealErrorResponse:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: A description of the error for API developers.
        data:
          title: Data
          description: Data associated with the error.
        display_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Message
          description: A description of the error for end users.
        error_code:
          anyOf:
            - $ref: '#/components/schemas/TealErrorCode'
            - type: 'null'
          description: Error code associated with the error.
      type: object
      required:
        - message
      title: TealErrorResponse
    Ledger:
      properties:
        id:
          type: string
          title: Id
          description: The unique ID of the object.
          examples:
            - 7JRNsKwy2Lw66caxVU7WGC
        name:
          type: string
          maxLength: 255
          title: Name
          description: The name of the ledger.
          examples:
            - Pluto Checking 4242
        debit_credit:
          $ref: '#/components/schemas/DebitCredit'
          description: Indicates if the ledger is a credit or debit ledger.
          examples:
            - debit
        editable:
          type: boolean
          title: Editable
          description: >-
            Whether line entries can be manually added or removed from the
            ledger.
          examples:
            - false
        financial_account_type:
          anyOf:
            - $ref: '#/components/schemas/FinancialAccountType'
            - type: 'null'
          description: Indicates that the ledger represents a real-world financial account.
          examples:
            - bank_account
        is_required:
          type: boolean
          title: Is Required
          description: >-
            Indicates that the ledger is one of the four system ledgers required
            for Teal to work. In the default chart of accounts, these are named
            one of: `Transfers Between Accounts`, `Opening Balance Retained
            Earnings`, `Uncategorized Cash Inflow`, `Uncategorized Cash
            Outflow`. You can update the names of these to fit your needs.
          examples:
            - false
        required_ledger_purpose:
          anyOf:
            - $ref: '#/components/schemas/SpecialLedgerType'
            - type: 'null'
          description: >-
            Required ledgers fulfill specific system functions and are necessary
            for the accounting system to operate.
          examples:
            - account_transfers
        parent:
          anyOf:
            - $ref: '#/components/schemas/Ledger'
            - type: 'null'
          description: >-
            Expandable. If the ledger is a child ledger, the parent ledger
            object.
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: If the ledger is a child Ledger, the ID of the parent ledger object.
          examples:
            - null
        report_cash_flow:
          type: boolean
          title: Report Cash Flow
          description: >-
            Whether or not this ledger is included in the cash flow report. For
            ledgers with a financial_account_type, this value is automatically
            determined and cannot be modified.
          examples:
            - false
        sort_code:
          type: string
          maxLength: 20
          title: Sort Code
          description: >-
            Determines the display order in reports, ordered digit by digit,
            starting from the leftmost position. For example, `20010` will come
            before `3050`.
          examples:
            - '1400'
        sub_type:
          $ref: '#/components/schemas/LedgerSubType'
          description: >-
            Indicates similar characteristics and accounting treatment for a
            group of ledgers within a `type`.
          examples:
            - current_assets
        type:
          $ref: '#/components/schemas/LedgerType'
          description: >-
            Indicates the purpose and location of the funds and value recorded
            in the ledger and which report it is included in: `asset`,
            `liability` and `equity` ledgers are displayed on the balance sheet;
            `revenue` and `expenses` are displayed on the income statement.
          examples:
            - asset
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The datetime when the ledger was created.
          examples:
            - '2024-01-01T00:00:00Z'
      type: object
      required:
        - id
        - name
        - debit_credit
        - editable
        - is_required
        - parent_id
        - report_cash_flow
        - sort_code
        - sub_type
        - type
        - created_at
      title: Ledger
    TealErrorCode:
      type: string
      enum:
        - invalid_date
        - invalid_ledger
        - missing_parameters
        - duplicate_name
        - duplicate_sort_code
        - invalid_ledger_type
        - invalid_ledger_report_cash_flow
        - deleting_required_ledger
        - repeated_tag_group
        - deleting_transaction_line
        - modifying_read_only_ledger
        - debits_credits_not_equal
        - modifying_datetime_opening_balance
        - modifying_accrual_journal_entry
        - modifying_payment_application_journal_entry
        - reconciliation_in_progress
        - reconciled_balance_does_not_match
        - journal_entry_outside_reconciliation_period
        - entries_start_date_after_transactions
        - entries_start_date_after_reconciliations
        - entries_start_date_after_journal_entries
      title: TealErrorCode
    SpecialLedgerType:
      type: string
      enum:
        - uncat_inflow
        - uncat_outflow
        - account_transfers
        - opening_balances
        - accounts_receivable
        - accounts_payable
        - wages_expense
        - bonus_expense
        - commissions_expense
        - contractor_expense
        - employee_reimbursements
        - severance_expense
        - payroll_tax_expense
        - employer_benefits_expense
        - health_insurance_expense
        - wages_payable
        - payroll_tax_payable
        - employee_benefit_liabilities
        - payroll_liabilities
      title: SpecialLedgerType
      description: Special ledgers are ledgers that have special behaviour in the system.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.
      flows:
        password:
          scopes: {}
          tokenUrl: https://developer.teal.dev

````