{
  "components": {
    "headers": {
      "BoringBooks-Mode": {
        "description": "`live` when the token acts in a company's real books, `test` when it acts in a sandbox. Present on every response to an authenticated request.",
        "schema": {
          "example": "live",
          "type": "string"
        },
        "style": "simple"
      }
    },
    "schemas": {
      "Action": {
        "description": "One thing the caller may do next to a resource, filtered to what its own permissions and the resource's current state allow. A renderer draws its own control from `label` and `style`; it does not need to know the resource's status or the caller's role to decide whether to show it — an absent action means the caller may not take it right now.",
        "properties": {
          "command": {
            "description": "The catalog command name this action calls, e.g. \"approve_journal\".",
            "type": "string"
          },
          "id": {
            "description": "A short, stable identifier for this action, e.g. \"approve\", \"edit\", \"dismiss\", \"submit\", \"discard\". The set is additive; treat an unrecognized value as unsupported rather than an error.",
            "type": "string"
          },
          "input": {
            "additionalProperties": true,
            "description": "The input fields this action already knows, such as the resource's `id`. Merge in whatever `requires` names before calling `command`.",
            "type": "object"
          },
          "label": {
            "description": "A short label for this action, e.g. \"Approve and post\".",
            "type": "string"
          },
          "requires": {
            "description": "Names of additional input fields the caller must collect from the user before calling `command`, e.g. [\"reason\"]. Empty when `input` is already the whole call.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "style": {
            "description": "A rendering hint, \"primary\" or \"secondary\". The set is additive.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "style",
          "command",
          "input",
          "requires"
        ],
        "title": "Action",
        "type": "object"
      },
      "Amount": {
        "description": "A monetary amount as a decimal string, fixed to the currency's scale — two fraction digits for most supported currencies, none for JPY, e.g. \"1000.00\" or \"1000\" for JPY. Never a JSON number. Report figures may be negative; a journal line's `debit` and `credit` are always non-negative, with \"0.00\" (\"0\" for JPY) on the side the line is not on.",
        "example": "1000.00",
        "title": "Amount",
        "type": "string"
      },
      "AmountInput": {
        "description": "An unsigned decimal magnitude as a string, greater than zero, in plain notation: digits with an optional fractional part, and no sign, exponent, or separators. \"100\" and \"100.0\" are accepted and normalized to the currency's scale (\"100.00\" for most currencies, \"100\" for JPY); more precision than the currency admits (\"100.005\" for USD, \"100.5\" for JPY) is rejected, never rounded.",
        "example": "100.00",
        "title": "AmountInput",
        "type": "string"
      },
      "Currency": {
        "description": "An ISO 4217 alphabetic currency code — a ledger's own functional currency. The supported set is additive, so do not treat it as closed.",
        "example": "USD",
        "title": "Currency",
        "type": "string"
      },
      "CurrencyInput": {
        "description": "An ISO 4217 alphabetic currency code from the supported set. It must be the target ledger's functional currency: a different supported currency is refused with `foreign_currency_not_supported`, and a currency outside the supported set is rejected outright. The supported set is additive and may grow.",
        "enum": [
          "AUD",
          "CAD",
          "CHF",
          "EUR",
          "GBP",
          "JPY",
          "USD"
        ],
        "example": "USD",
        "title": "CurrencyInput",
        "type": "string"
      },
      "ErrorResponse": {
        "description": "Every error response carries a single `error` object. Branch on `type`; `code` refines it. `details` is contextual and not part of the contract.",
        "properties": {
          "error": {
            "properties": {
              "code": {
                "description": "The refining code. Additive: a new code under an existing `type` is not a breaking change.\n\n| code | type | status | meaning |\n|---|---|---|---|\n| `invalid_api_key` | `authentication_error` | 401 | The bearer token is missing, malformed, unknown, expired, or revoked. Every case is answered identically so nothing about which check failed leaks. |\n| `insufficient_permission` | `authorization_error` | 403 | The authenticated principal lacks the permission the operation requires. `details.permission` names it. |\n| `approval_policy_denied` | `authorization_error` | 403 | The command is well-formed and permitted, but an approval policy refused it — for example, the proposer of a journal may not approve it. |\n| `invalid_input` | `validation_error` | 400 | The request body failed validation: a missing or mistyped field, a value out of range, an unparseable cursor or timestamp, an unrecognized currency, an account or dimension the ledger does not hold, a posting date no fiscal period covers. When more than one field is at fault, `details.fields` lists each as `{name, message}`, carrying its own `details` — a line number, say — where it has any. |\n| `malformed_request` | `validation_error` | 400 | The framework rejected the request before the operation ran: a body that is not valid JSON, an unsupported `Content-Type`, a payload over the size limit. The status is the framework's own (400, 413, 415), and the request will not succeed on retry unchanged. |\n| `resource_not_found` | `not_found` | 404 | An id in the request does not resolve for the acting tenant — a resource that belongs to another tenant is reported the same way. `details.resource` names the kind and `details.id` echoes the id. Also returned for an unknown operation name. |\n| `business_rule_violation` | `business_rule_violation` | 422 | The request is structurally valid but violates an accounting rule that has no more specific code. `details.reason` carries the internal rule name, which is not part of the contract. |\n| `transaction_does_not_balance` | `business_rule_violation` | 422 | A journal's lines do not sum to zero in some currency. `details.currency`, `details.delta` (the signed residual), and `details.amount_field` say where. |\n| `account_inactive` | `business_rule_violation` | 422 | A journal line references an account that has been archived. Reactivate it with `reactivate_account` or post to a different account. |\n| `period_closed` | `business_rule_violation` | 422 | The posting date falls in a closed accounting period. A closed period can be reopened by an authorized principal. |\n| `period_locked` | `business_rule_violation` | 422 | The posting date falls in a locked accounting period. A locked period cannot be reopened; the entry must go to the current open period. |\n| `foreign_currency_not_supported` | `business_rule_violation` | 422 | The journal names a supported currency other than the ledger's functional currency. The ledger records only its own currency until multi-currency support lands. `details.currency` and `details.functional_currency` say which. |\n| `reversal_predates_original` | `business_rule_violation` | 422 | The reversal's `posting_date` falls before the posting date of the journal it reverses, so it would correct a period the original never touched. `details.original_posting_date` is the earliest date the reversal may take. |\n| `resource_conflict` | `conflict` | 409 | The target is not in the state the command requires — posting a journal that is not a draft, reopening a period that is not closed. `details.expected` and `details.actual` say which. |\n| `idempotency_conflict` | `conflict` | 409 | The `Idempotency-Key` was already spent by a different command, or a concurrent request carrying the same key is still in flight. |\n| `rate_limit_exceeded` | `rate_limited` | 429 | Too many requests. Retry after the delay in the `Retry-After` header. |\n| `internal_error` | `internal_error` | 500 | An unexpected server-side fault. The response carries only `details.incident_id`; no internal detail is echoed. Safe to retry with backoff. |\n| `server_overloaded` | `service_unavailable` | 503 | The server is at capacity and shed the request before running it. Nothing was executed. Retry after the delay in the `Retry-After` header. |",
                "type": "string"
              },
              "details": {
                "additionalProperties": true,
                "description": "Contextual particulars. Keys vary by code and are not part of the contract.",
                "type": "object"
              },
              "message": {
                "description": "A human-readable summary. Not machine-stable.",
                "type": "string"
              },
              "type": {
                "description": "The error category. A closed set; adding a value is a breaking change.",
                "enum": [
                  "authentication_error",
                  "authorization_error",
                  "validation_error",
                  "not_found",
                  "business_rule_violation",
                  "conflict",
                  "rate_limited",
                  "internal_error",
                  "service_unavailable"
                ],
                "type": "string"
              }
            },
            "required": [
              "type",
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "An API token, sent as `Authorization: Bearer bb_…` (`test_bb_…` for a sandbox).",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth2": {
        "description": "Authorization Code with PKCE (RFC 7636): a human approves once, delegating access to an agent. See `GET /.well-known/oauth-authorization-server`.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/oauth/authorize",
            "refreshUrl": "/oauth/token",
            "scopes": {
              "api": "Full access to the connected tenant's accounting data."
            },
            "tokenUrl": "/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "The BoringBooks accounting API is a catalog of **commands** (`POST /api/v1/commands/<name>`)\nthat change the ledger and **queries** (`POST /api/v1/queries/<name>`) that read it. Every\nrequest and response is JSON; every request carries `Authorization: Bearer bb_…` — see\nGetting a token below.\n\nMost operations act on one ledger and take its `ledger_id`. Start with the `tenant` query,\nwhich says which company your token acts in and whether it is a sandbox, then the `ledgers`\nquery, which lists the ledgers your token can reach.\n\nA company with more than one entity needs every request to say which one it acts for:\nsend the entity's id, from the `ledgers` query's `entity.id`, in a `BoringBooks-Entity`\nheader. Without it such a request is refused (`validation_error` / `invalid_input`); an id\nthat is not one of the company's entities is `not_found`. A company with a single entity\nneeds no header.\n\nThis document is the contract for the two things most expensive to change later: how money\nis represented, and which date means what.\n\n**For AI agents:** this reference is also published as Markdown. [`/llms.txt`](/llms.txt)\nindexes every operation, [`/llms-full.txt`](/llms-full.txt) holds the whole reference in\none file, and each operation has its own page at `/docs/commands/<name>.md` or\n`/docs/queries/<name>.md`.\n\n## Getting a token\n\nAPI access is delegated: a person signs in, picks the company to connect, and approves an\nagent — or the BoringBooks CLI — to act for them there. Tokens are issued over OAuth 2.1\nAuthorization Code with PKCE, so there is no API key to create and no client secret to\nhold.\n\n- **With the BoringBooks CLI.** It runs the flow and keeps the token fresh; it is one file\n  and needs Node.js 18 or later. Download it from this server's `/cli/bb.mjs`, then:\n\n      node bb.mjs login\n\n  and send each request with the access token `node bb.mjs token` prints. `login\n  --paste` covers a person whose browser is on another machine.\n- **By hand.** Send the person to `GET /oauth/authorize` with `client_id=boringbooks-cli`\n  and an S256 `code_challenge`, then exchange the returned code at `POST /oauth/token`.\n  The step-by-step flow is in the Authentication section of\n  [`/llms-full.txt`](/llms-full.txt), and\n  `GET /.well-known/oauth-authorization-server` describes the endpoints machine-readably.\n- **Lifetimes.** An access token (`bb_…`) lasts one hour. Refresh it with the\n  `bbr_…` refresh token, which rotates on every use and stays valid for 30 days from its\n  last use, 90 days at most.\n- **What a token may do.** A token acts as a delegated agent: it reads what its role\n  allows and can draft and submit journals, but never approve or post them —\n  `approve_journal` answers `403`.\n- **Revoking.** `POST /oauth/revoke` revokes a token or refresh token; a person can also\n  disconnect an agent from the connected-agents page in the web app.\n\n## Sandboxes\n\nA sandbox is a company for test data. Every account starts with one, and a person can\ncreate more in the web app. Connect an agent to a sandbox by picking it on the approval\nscreen, where it is marked **Sandbox**. Nothing it does there touches real books.\n\n- **Telling them apart.** A sandbox's tokens start with `test_bb_` and `test_bbr_`\n  instead of `bb_` and `bbr_`. Every response to an authenticated request carries a\n  `BoringBooks-Mode` header, `live` or `test`, and the `tenant` query returns the same\n  value as `mode`. Trust the header or the query rather than the prefix.\n- **Same rules.** A sandbox behaves exactly like a live company: the same operations,\n  validation, rate limits, and journal approval. Anything that works in a sandbox works\n  the same way in a live company.\n- **Permanent.** A company's mode is fixed when it is created. A sandbox never becomes a\n  live company, and its entries never move into one.\n\n## Monetary amounts\n\n- Every monetary value is a **JSON string** holding a base-10 decimal — `\"1000.00\"`,\n  `\"-42.50\"`, `\"0.00\"`. Never a JSON number: binary floating point cannot represent\n  `0.10`, and a ledger cannot afford the drift.\n- **Scale is fixed by the currency.** Most supported currencies carry **exactly two**\n  fraction digits, on input and on output; JPY carries **none**. On input, `\"100\"` and\n  `\"100.0\"` are accepted and normalized to the currency's scale (`\"100.00\"`, or `\"100\"`\n  for JPY); more precision than the currency admits (`\"100.005\"` for USD, `\"100.5\"` for\n  JPY) is **rejected** (`validation_error` / `invalid_input`) — never rounded.\n- **No implicit rounding.** The API does not round a value you send to make it fit. Any\n  rounding of a *computed* figure — a report total — is half away from zero, and applies\n  only where a sum could carry more precision than its currency admits.\n- **Sign.**\n  - A journal line on **input** carries an unsigned `amount` (greater than zero) plus a\n    `side` of `\"debit\"` or `\"credit\"`.\n  - A journal or ledger line on **output** carries `debit` and `credit`, each\n    non-negative, with `\"0.00\"` on the side the line is not on.\n  - **Report figures** read in their natural direction: assets, liabilities, equity,\n    revenue, and expenses are positive, and a figure is negative only where the statement\n    itself shows one — a net loss, a contra account, an overdrawn balance. The trial\n    balance's `closing_net` and the balance sheet agree in sign for the same account.\n- An amount must be smaller than 10^22 in magnitude; a larger value is rejected.\n\n## Currency\n\n- Each ledger records **one** currency: its entity's functional currency, chosen when\n  the entity is set up and fixed once the entity has any journal. This is not\n  multi-currency — a ledger never holds amounts in more than one currency, and every\n  monetary request and response carries that single `currency` at the top level of the\n  body (a journal's header, a report's result) rather than repeated per line or per row.\n- The supported set is exactly seven codes today: `AUD`, `CAD`, `CHF`, `EUR`, `GBP`,\n  `JPY`, `USD`. The request schema (`CurrencyInput`) declares this set as an enum. A code\n  outside it is **rejected** at the boundary (`validation_error` / `invalid_input`).\n- On a journal, `currency` is **optional** and defaults to the ledger's functional\n  currency. A request naming a *different* currency from that set — one that is\n  supported but not this ledger's — is **rejected** (`business_rule_violation` /\n  `foreign_currency_not_supported`); an unsupported code is still the `invalid_input`\n  case above. The two are distinguishable by their HTTP status: `400` for a malformed\n  request, `422` for a well-formed one this ledger cannot honor.\n- A response's `currency` names the ledger's own currency. The response schema\n  (`Currency`) is a plain string and deliberately does not declare a set: the supported\n  set is additive, so a client must not treat what it receives here as closed — see\n  Compatibility below.\n\n## Dates and times\n\nThere are two kinds of temporal value, and they are not interchangeable.\n\n- **Accounting dates** — a journal's `posting_date`, a period's `start_date` and\n  `end_date` — are calendar dates, `YYYY-MM-DD`, with **no time and no timezone**. A\n  journal's `posting_date` is the date it becomes effective in the ledger and is the only\n  input to which fiscal period it belongs to (`start_date <= posting_date <= end_date`,\n  both bounds inclusive — January is `2026-01-01` to `2026-01-31`). You choose it; it is\n  never inferred from the current time, and a future date in an open period is allowed.\n- **Report dates** — `from_date`, `to_date`, and `as_of_date` on `income_statement`,\n  `balance_sheet`, and `trial_balance` — are accounting dates too, and **inclusive** on both\n  ends: `from_date` and `to_date` both count, and `as_of_date` includes that day's\n  postings. A report can cover a full year, a single day, or stop part-way through a\n  period. A range that ends before it starts is rejected (`validation_error` /\n  `invalid_input`).\n- **System timestamps** — `submitted_at`, `expires_at`, an audit entry's `at` — are\n  **RFC 3339, UTC, with a `Z` offset**, at second precision (`2026-09-08T14:03:22Z`).\n  Output is always UTC. On input, an explicit offset is required; a timestamp with no\n  offset is rejected.\n\nA journal has exactly one `posting_date`, and every line inherits it. Only journals are\naccounting-dated: every other command takes effect when it is accepted, and is recorded\nwith a system timestamp in the audit trail. Posting into a closed period fails\n(`period_closed`); into a locked period, permanently (`period_locked`); into a date no\nperiod covers (`invalid_input`).\n\n## Errors\n\nEvery error response is a single `error` object — `type`, `code`, `message`, and a\ncontextual `details` that is not part of the contract. The `ErrorResponse` schema lists\nevery `type`/`code` pair and its status. Each part has one job:\n\n- **Decide with `type` and `code`.** Branch on `type` (a closed set); `code` refines it.\n- **Show `message`.** One or two sentences written for a person: what went wrong, naming\n  accounts by code and name and periods by their dates, and what to do about it. A command\n  that is the fix is named in backticks, like `reopen_period`. An agent can pass the\n  message to its human as it stands. Its wording is not stable, so never parse it.\n- **Act on `details`.** The values a next call needs, under the names the rest of the API\n  uses — `account_id`, `period_id`, `line_no`, `journal_ids` — so a client never has to\n  pull an id out of the message.\n\n```json\n{\"error\": {\n  \"type\": \"business_rule_violation\",\n  \"code\": \"period_closed\",\n  \"message\": \"January 2026 (2026-01-01 to 2026-01-31) is closed, so nothing can post into it. Date the entry in an open period, or reopen the period with `reopen_period` first.\",\n  \"details\": {\"period_id\": \"d821fd35-2ffd-4c47-8668-09c3758b8a85\", \"period_start\": \"2026-01-01\", \"period_end\": \"2026-01-31\", \"status\": \"closed\", \"reason\": \"period_not_open\"}\n}}\n```\n\n## Rate limits\n\nEach tenant has two request budgets, one for commands and one for queries, so heavy\nreading never blocks posting. Every API token of a tenant draws on the same budgets. A\nrequest over its budget is refused with `429` (`rate_limited` / `rate_limit_exceeded`).\nOnce one address fails authentication too often, requests from it are refused the same\nway until the window passes, unless their token has made a successful request within\nthe last minute.\n\nWhen the server is at capacity, it sheds requests with `503` (`service_unavailable` /\n`server_overloaded`).\n\nBoth responses carry a `Retry-After` header in whole seconds, and both are sent before\nthe operation runs, so retrying after the delay is safe for a command too. Wait at least\n`Retry-After` before retrying, and back off further if the refusals continue.\n\n## Idempotency\n\nA command may carry an `Idempotency-Key` header so a retry cannot run it twice. Queries\nignore the header.\n\n- **Key format.** A UUID in its canonical 36-character form,\n  `3f7c1e28-9a4b-4d5e-8c02-6b1f9a3d7e54`. Anything else is rejected (`validation_error` /\n  `invalid_input`). Generate one key per *intent*, not per attempt: sending the same value\n  on every retry of one call is what makes the retry safe.\n- **Scope.** A key is namespaced to your organization, and belongs to exactly one command\n  and one request body.\n- **Replay.** Once a command has committed under a key, that key replays the original\n  result and events for **at least 24 hours**, without running the command again. A replay\n  is not always byte-identical to the first response: a value a command discloses exactly\n  once is absent from it. Every such field says so in its schema description. A replay confirms the command ran; it is not a\n  second chance to read a secret.\n- **A failed command does not consume its key.** A command's writes and its audit record\n  commit in one transaction, so a failure leaves nothing behind and a retry with the same\n  key runs the command again. This is deliberate: a retry of a command that failed with\n  `period_closed` succeeds once the period is reopened.\n- **Reuse with a different request.** A key already spent by a *different command* is a\n  `conflict` (`idempotency_conflict`). Reusing one against the same command with a\n  *different body* is a client error that the API does not yet detect in every case, and\n  may replay the original result instead — do not rely on that, it will become an\n  `idempotency_conflict`.\n- **Concurrent duplicates.** Two requests carrying one key resolve to a single execution:\n  one commits and the other replays it. Neither runs the command twice.\n- **A conflict is permanent.** A key is spent once and stays spent, so retrying an\n  `idempotency_conflict` with the same key can never succeed. Query the ledger to see\n  whether the call you meant has already taken effect; if it has not, send it under a new\n  key.\n\n## Compatibility\n\n`/api/v1` is the compatibility contract: the path segment changes only for a change that\ncannot be made additively. The OpenAPI document's `info.version` identifies the build that\nproduced the document, not the API.\n\n**Added at any time, without notice:**\n\n- a field on a response\n- an optional field on a request\n- a command, a query, or an error `code`\n- a key under an error's `details`\n\n**So a client must:**\n\n- **Ignore response fields it does not recognize.** Do not treat the published set as\n  closed and do not fail on an unexpected member. Response schemas in this document never\n  close their property set, so a client generated from it already tolerates one.\n- **Branch on an error's `type`, not on its `code`.** `type` is a closed set and is\n  declared as an enum; `code` refines it, grows over time, and is declared as a plain\n  string for exactly that reason. An unrecognized `code` falls back to its `type`.\n- **Treat `message` and `details` as diagnostics.** Neither is machine-stable.\n\n**Requests are strict, and deliberately so.** An unknown field in a request body is\nrejected (`validation_error` / `invalid_input`) rather than ignored. A misspelled field\nname is a value that would otherwise be dropped silently — in a ledger, an amount or a\ndate that never arrived — so the request is refused instead of quietly reinterpreted.\nTolerating what you do not recognize is a rule for reading responses; it is not how this\nAPI reads requests.\n\n**Not done inside `/v1`:**\n\n- removing or renaming a response field, a command, a query, or an error `type`\n- changing the type, format, or meaning of an existing field\n- adding a required request field, or narrowing what an existing one accepts\n- adding a value to `type`, or to any enum a response is documented to return\n\nWhat `/v1` publishes stays in `/v1`. Where a shape turns out to be wrong, the replacement\nis added beside it and the original is marked deprecated rather than removed. The single\nreservation is a change compelled by a security or legal obligation, made with as much\nnotice as that obligation allows.\n\n**Deprecation is signalled in the document.** A deprecated operation or field carries\n`deprecated: true`, and its description names what replaces it. A deprecated thing keeps\nworking for the life of `/v1` — the marking says what will not carry into a later major\nversion, not what is about to disappear. A generated client surfaces these as deprecation\nwarnings, so diffing the published document is enough to find them.\n",
    "title": "BoringBooks API",
    "version": "0.1.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/api/v1/commands/apply_chart_template": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "apply_chart_template",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "template": "minimal"
                },
                "properties": {
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "template": {
                    "enum": [
                      "minimal"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "template"
                ],
                "title": "ApplyChartTemplateInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "ledger_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "ledger_id",
                    "count"
                  ],
                  "title": "ApplyChartTemplateResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Apply chart template",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/approve_journal": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "approve_journal",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "ApproveJournalInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "ApproveJournalResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Approve journal",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/archive_account": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "archive_account",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "22222222-2222-4222-8222-222222222222"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "ArchiveAccountInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "active"
                  ],
                  "title": "ArchiveAccountResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Archive account",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/close_period": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "close_period",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "period_id": "55555555-5555-4555-8555-555555555555",
                  "retained_earnings_account_id": "88888888-8888-4888-8888-888888888888"
                },
                "properties": {
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "period_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "retained_earnings_account_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "period_id",
                  "retained_earnings_account_id"
                ],
                "title": "ClosePeriodInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "journal_id": {
                      "format": "uuid",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "title": "ClosePeriodResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Close period",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/create_account": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "create_account",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "code": "1000",
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "name": "Cash",
                  "type": "asset"
                },
                "properties": {
                  "code": {
                    "description": "Account code, unique per ledger",
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  },
                  "contra": {
                    "default": false,
                    "description": "Balance runs against the type's normal side",
                    "type": "boolean"
                  },
                  "ledger_id": {
                    "description": "External id of the ledger this account belongs to",
                    "format": "uuid",
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  },
                  "postable": {
                    "default": true,
                    "description": "A leaf that journals may post to",
                    "type": "boolean"
                  },
                  "type": {
                    "description": "One of the five account types",
                    "enum": [
                      "asset",
                      "liability",
                      "equity",
                      "revenue",
                      "expense"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "code",
                  "name",
                  "type"
                ],
                "title": "CreateAccountInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "id": {
                      "description": "External id of the new account",
                      "format": "uuid",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "code",
                    "name",
                    "type"
                  ],
                  "title": "CreateAccountResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Create account",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/create_dimension_definition": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "create_dimension_definition",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "key": "department",
                  "ledger_id": "11111111-1111-4111-8111-111111111111"
                },
                "properties": {
                  "key": {
                    "description": "The dimension's name, unique within the ledger, with no leading or trailing spaces",
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  },
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "value_policy": {
                    "additionalProperties": false,
                    "description": "The values a line may carry for this dimension, as `{\"values\": [\"sales\", \"ops\"]}`. Omit it, or send `null`, to accept any value.",
                    "nullable": true,
                    "properties": {
                      "values": {
                        "description": "Distinct values with no leading or trailing spaces",
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "minItems": 1,
                        "type": "array"
                      }
                    },
                    "required": [
                      "values"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "ledger_id",
                  "key"
                ],
                "title": "CreateDimensionDefinitionInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "key"
                  ],
                  "title": "CreateDimensionDefinitionResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Create dimension definition",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/create_draft_journal": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "create_draft_journal",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "description": "Owner's initial investment",
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "lines": [
                    {
                      "account_id": "22222222-2222-4222-8222-222222222222",
                      "amount": "1000.00",
                      "side": "debit"
                    },
                    {
                      "account_id": "33333333-3333-4333-8333-333333333333",
                      "amount": "1000.00",
                      "side": "credit"
                    }
                  ],
                  "posting_date": "2026-01-15"
                },
                "properties": {
                  "currency": {
                    "$ref": "#/components/schemas/CurrencyInput"
                  },
                  "description": {
                    "maxLength": 4000,
                    "nullable": true,
                    "type": "string"
                  },
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "lines": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "account_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "amount": {
                          "$ref": "#/components/schemas/AmountInput"
                        },
                        "dimensions": {
                          "additionalProperties": true,
                          "nullable": true,
                          "type": "object"
                        },
                        "memo": {
                          "maxLength": 4000,
                          "nullable": true,
                          "type": "string"
                        },
                        "side": {
                          "enum": [
                            "debit",
                            "credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount"
                      ],
                      "type": "object"
                    },
                    "maxItems": 100,
                    "minItems": 1,
                    "type": "array"
                  },
                  "posting_date": {
                    "format": "date",
                    "type": "string"
                  },
                  "proposal_kind": {
                    "default": "manual",
                    "description": "Where the proposal came from, as a short lowercase label: `manual` (the default), or your own, such as `import` or `bank_feed`. `system` is reserved for the journals the ledger writes itself, closing entries and reversals.",
                    "maxLength": 64,
                    "pattern": "^[a-z][a-z0-9_]*$",
                    "type": "string"
                  },
                  "rationale": {
                    "maxLength": 4000,
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "posting_date",
                  "lines"
                ],
                "title": "CreateDraftJournalInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "CreateDraftJournalResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Create draft journal",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/create_fiscal_year": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "create_fiscal_year",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "year": 2026
                },
                "properties": {
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "year": {
                    "maximum": 9999,
                    "minimum": 1970,
                    "type": "integer"
                  }
                },
                "required": [
                  "ledger_id",
                  "year"
                ],
                "title": "CreateFiscalYearInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "year",
                    "count"
                  ],
                  "title": "CreateFiscalYearResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Create fiscal year",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/discard_draft": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "discard_draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "DiscardDraftInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "DiscardDraftResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Discard draft",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/lock_period": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "lock_period",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "55555555-5555-4555-8555-555555555555"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "LockPeriodInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "LockPeriodResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Lock period",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/post_journal": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "post_journal",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "PostJournalInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "PostJournalResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Post journal",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/post_journals_batch": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "post_journals_batch",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ids": [
                    "44444444-4444-4444-8444-444444444444",
                    "45444444-4444-4444-8444-444444444444"
                  ]
                },
                "properties": {
                  "ids": {
                    "items": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "maxItems": 500,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "ids"
                ],
                "title": "PostJournalsBatchInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posted": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "posted",
                    "count"
                  ],
                  "title": "PostJournalsBatchResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Post journals batch",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/reactivate_account": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "reactivate_account",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "22222222-2222-4222-8222-222222222222"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "ReactivateAccountInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "active"
                  ],
                  "title": "ReactivateAccountResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Reactivate account",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/reject_draft": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "reject_draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444",
                  "reason": "Missing supporting document"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "reason": {
                    "maxLength": 4000,
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "RejectDraftInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "RejectDraftResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Reject draft",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/reopen_period": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "reopen_period",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "55555555-5555-4555-8555-555555555555"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "ReopenPeriodInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "ReopenPeriodResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Reopen period",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/return_to_draft": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "return_to_draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444",
                  "note": "Wrong account on line 2 — should be 6100, not 6000"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "note": {
                    "maxLength": 4000,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "note"
                ],
                "title": "ReturnToDraftInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "ReturnToDraftResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Return to draft",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/reverse_journal": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "reverse_journal",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444",
                  "posting_date": "2026-02-01"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "posting_date": {
                    "format": "date",
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "posting_date"
                ],
                "title": "ReverseJournalInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "reverses": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "reverses"
                  ],
                  "title": "ReverseJournalResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Reverse journal",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/submit_draft": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "submit_draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "SubmitDraftInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "SubmitDraftResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Submit draft",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/update_account_metadata": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "update_account_metadata",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "22222222-2222-4222-8222-222222222222",
                  "name": "Cash and cash equivalents"
                },
                "properties": {
                  "dimension_rules": {
                    "additionalProperties": {
                      "enum": [
                        "required",
                        "optional"
                      ],
                      "type": "string"
                    },
                    "description": "Which dimensions a line on this account must or may carry, keyed by a dimension the ledger defines: `{\"department\": \"required\"}`. A dimension left out may not be used on the account. Send `{}` or `null` to lift every restriction.",
                    "nullable": true,
                    "type": "object"
                  },
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "UpdateAccountMetadataInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "title": "UpdateAccountMetadataResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Update account metadata",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/commands/update_draft_journal": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "update_draft_journal",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "description": "Corrected description",
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "currency": {
                    "$ref": "#/components/schemas/CurrencyInput"
                  },
                  "description": {
                    "maxLength": 4000,
                    "nullable": true,
                    "type": "string"
                  },
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "lines": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "account_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "amount": {
                          "$ref": "#/components/schemas/AmountInput"
                        },
                        "dimensions": {
                          "additionalProperties": true,
                          "nullable": true,
                          "type": "object"
                        },
                        "memo": {
                          "maxLength": 4000,
                          "nullable": true,
                          "type": "string"
                        },
                        "side": {
                          "enum": [
                            "debit",
                            "credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "account_id",
                        "side",
                        "amount"
                      ],
                      "type": "object"
                    },
                    "maxItems": 100,
                    "minItems": 1,
                    "type": "array"
                  },
                  "posting_date": {
                    "format": "date",
                    "type": "string"
                  },
                  "rationale": {
                    "maxLength": 4000,
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "UpdateDraftJournalInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "UpdateDraftJournalResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Update draft journal",
        "tags": [
          "Commands"
        ]
      }
    },
    "/api/v1/queries/account_ledger": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "account_ledger",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "account_id": "22222222-2222-4222-8222-222222222222",
                  "limit": 50
                },
                "properties": {
                  "account_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "cursor": {
                    "nullable": true,
                    "type": "string"
                  },
                  "limit": {
                    "maximum": 200,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "account_id"
                ],
                "title": "AccountLedgerInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "lines": {
                      "items": {
                        "properties": {
                          "credit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "debit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "dimensions": {
                            "additionalProperties": true,
                            "nullable": true,
                            "type": "object"
                          },
                          "journal_id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "line_no": {
                            "type": "integer"
                          },
                          "memo": {
                            "nullable": true,
                            "type": "string"
                          },
                          "posting_date": {
                            "format": "date",
                            "type": "string"
                          }
                        },
                        "required": [
                          "debit",
                          "credit"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "total_count_exact": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "currency",
                    "lines",
                    "next_cursor",
                    "has_more",
                    "total_count",
                    "total_count_exact"
                  ],
                  "title": "AccountLedgerResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Account ledger",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/attention_queue": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "attention_queue",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {},
                "properties": {
                  "cursor": {
                    "nullable": true,
                    "type": "string"
                  },
                  "limit": {
                    "maximum": 200,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "title": "AttentionQueueInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "items": {
                      "items": {
                        "properties": {
                          "actions": {
                            "items": {
                              "$ref": "#/components/schemas/Action"
                            },
                            "type": "array"
                          },
                          "currency": {
                            "$ref": "#/components/schemas/Currency"
                          },
                          "description": {
                            "nullable": true,
                            "type": "string"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "posting_date": {
                            "format": "date",
                            "type": "string"
                          },
                          "proposed_by": {
                            "properties": {
                              "id": {
                                "format": "uuid",
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "rationale": {
                            "nullable": true,
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "submitted_at": {
                            "format": "date-time",
                            "nullable": true,
                            "type": "string"
                          },
                          "total": {
                            "$ref": "#/components/schemas/Amount"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "total_count_exact": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "items",
                    "next_cursor",
                    "has_more",
                    "total_count",
                    "total_count_exact"
                  ],
                  "title": "AttentionQueueResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Attention queue",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/audit_trail": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "audit_trail",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "limit": 50,
                  "principal_id": "77777777-7777-4777-8777-777777777777"
                },
                "properties": {
                  "cursor": {
                    "nullable": true,
                    "type": "string"
                  },
                  "limit": {
                    "maximum": 200,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "principal_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "principal_id"
                ],
                "title": "AuditTrailInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "entries": {
                      "items": {
                        "properties": {
                          "at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "command": {
                            "type": "string"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "total_count_exact": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "entries",
                    "next_cursor",
                    "has_more",
                    "total_count",
                    "total_count_exact"
                  ],
                  "title": "AuditTrailResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Audit trail",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/balance_sheet": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "balance_sheet",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "as_of_date": "2026-09-15",
                  "ledger_id": "11111111-1111-4111-8111-111111111111"
                },
                "properties": {
                  "as_of_date": {
                    "description": "The date the balances are stated at, including that day's postings.",
                    "format": "date",
                    "type": "string"
                  },
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "as_of_date"
                ],
                "title": "BalanceSheetInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "`current_earnings` is profit or loss as of `as_of_date` that has not been closed to retained earnings, negative for a loss. It is included in `equity`, so `assets` equals `liabilities` plus `equity` on any date.",
                  "properties": {
                    "as_of_date": {
                      "format": "date",
                      "type": "string"
                    },
                    "assets": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    },
                    "current_earnings": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "equity": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "liabilities": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "rows": {
                      "items": {
                        "properties": {
                          "account_id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "balance": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "account_id",
                          "code",
                          "name",
                          "type",
                          "balance"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "as_of_date",
                    "currency",
                    "assets",
                    "liabilities",
                    "equity",
                    "current_earnings",
                    "rows"
                  ],
                  "title": "BalanceSheetResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Balance sheet",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/chart_of_accounts": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "chart_of_accounts",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ledger_id": "11111111-1111-4111-8111-111111111111"
                },
                "properties": {
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id"
                ],
                "title": "ChartOfAccountsInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accounts": {
                      "items": {
                        "properties": {
                          "active": {
                            "type": "boolean"
                          },
                          "code": {
                            "type": "string"
                          },
                          "contra": {
                            "type": "boolean"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "postable": {
                            "type": "boolean"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    }
                  },
                  "required": [
                    "currency",
                    "accounts"
                  ],
                  "title": "ChartOfAccountsResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Chart of accounts",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/income_statement": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "income_statement",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "from_date": "2026-01-01",
                  "ledger_id": "11111111-1111-4111-8111-111111111111",
                  "to_date": "2026-09-15"
                },
                "properties": {
                  "from_date": {
                    "description": "The first date included in the statement.",
                    "format": "date",
                    "type": "string"
                  },
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "to_date": {
                    "description": "The last date included in the statement. Must be on or after `from_date`.",
                    "format": "date",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "from_date",
                  "to_date"
                ],
                "title": "IncomeStatementInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    },
                    "expenses": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "from_date": {
                      "format": "date",
                      "type": "string"
                    },
                    "net_income": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "revenue": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "rows": {
                      "items": {
                        "properties": {
                          "account_id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "amount": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "account_id",
                          "code",
                          "name",
                          "type",
                          "amount"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "to_date": {
                      "format": "date",
                      "type": "string"
                    }
                  },
                  "required": [
                    "from_date",
                    "to_date",
                    "currency",
                    "revenue",
                    "expenses",
                    "net_income",
                    "rows"
                  ],
                  "title": "IncomeStatementResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Income statement",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/journal_detail": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "journal_detail",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444"
                },
                "properties": {
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "title": "JournalDetailInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "actions": {
                      "items": {
                        "$ref": "#/components/schemas/Action"
                      },
                      "type": "array"
                    },
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    },
                    "description": {
                      "nullable": true,
                      "type": "string"
                    },
                    "evidence": {
                      "additionalProperties": true,
                      "nullable": true,
                      "type": "object"
                    },
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "lines": {
                      "items": {
                        "properties": {
                          "account_code": {
                            "type": "string"
                          },
                          "account_id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "credit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "debit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "dimensions": {
                            "additionalProperties": true,
                            "nullable": true,
                            "type": "object"
                          },
                          "line_no": {
                            "type": "integer"
                          },
                          "memo": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "debit",
                          "credit"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "posting_date": {
                      "format": "date",
                      "type": "string"
                    },
                    "proposal_kind": {
                      "nullable": true,
                      "type": "string"
                    },
                    "proposed_by": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "rationale": {
                      "nullable": true,
                      "type": "string"
                    },
                    "rejection_reason": {
                      "nullable": true,
                      "type": "string"
                    },
                    "review_note": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "submitted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "timeline": {
                      "items": {
                        "properties": {
                          "at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "by": {
                            "format": "uuid",
                            "nullable": true,
                            "type": "string"
                          },
                          "status": {
                            "nullable": true,
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "total": {
                      "$ref": "#/components/schemas/Amount"
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "currency",
                    "lines",
                    "timeline"
                  ],
                  "title": "JournalDetailResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Journal detail",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/ledgers": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "ledgers",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {},
                "properties": {
                  "cursor": {
                    "nullable": true,
                    "type": "string"
                  },
                  "limit": {
                    "maximum": 200,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "title": "LedgersInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "ledgers": {
                      "items": {
                        "properties": {
                          "currency": {
                            "$ref": "#/components/schemas/Currency"
                          },
                          "entity": {
                            "properties": {
                              "id": {
                                "format": "uuid",
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "type": "object"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "currency",
                          "entity"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "total_count_exact": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ledgers",
                    "next_cursor",
                    "has_more",
                    "total_count",
                    "total_count_exact"
                  ],
                  "title": "LedgersResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Ledgers",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/period_status": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "period_status",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "ledger_id": "11111111-1111-4111-8111-111111111111"
                },
                "properties": {
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id"
                ],
                "title": "PeriodStatusInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "periods": {
                      "items": {
                        "properties": {
                          "end_date": {
                            "format": "date",
                            "type": "string"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "start_date": {
                            "format": "date",
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "status",
                          "start_date",
                          "end_date"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "periods"
                  ],
                  "title": "PeriodStatusResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Period status",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/returned_drafts": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "returned_drafts",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {},
                "properties": {
                  "cursor": {
                    "nullable": true,
                    "type": "string"
                  },
                  "limit": {
                    "maximum": 200,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "title": "ReturnedDraftsInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "items": {
                      "items": {
                        "properties": {
                          "description": {
                            "nullable": true,
                            "type": "string"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "posting_date": {
                            "format": "date",
                            "type": "string"
                          },
                          "proposed_by": {
                            "properties": {
                              "id": {
                                "format": "uuid",
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "returned_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "review_note": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "total_count_exact": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "items",
                    "next_cursor",
                    "has_more",
                    "total_count",
                    "total_count_exact"
                  ],
                  "title": "ReturnedDraftsResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Returned drafts",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/tenant": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "tenant",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {},
                "properties": {},
                "title": "TenantInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "mode": {
                      "description": "`live` for a company's real books, `test` for a sandbox. Fixed when the company is created. A sandbox follows the same rules as a live company, journal approval included. Treat any other value as not live.",
                      "example": "live",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "mode"
                  ],
                  "title": "TenantResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Tenant",
        "tags": [
          "Queries"
        ]
      }
    },
    "/api/v1/queries/trial_balance": {
      "post": {
        "callbacks": {},
        "deprecated": false,
        "operationId": "trial_balance",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "example": {
                  "as_of_date": "2026-09-15",
                  "from_date": "2026-09-01",
                  "ledger_id": "11111111-1111-4111-8111-111111111111"
                },
                "properties": {
                  "as_of_date": {
                    "description": "The date the balances are stated at, including that day's postings.",
                    "format": "date",
                    "type": "string"
                  },
                  "from_date": {
                    "description": "Optional. The first date of the activity columns; adds `opening`, `period_debit`, and `period_credit` to every row. Must be on or before `as_of_date`.",
                    "format": "date",
                    "type": "string"
                  },
                  "ledger_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "ledger_id",
                  "as_of_date"
                ],
                "title": "TrialBalanceInput",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "Rows carry `opening`, `period_debit`, and `period_credit` only when the request gave `from_date`, and the result echoes `from_date` only then.",
                  "properties": {
                    "as_of_date": {
                      "format": "date",
                      "type": "string"
                    },
                    "currency": {
                      "$ref": "#/components/schemas/Currency"
                    },
                    "from_date": {
                      "format": "date",
                      "type": "string"
                    },
                    "rows": {
                      "items": {
                        "properties": {
                          "account_id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "closing_net": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "code": {
                            "type": "string"
                          },
                          "credit_balance": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "debit_balance": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "name": {
                            "type": "string"
                          },
                          "opening": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "period_credit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "period_debit": {
                            "$ref": "#/components/schemas/Amount"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "account_id",
                          "code",
                          "name",
                          "type",
                          "debit_balance",
                          "credit_balance",
                          "closing_net"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "total_credit_balance": {
                      "$ref": "#/components/schemas/Amount"
                    },
                    "total_debit_balance": {
                      "$ref": "#/components/schemas/Amount"
                    }
                  },
                  "required": [
                    "as_of_date",
                    "currency",
                    "rows",
                    "total_debit_balance",
                    "total_credit_balance"
                  ],
                  "title": "TrialBalanceResult",
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid input: the body failed validation, or the framework rejected the request before the operation ran."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthenticated: a missing, malformed, or invalid API token."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden: the principal lacks the permission, or an approval policy denied the command.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not found: no such operation, or an id that does not resolve for the tenant.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict: an idempotency clash, or a target not in the required state.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is well-formed and permitted, but violates an accounting rule.",
            "headers": {
              "BoringBooks-Mode": {
                "$ref": "#/components/headers/BoringBooks-Mode"
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Rate limited. See the Retry-After header."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "An unexpected error, carrying only an opaque incident id."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The server is at capacity and shed the request unrun. See the Retry-After header."
          }
        },
        "summary": "Trial balance",
        "tags": [
          "Queries"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://boringbooks.io",
      "variables": {}
    }
  ],
  "tags": []
}