---
title: "Create a Ledger Template"
method: POST
path: "/agent-ledger-templates/{booksId}"
tags: ["Books"]
---

# Create a Ledger Template

`POST /agent-ledger-templates/{booksId}`

## Request

- Base URL: `https://api.mercury.com/api/v1`
- URL: `https://api.mercury.com/api/v1/agent-ledger-templates/{booksId}`
- Auth: one of:
  - HTTP bearer
  - HTTP basic

## Path parameters

- `booksId` string, uuid, required

## Request body

- CreateLedgerTemplateRequest: Request body for creating a ledger template
  - `coa_template_id` string, base58 (max length 22), required: The COA Template Id.
  - `debit_credit` 'debit' | 'credit', required: Indicates if the ledger is a credit or debit ledger.
  - `editable` boolean, required: Whether line entries can be manually added or removed from the ledger.
  - `financial_account_type` 'bank_account' | 'credit_card' | 'payments' | 'payroll' | 'loan' | 'prepaid_card' | 'accounts_receivable' | 'accounts_payable' | 'investment' | 'treasury', required: Indicates that the ledger represents a real-world financial account.
  - `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' | 'retained_earnings', required: Indicates similar characteristics and accounting treatment for a group of ledgers within a `type`.
  - `ledger_type` 'asset' | 'liability' | 'equity' | 'revenue' | 'expense', required: Indicates the purpose and location of the funds and value recorded in the ledger and which report it is included in: `asset`, `liability` and `equity` ledgers are displayed on the balance sheet; `revenue` and `expenses` are displayed on the income statement.
  - `name` string, required: The name of the ledger.
  - `parent_id` string, base58 (max length 22), nullable: If the ledger is a child Ledger, the ID of the parent ledger object.
  - `report_cash_flow` boolean, required: Whether Teal includes this ledger in the cash flow report.
  - `sort_code` string, required: Determines the display order in reports, ordered digit by digit,

## Response `200`

## Other responses

- `400`: Invalid `body`
- `404`: `booksId` not found

## Changes

- **2026-10-16** `ab652aa5aa8e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mercurytechnologies/apis/mercury-api/changes/agent-ledger-templates/:booksId/post.md)

---

[API](https://skmtc.dev/mercurytechnologies/apis/mercury-api.md) - [All operations](https://skmtc.dev/mercurytechnologies/apis/mercury-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mercurytechnologies/apis/mercury-api/revisions/ab652aa5aa8e?raw)
