GET
/accountsList all accounts in a ledger
Cursor-paginated. tree=true returns the hierarchy unpaginated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
type | query | string enum: asset | liability | equity | revenue | expense | Filter by account type |
active | query | boolean | Filter by active status |
parent_id | query | string uuid | Filter by parent account UUID |
search | query | string | Search in code or name |
tree | query | boolean default: false | Return hierarchical tree structure (non-paginated) |
limit | query | integer default: 25 · max: 100 | Number of items per page (max 100) |
cursor | query | string | Cursor for pagination |
Responses
200Successful operation
{
"success": true,
"meta": {
"pagination": {
"limit": 25,
"has_more": true,
"next_cursor": "eyJpZCI6IjAxOWRjZjg3LTUwN2ItNzE5OS05ZTE1LWZhY2YxNjVlNzRjMSJ9"
}
},
"data": [
{
"id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
"ledger_id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
"code": "1000",
"name": "Cash",
"type": "asset",
"category": "system",
"normal_balance": "debit",
"balance": "1000.00",
"is_active": true,
"is_system": false,
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
]
} 401Unauthenticated
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 403Forbidden
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 404Ledger not found
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} Examples
curl https://ledga.io/api/v1/accounts \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret" use Ledga\Api\LedgaClient;
$ledga = new LedgaClient('sk_xxxxxxxx_your_secret');
$page = $ledga->accounts->list(['type' => 'asset', 'limit' => 25]);
foreach ($ledga->accounts->all() as $account) { /* every page */ }