---
title: "Update a chart account"
method: PATCH
path: "/accounts/{accountId}"
tags: ["Accounting"]
---

# Update a chart account

`PATCH /accounts/{accountId}`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/accounts/{accountId}`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Updates code, name, subType, isActive, description, reportingRole, or type. type switches an asset, liability, or equity account among those three; a linked bank register follows (asset becomes checking, liability becomes a loan, or a card when subType is credit_card), the name suffix and subtype follow, and an incompatible reporting role is cleared. Revenue and expense keep their type (422 account_type_not_switchable). A register can't become equity (422 account_type_register_equity). Control accounts (409 account_type_control_account) and registers with a reconciliation in progress (409 account_type_reconciliation_in_progress) can't switch. Journal debits and credits never change.

## Path parameters

- `accountId` string, uuid, required

## Request body

- object
  - `code` string
  - `name` string
  - `subType` string, nullable
  - `isActive` boolean
  - `description` string, nullable
  - `reportingRole` string, nullable
  - `type` 'asset' | 'liability' | 'equity'

## Response `200`

The updated account

## Other responses

- `409`: Control account or reconciliation in progress
- `422`: Type can't switch
- `default`: Error response

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/9a8269f0a586?raw)
