# GET /api/v1/ledgers

> List ledgers

- **Tag:** ledgers
- **Operation ID:** `get_ledgers_api_v1_ledgers_get`

## Description

Retrieve chart of accounts (ledgers) for the business.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `id` (query, array · string, optional) — Filter by specific ledger UUIDs
- `name` (query, string, optional) — Filter by ledger name (partial match)
- `type` (query, string, optional) — Filter by type: asset, liability, equity, revenue, expense
- `status` (query, string, optional) — Filter by status: active, inactive
- `cursor` (query, string, optional) — Cursor for pagination
- `limit` (query, integer, optional) — Pagination limit
- `direction` (query, string, optional) — Pagination direction: 'next' or 'prev'
- `include_total_count` (query, boolean, optional) — Whether to include total count (expensive - avoid if possible)
- `sort_by` (query, string, optional) — Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.
- `descending` (query, boolean, optional) — Sort direction: true for descending (newest/largest first), false for ascending

## Responses

### 200 — Successful Response

Schema: `LedgerListResponse`

- `items` (array · LedgerResponse · required) → `LedgerResponse` — List of items
  - `id` (string · required) — Ledger UUID.
  - `teal_ledger_id` (string) — Linked Teal accounting system ID.
  - `name` (string · required) — Account name.
  - `currency` (string) — Currency for this account (USD, CAD, AUD, EUR, or GBP).
  - `type` (string · required) — Account type: asset, liability, equity, revenue, expense.
  - `balance` (integer) — Current balance in cents (may be negative).
  - `parent_id` (string) — Parent ledger UUID for sub-accounts.
  - `description` (string) — Account description.
  - `status` (string) — Status: 'active' or 'inactive'.
  - `debit_credit` (string) — Normal balance: 'debit' or 'credit'.
  - `sort_code` (string) — Sort code for chart ordering.
  - `sub_type` (string) — Sub-classification for reporting.
  - `report_cash_flow` (boolean) — Whether included in cash flow statement.
  - `cash_flow_section` (CashFlowSectionEnum) — Cash flow statement section: 'operating', 'investing', 'financing', or 'excluded'.
  - `cfs_class` (CashFlowClassEnum) — Indirect-method cash flow classification used to populate the Statement of Cash Flows.
  - `editable` (boolean) — Whether journal entries can be manually posted to this account.
  - `financial_account_type` (string) — Template type if created in Templated Mode.
  - `is_required` (boolean) — True for system-required accounts that cannot be deleted.
  - `system_key` (string) — Immutable key for system/base ledgers (e.g. 'accounts_receivable'). Null for user-created ledgers.
  - `teal_account_link_id` (string) — UUID of the TealAccountLink if this ledger is connected to a bank/Plaid source account. Null for unlinked ledgers.
  - `business_id` (string) — Business UUID.
  - `created_at` (string · date-time) — Creation timestamp.
  - `updated_at` (string · date-time) — Last update timestamp.
- `total` (integer) — Total number of items (null when not calculated for performance)
- `limit` (integer) — Pagination limit
- `next_cursor` (string) — Cursor for next page
- `prev_cursor` (string) — Cursor for previous page
- `has_next` (boolean · required) — Whether there are more items
- `has_prev` (boolean · required) — Whether there are previous items

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/ledgers' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/ledgers', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.get("https://api.ondayzero.com/api/v1/ledgers", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/ledgers/get-ledgers
- OpenAPI slice: https://www.ondayzero.com/docs/reference/ledgers/get-ledgers/openapi.json
- Other endpoints in **ledgers**: https://www.ondayzero.com/docs/reference/ledgers
