---
title: "Insert a schema for a ledger"
method: POST
path: "/v2/{ledger}/schemas/{version}"
tags: ["ledger.v2"]
---

# Insert a schema for a ledger

`POST /v2/{ledger}/schemas/{version}`

## Headers

- `Idempotency-Key` string

## Request body

- V2SchemaData — Schema data structure for ledger schemas
  - `chart` V2ChartOfAccounts, required — Chart of account
  - `transactions` V2TransactionTemplates — Transaction templates
  - `queries` V2QueryTemplates — Query templates

## Response `204`

Schema inserted successfully

## Other responses

- `default` — Error

## Changes

- **2026-06-09** `5b3ac7d993a2` — 1 breaking, 2 info
  - removed `subschema #1, subschema #2, subschema #3, subschema #4` from the `queries/additionalProperties/params` request property `oneOf` list
  - added discriminator to `queries/additionalProperties/params` request property
  - added `subschema #1, subschema #2, subschema #3, subschema #4` to the `queries/additionalProperties/params` request property `oneOf` list
- **2026-03-25** `3ef3cb98f97a` — 1 breaking
  - the `queries/additionalProperties/params/sort` request property type/format changed from ``/`` to `string`/``
- **2026-02-23** `0f0824721b6e` — 1 info
  - the request property `transactions` became optional
- **2026-02-20** `c0620f81a649` — 1 info
  - added the new optional request property `queries`
- **2026-02-19** `58667a80ce17` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/formancehq/apis/ledger-api/changes/v2/:ledger/schemas/:version/post.md)

---

[API](https://skmtc.dev/formancehq/apis/ledger-api.md) · [All operations](https://skmtc.dev/formancehq/apis/ledger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/formancehq/ledger-api/revisions/fe945da1b75d/schema)
