PUT
/accounts/{accountId}Update an account
Update the specified account
Parameters
| Name | In | Type | Description |
|---|---|---|---|
accountIdrequired | path | string uuid | Account UUID |
Request bodyrequired
| Field | Type | Description |
|---|---|---|
parent_id | string uuid · nullable | Parent account UUID for hierarchical structure |
code | string min length: 4 · max length: 4 | 4-digit account code |
name | string max length: 255 | |
type | string enum: asset | liability | equity | revenue | expense | |
normal_balance | string enum: debit | credit | |
description | string max length: 1000 · nullable | |
is_active | boolean | |
metadata | object nullable | |
enforce_balance_limits | boolean | Enable trigger-enforced min/max balance limits |
min_balance | string nullable | Lower balance limit as a major-unit decimal string. Negative values are permitted for liability accounts. |
max_balance | string nullable | Upper balance limit as a major-unit decimal string. Must be >= min_balance. |
Responses
200Account updated successfully
{
"success": true,
"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"
}
} 400Validation error
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 401Unauthenticated
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 403Forbidden
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 404Account not found
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} Examples
curl -X PUT https://ledga.io/api/v1/accounts/{accountId} \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"name": "Cash - Updated",
"type": "asset",
"normal_balance": "debit",
"is_active": true,
"enforce_balance_limits": true,
"min_balance": "0.00",
"max_balance": "10000.00"
}' use Ledga\Api\LedgaClient;
$ledga = new LedgaClient('sk_xxxxxxxx_your_secret');
$account = $ledga->accounts->update('01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a', ['name' => 'Cash on hand']);