Apply AI-generated COA

POST/api/v1/ledgers/apply-coa

Apply an AI-generated or custom chart of accounts template to the business, upserting over existing ledgers. Protected ledgers (system, required, bank-linked) are skipped. Existing custom ledgers not present in the template are deactivated.

Operation ID: apply_coa_api_v1_ledgers_apply_coa_post·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

ledgersarray · CustomCoaLedgerrequiredCustomCoaLedger

List of ledger definitions for the custom COA

9 fields
namestringrequired

Ledger name

typestringrequired

Ledger type: asset, liability, equity, revenue, expense

sub_typestringrequired

Ledger sub-type: 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

sort_codestringrequired

Numeric sort code for ordering (digits only, max 20 chars)

debit_creditstring

Debit/credit behavior: debit, credit. Optional - Teal auto-determines based on ledger type.

report_cash_flowboolean

Include in cash flow reports. Optional.

editableboolean

Whether line entries can be manually added or removed

descriptionstring

Ledger description

financial_account_typestring

Financial account type for Templated Mode. Options: bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable

Responses

201Successful Response

successboolean
messagestring
codestring
dataApplyCoaResponse

400Bad Request - Invalid input

401Unauthorized - Authentication required

403Forbidden - Insufficient permissions

422Validation Error

detailarray · ValidationErrorValidationError
5 fields
locarray · string | integerrequired
msgstringrequired
typestringrequired
inputobject
ctxobject