{
  "openapi": "3.1.0",
  "info": {
    "title": "Invarent Runtime API",
    "version": "1.0.0",
    "description": "Source-aligned contract for the Nest runtime. Shared target operations retain their canonical operation IDs; operational extensions remain explicitly source named."
  },
  "servers": [
    {
      "url": "https://api.invarent.com",
      "description": "Production API; sandbox and live isolation is selected by credential"
    },
    {
      "url": "https://api.cognautic.com",
      "description": "Legacy production alias retained during the Invarent domain transition"
    },
    {
      "url": "http://localhost:{port}",
      "description": "Local development runtime",
      "variables": {
        "port": {
          "default": "3000"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/access-grants": {
      "get": {
        "operationId": "listAccessGrants",
        "summary": "List access grants",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listAccessGrants",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:read"
        ]
      },
      "post": {
        "operationId": "createAccessGrants",
        "summary": "Create access grant",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createAccessGrant",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/access-grants/{id}": {
      "get": {
        "operationId": "getAccessGrant",
        "summary": "Get access grant",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getAccessGrant",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateAccessGrant",
        "summary": "Update access grant",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateAccessGrant",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/access-grants/{id}:revoke": {
      "post": {
        "operationId": "revokeAccessGrant",
        "summary": "Revoke access grant",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#revokeAccessGrant",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:grant"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "accountGetAccount",
        "summary": "Get account",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#getAccount",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:read"
        ]
      },
      "patch": {
        "operationId": "accountUpdateAccount",
        "summary": "Update account",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#updateAccount",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommercialAccountUpdateInput"
              }
            }
          }
        }
      }
    },
    "/v1/account-invitations/accept": {
      "post": {
        "operationId": "commercialInvitationAcceptInvitation",
        "summary": "Accept invitation",
        "tags": [
          "commercialinvitation"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/commercial-invitation.controller.ts#acceptInvitation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationAcceptInput"
              }
            }
          }
        }
      }
    },
    "/v1/account-signup": {
      "post": {
        "operationId": "commercialSignupCreateAccount",
        "summary": "Create account",
        "tags": [
          "commercialsignup"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/commercial-signup.controller.ts#createAccount",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "apiKey.value"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommercialAccountSignupInput"
              }
            }
          }
        }
      }
    },
    "/v1/account-signup/access": {
      "get": {
        "operationId": "commercialSignupListAccountAccess",
        "summary": "List account access",
        "tags": [
          "commercialsignup"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/commercial-signup.controller.ts#listAccountAccess",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": []
      }
    },
    "/v1/account/billing": {
      "get": {
        "operationId": "billingGetBilling",
        "summary": "Get billing",
        "tags": [
          "billing"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/billing.controller.ts#getBilling",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:billing"
        ]
      }
    },
    "/v1/account/billing/checkout": {
      "post": {
        "operationId": "billingCreateCheckout",
        "summary": "Create checkout",
        "tags": [
          "billing"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/billing.controller.ts#createCheckout",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BillingCheckoutInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/billing/portal": {
      "post": {
        "operationId": "billingCreatePortal",
        "summary": "Create portal",
        "tags": [
          "billing"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/billing.controller.ts#createPortal",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/businesses": {
      "get": {
        "operationId": "accountListBusinesses",
        "summary": "List businesses",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#listBusinesses",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Human account session required. Creation requires OWNER or BILLING_ADMIN with AAL2; allocation is CLEAN and does not mint a key.",
        "x-required-scopes": [
          "account:read"
        ]
      },
      "post": {
        "operationId": "accountCreateBusiness",
        "summary": "Create business",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#createBusiness",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveBusiness"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Human account session required. Creation requires OWNER or BILLING_ADMIN with AAL2; allocation is CLEAN and does not mint a key.",
        "x-required-scopes": [
          "account:billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveBusinessInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/entitlement": {
      "get": {
        "operationId": "accountGetEntitlement",
        "summary": "Get entitlement",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#getEntitlement",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:read"
        ]
      }
    },
    "/v1/account/invitations": {
      "get": {
        "operationId": "accountListInvitations",
        "summary": "List invitations",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#listInvitations",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:read"
        ]
      },
      "post": {
        "operationId": "accountInviteMember",
        "summary": "Invite member",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#inviteMember",
        "responses": {
          "201": {
            "description": "A one-time secret is shown only on the original response; if it was lost, rotate. Replay returns null secret fields and secret_redacted_on_replay: true. For invitations, revoke and issue a new invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "secret_redacted_on_replay": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present on replay only"
                    },
                    "acceptanceToken": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Shown once; null on idempotent replay"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replay": {
                "description": "true when returning a completed request's stored response",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "acceptanceToken"
        ],
        "x-required-scopes": [
          "access:grant"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/invitations/{id}": {
      "delete": {
        "operationId": "accountRevokeInvitation",
        "summary": "Revoke invitation",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#revokeInvitation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:grant"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/account/members": {
      "get": {
        "operationId": "accountListMembers",
        "summary": "List members",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#listMembers",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:read"
        ]
      }
    },
    "/v1/account/members/{id}": {
      "delete": {
        "operationId": "accountRemoveMember",
        "summary": "Remove member",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#removeMember",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:grant"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "accountUpdateMember",
        "summary": "Update member",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#updateMember",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "access:grant"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipUpdateInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/support-cases": {
      "get": {
        "operationId": "accountListSupportCases",
        "summary": "List support cases",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#listSupportCases",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:support"
        ]
      },
      "post": {
        "operationId": "accountCreateSupportCase",
        "summary": "Create support case",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#createSupportCase",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:support"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportCaseCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/account/tenants": {
      "get": {
        "operationId": "accountListTenants",
        "summary": "List tenants",
        "tags": [
          "account"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/account.controller.ts#listTenants",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "account:read"
        ]
      }
    },
    "/v1/account/usage": {
      "get": {
        "operationId": "accountUsageCurrent",
        "summary": "Current",
        "tags": [
          "accountusage"
        ],
        "x-ledgeros-source": "apps/api/src/usage/account-usage.controller.ts#current",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountUsage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "usage:read"
        ]
      }
    },
    "/v1/accounting-events": {
      "get": {
        "operationId": "accountingEventLookup",
        "summary": "Lookup",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#lookup",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingEventLookupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SourceSystem"
          },
          {
            "$ref": "#/components/parameters/ExternalId"
          },
          {
            "$ref": "#/components/parameters/ExternalVersion"
          },
          {
            "$ref": "#/components/parameters/EventLookupLimit"
          },
          {
            "$ref": "#/components/parameters/EventLookupOffset"
          }
        ]
      },
      "post": {
        "operationId": "accountingEventPostEvent",
        "summary": "Post event",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#postEvent",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingEventResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "description": "ACCOUNTING_INVARIANT_VIOLATION (retryable: false). An ambiguous invoice reference returns details[0].code = AMBIGUOUS_INVOICE_REFERENCE; supply effect.invoiceExternalVersion or effect.reversesExternalVersion. The refused transaction writes nothing, including no idempotency record; resend the same Idempotency-Key with the version added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:write",
          "ledger:post"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingEventInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounting-events/readiness": {
      "get": {
        "operationId": "accountingEventReadiness",
        "summary": "Readiness",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#readiness",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:read",
          "ledger:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SourceSystem"
          },
          {
            "$ref": "#/components/parameters/LegalEntityId"
          },
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/FromDate"
          },
          {
            "$ref": "#/components/parameters/ThroughDate"
          }
        ]
      }
    },
    "/v1/accounting-events/{sourceEventId}": {
      "get": {
        "operationId": "accountingEventReadHeld",
        "summary": "Read held",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#readHeld",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldEventReview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply.",
        "parameters": [
          {
            "name": "sourceEventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/accounting-events/{sourceEventId}:approve": {
      "post": {
        "operationId": "accountingEventApprove",
        "summary": "Approve",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#approve",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountingEventResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply.",
        "parameters": [
          {
            "name": "sourceEventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldEventApproveInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounting-events/{sourceEventId}:reject": {
      "post": {
        "operationId": "accountingEventReject",
        "summary": "Reject",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#reject",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldEventRejection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply.",
        "parameters": [
          {
            "name": "sourceEventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldEventRejectInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounting-packs": {
      "get": {
        "operationId": "customerFactoryCatalog",
        "summary": "Catalog",
        "tags": [
          "customerfactory"
        ],
        "x-ledgeros-source": "apps/api/src/customer-factory/customer-factory.controller.ts#catalog",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:read"
        ]
      }
    },
    "/v1/accounting-packs/installations": {
      "get": {
        "operationId": "customerFactoryInstallations",
        "summary": "Installations",
        "tags": [
          "customerfactory"
        ],
        "x-ledgeros-source": "apps/api/src/customer-factory/customer-factory.controller.ts#installations",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          }
        ]
      },
      "post": {
        "operationId": "customerFactoryInstall",
        "summary": "Install",
        "tags": [
          "customerfactory"
        ],
        "x-ledgeros-source": "apps/api/src/customer-factory/customer-factory.controller.ts#install",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write",
          "sources:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductPackInstallInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounting-periods": {
      "get": {
        "operationId": "listAccountingPeriods",
        "summary": "Accounting periods",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#accountingPeriods",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ]
      },
      "post": {
        "operationId": "createAccountingPeriods",
        "summary": "Create accounting period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createAccountingPeriod",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accounting-periods/{id}": {
      "get": {
        "operationId": "getAccountingPeriod",
        "summary": "Accounting period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#accountingPeriod",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateAccountingPeriod",
        "summary": "Update accounting period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateAccountingPeriod",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/accounting-periods/{id}:hard-close": {
      "post": {
        "operationId": "hardClosePeriod",
        "summary": "Hard close period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#hardClosePeriod",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:certify"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accounting-periods/{id}:reopen": {
      "post": {
        "operationId": "reopenPeriod",
        "summary": "Reopen period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#reopenPeriod",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:certify"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accounting-periods/{id}:soft-close": {
      "post": {
        "operationId": "softClosePeriod",
        "summary": "Soft close period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#softClosePeriod",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accounting-policies": {
      "get": {
        "operationId": "listAccountingPolicies",
        "summary": "List accounting policies",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listAccountingPolicies",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ]
      },
      "post": {
        "operationId": "createAccountingPolicies",
        "summary": "Create accounting policy",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createAccountingPolicy",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accounting-policies/{id}": {
      "get": {
        "operationId": "getAccountingPolicie",
        "summary": "Get accounting policy",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getAccountingPolicy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateAccountingPolicie",
        "summary": "Update accounting policy",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateAccountingPolicy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/accounting-profiles": {
      "post": {
        "operationId": "accountingEventProvision",
        "summary": "Provision",
        "tags": [
          "accountingevent"
        ],
        "x-ledgeros-source": "apps/api/src/accounting-events/accounting-event.controller.ts#provision",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write",
          "sources:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingProfileInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounts": {
      "get": {
        "operationId": "listAccounts",
        "summary": "Accounts",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#accounts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/BookIdOptional"
          }
        ]
      },
      "post": {
        "operationId": "createAccounts",
        "summary": "Create account",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createAccount",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{id}": {
      "get": {
        "operationId": "getAccount",
        "summary": "Account",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#account",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateAccount",
        "summary": "Update account",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateAccount",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/accruals": {
      "get": {
        "operationId": "listAccruals",
        "summary": "List accruals",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listAccruals",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ]
      },
      "post": {
        "operationId": "createAccruals",
        "summary": "Create accrual",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createAccrual",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/accruals/{id}": {
      "get": {
        "operationId": "getAccrual",
        "summary": "Get accrual",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getAccrual",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateAccrual",
        "summary": "Update accrual",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateAccrual",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/ai/suggestions": {
      "get": {
        "operationId": "listAISuggestions",
        "summary": "List ai suggestions",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#listAiSuggestions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ai:read"
        ]
      }
    },
    "/v1/ai/suggestions/{id}": {
      "get": {
        "operationId": "getAISuggestion",
        "summary": "Get ai suggestion",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#getAiSuggestion",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ai:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/ai/suggestions/{id}:approve": {
      "post": {
        "operationId": "approveAISuggestion",
        "summary": "Approve ai suggestion",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#approveAiSuggestion",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ai:review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/ai/suggestions/{id}:reject": {
      "post": {
        "operationId": "rejectAISuggestion",
        "summary": "Reject ai suggestion",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#rejectAiSuggestion",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ai:review"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/ap-aging": {
      "get": {
        "operationId": "getAPAging",
        "summary": "Ap aging",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#apAging",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ]
      }
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "platformListKeys",
        "summary": "List keys",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#listKeys",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "keys:manage"
        ]
      },
      "post": {
        "operationId": "platformCreateKey",
        "summary": "Create key",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#createKey",
        "responses": {
          "201": {
            "description": "A one-time secret is shown only on the original response; if it was lost, rotate. Replay returns null secret fields and secret_redacted_on_replay: true. For invitations, revoke and issue a new invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "secret_redacted_on_replay": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present on replay only"
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Shown once; null on idempotent replay"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replay": {
                "description": "true when returning a completed request's stored response",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "value"
        ],
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/api-keys/{id}:revoke": {
      "post": {
        "operationId": "platformRevokeKey",
        "summary": "Revoke key",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#revokeKey",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/api-keys/{id}:rotate": {
      "post": {
        "operationId": "platformRotateKey",
        "summary": "Rotate key",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#rotateKey",
        "responses": {
          "201": {
            "description": "A one-time secret is shown only on the original response; if it was lost, rotate. Replay returns null secret fields and secret_redacted_on_replay: true. For invitations, revoke and issue a new invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "secret_redacted_on_replay": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present on replay only"
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Shown once; null on idempotent replay"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replay": {
                "description": "true when returning a completed request's stored response",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "value"
        ],
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/approval-grants": {
      "post": {
        "operationId": "approvalRequest",
        "summary": "Request",
        "tags": [
          "approval"
        ],
        "x-ledgeros-source": "apps/api/src/approval/approval.controller.ts#request",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:request"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRequestInput"
              }
            }
          }
        }
      }
    },
    "/v1/approval-grants/{id}:approve": {
      "post": {
        "operationId": "approvalApprove",
        "summary": "Approve",
        "tags": [
          "approval"
        ],
        "x-ledgeros-source": "apps/api/src/approval/approval.controller.ts#approve",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecisionInput"
              }
            }
          }
        }
      }
    },
    "/v1/approval-grants/{id}:revoke": {
      "post": {
        "operationId": "approvalRevoke",
        "summary": "Revoke",
        "tags": [
          "approval"
        ],
        "x-ledgeros-source": "apps/api/src/approval/approval.controller.ts#revoke",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRevokeInput"
              }
            }
          }
        }
      }
    },
    "/v1/approval-policies": {
      "get": {
        "operationId": "approvalPolicyList",
        "summary": "List",
        "tags": [
          "approvalpolicy"
        ],
        "x-ledgeros-source": "apps/api/src/approval/approval-policy.controller.ts#list",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPolicyList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:approve"
        ]
      },
      "post": {
        "operationId": "approvalPolicyCreate",
        "summary": "Create",
        "tags": [
          "approvalpolicy"
        ],
        "x-ledgeros-source": "apps/api/src/approval/approval-policy.controller.ts#create",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalPolicyVersion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:approve"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalPolicyInput"
              }
            }
          }
        }
      }
    },
    "/v1/ar-aging": {
      "get": {
        "operationId": "getARAging",
        "summary": "Ar aging",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#arAging",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ]
      }
    },
    "/v1/audit-events": {
      "get": {
        "operationId": "listAuditEvents",
        "summary": "List",
        "tags": [
          "audit"
        ],
        "x-ledgeros-source": "apps/api/src/audit/audit.controller.ts#list",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "audit:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/AuditCursor"
          },
          {
            "$ref": "#/components/parameters/AuditAction"
          },
          {
            "$ref": "#/components/parameters/ObjectType"
          },
          {
            "$ref": "#/components/parameters/ActorId"
          },
          {
            "$ref": "#/components/parameters/FromDateTime"
          },
          {
            "$ref": "#/components/parameters/ToDateTime"
          }
        ]
      }
    },
    "/v1/bank-accounts": {
      "get": {
        "operationId": "listBankAccounts",
        "summary": "List bank accounts",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listBankAccounts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ]
      },
      "post": {
        "operationId": "createBankAccounts",
        "summary": "Create bank account",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createBankAccount",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/bank-accounts/{id}": {
      "get": {
        "operationId": "getBankAccount",
        "summary": "Get bank account",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getBankAccount",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateBankAccount",
        "summary": "Update bank account",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateBankAccount",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/bank-transactions": {
      "get": {
        "operationId": "listBankTransactions",
        "summary": "List bank transactions",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listBankTransactions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ]
      }
    },
    "/v1/bank-transactions/{id}": {
      "get": {
        "operationId": "getBankTransaction",
        "summary": "Get bank transaction",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getBankTransaction",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/billing/stripe/webhook": {
      "post": {
        "operationId": "stripeWebhookReceive",
        "summary": "Receive",
        "tags": [
          "stripewebhook"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/stripe-webhook.controller.ts#receive",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": []
      }
    },
    "/v1/bills": {
      "get": {
        "operationId": "listBills",
        "summary": "List bills",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#listBills",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LegalEntityIdOptional"
          },
          {
            "$ref": "#/components/parameters/DocumentStatus"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "operationId": "createBills",
        "summary": "Create bill",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createBill",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BillCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/bills/{id}": {
      "get": {
        "operationId": "getBill",
        "summary": "Get bill",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#getBill",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateBill",
        "summary": "Update bill",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#updateBill",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/bills/{id}:approve": {
      "post": {
        "operationId": "approveBill",
        "summary": "Approve bill",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#approveBill",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/bills/{id}:post": {
      "post": {
        "operationId": "postBill",
        "summary": "Post bill",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#postBill",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionalApprovalGrantInput"
              }
            }
          }
        }
      }
    },
    "/v1/books": {
      "get": {
        "operationId": "listBooks",
        "summary": "Books",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#books",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/BookIdOptional"
          }
        ]
      },
      "post": {
        "operationId": "createBooks",
        "summary": "Create book",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createBook",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/books/{id}": {
      "get": {
        "operationId": "getBook",
        "summary": "Book",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#book",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateBook",
        "summary": "Update book",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateBook",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/cash-applications": {
      "get": {
        "operationId": "listCashApplications",
        "summary": "List cash applications",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listCashApplications",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ]
      },
      "post": {
        "operationId": "createCashApplications",
        "summary": "Create cash application",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createCashApplication",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/cash-applications/{id}": {
      "get": {
        "operationId": "getCashApplication",
        "summary": "Get cash application",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getCashApplication",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCashApplication",
        "summary": "Update cash application",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateCashApplication",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/cash-receipts": {
      "get": {
        "operationId": "listCashReceipts",
        "summary": "List cash receipts",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listCashReceipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ]
      },
      "post": {
        "operationId": "createCashReceipts",
        "summary": "Create cash receipt",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createCashReceipt",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/cash-receipts/{id}": {
      "get": {
        "operationId": "getCashReceipt",
        "summary": "Get cash receipt",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getCashReceipt",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCashReceipt",
        "summary": "Update cash receipt",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateCashReceipt",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/clins": {
      "get": {
        "operationId": "listClins",
        "summary": "List clins",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listClins",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createClins",
        "summary": "Create clin",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createClin",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/clins/{id}": {
      "get": {
        "operationId": "getClin",
        "summary": "Get clin",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getClin",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateClin",
        "summary": "Update clin",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateClin",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/close-cycles": {
      "get": {
        "operationId": "listCloseCycles",
        "summary": "List close cycles",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listCloseCycles",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ]
      },
      "post": {
        "operationId": "createCloseCycles",
        "summary": "Create close cycle",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createCloseCycle",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/close-cycles/{id}": {
      "get": {
        "operationId": "getCloseCycle",
        "summary": "Get close cycle",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getCloseCycle",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCloseCycle",
        "summary": "Update close cycle",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateCloseCycle",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/close-cycles/{id}:certify": {
      "post": {
        "operationId": "certifyCloseCycle",
        "summary": "Certify close cycle",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#certifyCloseCycle",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:certify"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/close-tasks": {
      "get": {
        "operationId": "listCloseTasks",
        "summary": "List close tasks",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listCloseTasks",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ]
      },
      "post": {
        "operationId": "createCloseTasks",
        "summary": "Create close task",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createCloseTask",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/close-tasks/{id}": {
      "get": {
        "operationId": "getCloseTask",
        "summary": "Get close task",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getCloseTask",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCloseTask",
        "summary": "Update close task",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateCloseTask",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/connections": {
      "get": {
        "operationId": "listConnections",
        "summary": "List connections",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listConnections",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:read"
        ]
      },
      "post": {
        "operationId": "createConnections",
        "summary": "Create connection",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createConnection",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/connections/{id}": {
      "get": {
        "operationId": "getConnection",
        "summary": "Get connection",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getConnection",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateConnection",
        "summary": "Update connection",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateConnection",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/connections/{id}:sync": {
      "post": {
        "operationId": "syncConnection",
        "summary": "Sync connection",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#syncConnection",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:sync"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/contracts": {
      "get": {
        "operationId": "listContracts",
        "summary": "List contracts",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listContracts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createContracts",
        "summary": "Create contract",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createContract",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/contracts/{id}": {
      "get": {
        "operationId": "getContract",
        "summary": "Get contract",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getContract",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateContract",
        "summary": "Update contract",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateContract",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/control-definitions": {
      "get": {
        "operationId": "listControlDefinitions",
        "summary": "List control definitions",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listControlDefinitions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ]
      },
      "post": {
        "operationId": "createControlDefinitions",
        "summary": "Create control definition",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createControlDefinition",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/control-definitions/{id}": {
      "get": {
        "operationId": "getControlDefinition",
        "summary": "Get control definition",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getControlDefinition",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateControlDefinition",
        "summary": "Update control definition",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateControlDefinition",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/cost-pools": {
      "get": {
        "operationId": "listCostPools",
        "summary": "List cost pools",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listCostPools",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createCostPools",
        "summary": "Create cost pool",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createCostPool",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/cost-pools/{id}": {
      "get": {
        "operationId": "getCostPool",
        "summary": "Get cost pool",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getCostPool",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCostPool",
        "summary": "Update cost pool",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateCostPool",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/customers": {
      "get": {
        "operationId": "listCustomers",
        "summary": "List customers",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#listCustomers",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LegalEntityIdOptional"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "operationId": "createCustomers",
        "summary": "Create customer",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createCustomer",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/customers/{id}": {
      "get": {
        "operationId": "getCustomer",
        "summary": "Get customer",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#getCustomer",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateCustomer",
        "summary": "Update customer",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#updateCustomer",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/dimension-values": {
      "get": {
        "operationId": "listDimensionValues",
        "summary": "Dimension values",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#dimensionValues",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ]
      },
      "post": {
        "operationId": "createDimensionValues",
        "summary": "Create dimension value",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createDimensionValue",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/dimension-values/{id}": {
      "get": {
        "operationId": "getDimensionValue",
        "summary": "Dimension value",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#dimensionValue",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateDimensionValue",
        "summary": "Update dimension value",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateDimensionValue",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/dimensions": {
      "get": {
        "operationId": "listDimensions",
        "summary": "Dimensions",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#dimensions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ]
      },
      "post": {
        "operationId": "createDimensions",
        "summary": "Create dimension",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createDimension",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/dimensions/{id}": {
      "get": {
        "operationId": "getDimension",
        "summary": "Dimension",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#dimension",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateDimension",
        "summary": "Update dimension",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateDimension",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "coa:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "listDocuments",
        "summary": "List documents",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#listDocuments",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "documents:read"
        ]
      },
      "post": {
        "operationId": "createDocuments",
        "summary": "Create document",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#createDocument",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "documents:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "getDocument",
        "summary": "Get document",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#getDocument",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "documents:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateDocument",
        "summary": "Update document",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#updateDocument",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "documents:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/exceptions": {
      "get": {
        "operationId": "listExceptions",
        "summary": "List exceptions",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listExceptions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ]
      },
      "post": {
        "operationId": "createExceptions",
        "summary": "Create exception",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createException",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/exceptions/{id}": {
      "get": {
        "operationId": "getException",
        "summary": "Get exception",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getException",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateException",
        "summary": "Update exception",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateException",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "close:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/financial-statements": {
      "get": {
        "operationId": "getFinancialStatements",
        "summary": "Target financial statements",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#targetFinancialStatements",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/fixed-assets": {
      "get": {
        "operationId": "listFixedAssets",
        "summary": "List fixed assets",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listFixedAssets",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ]
      },
      "post": {
        "operationId": "createFixedAssets",
        "summary": "Create fixed asset",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createFixedAsset",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/fixed-assets/{id}": {
      "get": {
        "operationId": "getFixedAsset",
        "summary": "Get fixed asset",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getFixedAsset",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateFixedAsset",
        "summary": "Update fixed asset",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateFixedAsset",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/healthz": {
      "get": {
        "operationId": "healthHealth",
        "summary": "Health",
        "tags": [
          "health"
        ],
        "x-ledgeros-source": "apps/api/src/health/health.controller.ts#health",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": []
      }
    },
    "/v1/import-jobs": {
      "get": {
        "operationId": "listImportJobs",
        "summary": "List import jobs",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listImportJobs",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:read"
        ]
      },
      "post": {
        "operationId": "createImportJobs",
        "summary": "Create import job",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createImportJob",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/import-jobs/{id}": {
      "get": {
        "operationId": "getImportJob",
        "summary": "Get import job",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getImportJob",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateImportJob",
        "summary": "Update import job",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateImportJob",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/indirect-rates": {
      "get": {
        "operationId": "listIndirectRates",
        "summary": "List indirect rates",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listIndirectRates",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createIndirectRates",
        "summary": "Create indirect rate",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createIndirectRate",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/indirect-rates/{id}": {
      "get": {
        "operationId": "getIndirectRate",
        "summary": "Get indirect rate",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getIndirectRate",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateIndirectRate",
        "summary": "Update indirect rate",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateIndirectRate",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/indirect-rates/{id}:approve": {
      "post": {
        "operationId": "approveIndirectRate",
        "summary": "Approve indirect rate",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#approveIndirectRate",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "rates:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "listInvoices",
        "summary": "List invoices",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#listInvoices",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LegalEntityIdOptional"
          },
          {
            "$ref": "#/components/parameters/DocumentStatus"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "operationId": "createInvoices",
        "summary": "Create invoice",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createInvoice",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "operationId": "getInvoice",
        "summary": "Get invoice",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#getInvoice",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateInvoice",
        "summary": "Update invoice",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#updateInvoice",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/invoices/{id}:issue": {
      "post": {
        "operationId": "issueInvoice",
        "summary": "Issue invoice",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#issueInvoice",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/invoices/{id}:post": {
      "post": {
        "operationId": "subledgerPostInvoice",
        "summary": "Post invoice",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#postInvoice",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionalApprovalGrantInput"
              }
            }
          }
        }
      }
    },
    "/v1/job-cost-summaries": {
      "get": {
        "operationId": "getJobCostSummaries",
        "summary": "Job cost summaries",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#jobCostSummaries",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "getAsyncJob",
        "summary": "Get async job",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getAsyncJob",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/journal-entries": {
      "get": {
        "operationId": "listJournalEntries",
        "summary": "List",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#list",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookIdOptional"
          },
          {
            "$ref": "#/components/parameters/PeriodIdOptional"
          },
          {
            "$ref": "#/components/parameters/JournalStatus"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "operationId": "createJournalEntries",
        "summary": "Create",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#create",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:draft"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/journal-entries/{id}": {
      "get": {
        "operationId": "getJournalEntry",
        "summary": "Get",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateJournalEntry",
        "summary": "Update",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#update",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:draft"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/journal-entries/{id}:approve": {
      "post": {
        "operationId": "approveJournalEntry",
        "summary": "Approve",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#approve",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply. Refuses SUBLEDGER and SOURCE_EVENT journals with 409 CONCURRENCY_CONFLICT (JOURNAL_MANAGED_BY_SUBLEDGER). Use the dedicated subledger/accounting-event workflow.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/journal-entries/{id}:post": {
      "post": {
        "operationId": "postJournalEntry",
        "summary": "Post",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#post",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:post"
        ],
        "description": " Refuses SUBLEDGER and SOURCE_EVENT journals with 409 CONCURRENCY_CONFLICT (JOURNAL_MANAGED_BY_SUBLEDGER). Use the dedicated subledger/accounting-event workflow.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionalApprovalGrantInput"
              }
            }
          }
        }
      }
    },
    "/v1/journal-entries/{id}:reverse": {
      "post": {
        "operationId": "reverseJournalEntry",
        "summary": "Reverse",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#reverse",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:reverse"
        ],
        "description": " Refuses SUBLEDGER and SOURCE_EVENT journals with 409 CONCURRENCY_CONFLICT (JOURNAL_MANAGED_BY_SUBLEDGER). Use the dedicated subledger/accounting-event workflow.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalReverseInput"
              }
            }
          }
        }
      }
    },
    "/v1/journal-entries/{id}:submit": {
      "post": {
        "operationId": "submitJournalEntry",
        "summary": "Submit",
        "tags": [
          "journal"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/journal.controller.ts#submit",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRead"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ledger:draft"
        ],
        "description": " Refuses SUBLEDGER and SOURCE_EVENT journals with 409 CONCURRENCY_CONFLICT (JOURNAL_MANAGED_BY_SUBLEDGER). Use the dedicated subledger/accounting-event workflow.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/legal-entities": {
      "get": {
        "operationId": "listLegalEntities",
        "summary": "Entities",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#entities",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/BookIdOptional"
          }
        ]
      },
      "post": {
        "operationId": "createLegalEntities",
        "summary": "Create entity",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createEntity",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEntityCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/legal-entities/{id}": {
      "get": {
        "operationId": "getLegalEntity",
        "summary": "Entity",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#entity",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateLegalEntity",
        "summary": "Update entity",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#updateEntity",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/marketing/leads": {
      "post": {
        "operationId": "marketingLeadCreateLead",
        "summary": "Create lead",
        "tags": [
          "marketinglead"
        ],
        "x-ledgeros-source": "apps/api/src/commercial/marketing-lead.controller.ts#createLead",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingLeadInput"
              }
            }
          }
        }
      }
    },
    "/v1/oauth-clients": {
      "get": {
        "operationId": "platformListOAuthClients",
        "summary": "List o auth clients",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#listOAuthClients",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "keys:manage"
        ]
      },
      "post": {
        "operationId": "platformCreateOAuthClient",
        "summary": "Create o auth client",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#createOAuthClient",
        "responses": {
          "201": {
            "description": "A one-time secret is shown only on the original response; if it was lost, rotate. Replay returns null secret fields and secret_redacted_on_replay: true. For invitations, revoke and issue a new invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "secret_redacted_on_replay": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present on replay only"
                    },
                    "clientSecret": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Shown once; null on idempotent replay"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replay": {
                "description": "true when returning a completed request's stored response",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "clientSecret"
        ],
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/oauth-clients/{id}:revoke": {
      "post": {
        "operationId": "platformRevokeOAuthClient",
        "summary": "Revoke o auth client",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#revokeOAuthClient",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/oauth-clients/{id}:rotate": {
      "post": {
        "operationId": "platformRotateOAuthClient",
        "summary": "Rotate o auth client",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#rotateOAuthClient",
        "responses": {
          "201": {
            "description": "A one-time secret is shown only on the original response; if it was lost, rotate. Replay returns null secret fields and secret_redacted_on_replay: true. For invitations, revoke and issue a new invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "secret_redacted_on_replay": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Present on replay only"
                    },
                    "clientSecret": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Shown once; null on idempotent replay"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replay": {
                "description": "true when returning a completed request's stored response",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "clientSecret"
        ],
        "x-required-scopes": [
          "keys:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/oauth/token": {
      "post": {
        "operationId": "oAuthToken",
        "summary": "Token",
        "tags": [
          "oauth"
        ],
        "x-ledgeros-source": "apps/api/src/auth/oauth.controller.ts#token",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "access_token"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/OAuthTokenInput"
              }
            }
          }
        }
      }
    },
    "/v1/payment-runs": {
      "get": {
        "operationId": "listPaymentRuns",
        "summary": "List payment runs",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listPaymentRuns",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ]
      },
      "post": {
        "operationId": "createPaymentRuns",
        "summary": "Create payment run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createPaymentRun",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/payment-runs/{id}": {
      "get": {
        "operationId": "getPaymentRun",
        "summary": "Get payment run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getPaymentRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updatePaymentRun",
        "summary": "Update payment run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updatePaymentRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/payment-runs/{id}:approve": {
      "post": {
        "operationId": "approvePaymentRun",
        "summary": "Approve payment run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#approvePaymentRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/payment-runs/{id}:release": {
      "post": {
        "operationId": "releasePaymentRun",
        "summary": "Release payment run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#releasePaymentRun",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:pay"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/payments": {
      "post": {
        "operationId": "subledgerCreatePayment",
        "summary": "Create payment",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createPayment",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/payments/{id}:apply": {
      "post": {
        "operationId": "subledgerApplyPayment",
        "summary": "Apply payment",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#applyPayment",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentApplicationInput"
              }
            }
          }
        }
      }
    },
    "/v1/payments/{id}:post": {
      "post": {
        "operationId": "subledgerPostPayment",
        "summary": "Post payment",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#postPayment",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionalApprovalGrantInput"
              }
            }
          }
        }
      }
    },
    "/v1/payroll-runs": {
      "get": {
        "operationId": "listPayrollRuns",
        "summary": "List payroll runs",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listPayrollRuns",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "payroll:read"
        ]
      },
      "post": {
        "operationId": "createPayrollRuns",
        "summary": "Create payroll run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createPayrollRun",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "payroll:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/payroll-runs/{id}": {
      "get": {
        "operationId": "getPayrollRun",
        "summary": "Get payroll run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getPayrollRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "payroll:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updatePayrollRun",
        "summary": "Update payroll run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updatePayrollRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "payroll:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/payroll-runs/{id}:post": {
      "post": {
        "operationId": "postPayrollRun",
        "summary": "Post payroll run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#postPayrollRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "payroll:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/periods": {
      "get": {
        "operationId": "catalogPeriods",
        "summary": "Periods",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#periods",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/BookIdOptional"
          }
        ]
      },
      "post": {
        "operationId": "catalogCreatePeriod",
        "summary": "Create period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#createPeriod",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PeriodCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/periods/{id}": {
      "get": {
        "operationId": "catalogPeriod",
        "summary": "Period",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#period",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/prepaid-schedules": {
      "get": {
        "operationId": "listPrepaidSchedules",
        "summary": "List prepaid schedules",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listPrepaidSchedules",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ]
      },
      "post": {
        "operationId": "createPrepaidSchedules",
        "summary": "Create prepaid schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createPrepaidSchedule",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/prepaid-schedules/{id}": {
      "get": {
        "operationId": "getPrepaidSchedule",
        "summary": "Get prepaid schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getPrepaidSchedule",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updatePrepaidSchedule",
        "summary": "Update prepaid schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updatePrepaidSchedule",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "summary": "List projects",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listProjects",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createProjects",
        "summary": "Create project",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createProject",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/projects/{id}": {
      "get": {
        "operationId": "getProject",
        "summary": "Get project",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getProject",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateProject",
        "summary": "Update project",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateProject",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/purchase-orders": {
      "get": {
        "operationId": "listPurchaseOrders",
        "summary": "List purchase orders",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listPurchaseOrders",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ]
      },
      "post": {
        "operationId": "createPurchaseOrders",
        "summary": "Create purchase order",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createPurchaseOrder",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/purchase-orders/{id}": {
      "get": {
        "operationId": "getPurchaseOrder",
        "summary": "Get purchase order",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getPurchaseOrder",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updatePurchaseOrder",
        "summary": "Update purchase order",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updatePurchaseOrder",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/receipts": {
      "get": {
        "operationId": "listReceipts",
        "summary": "List receipts",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#listReceipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ]
      },
      "post": {
        "operationId": "createReceipts",
        "summary": "Create receipt",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createReceipt",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/receipts/{id}": {
      "get": {
        "operationId": "getReceipt",
        "summary": "Get receipt",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#getReceipt",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateReceipt",
        "summary": "Update receipt",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#updateReceipt",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/receipts/{id}:apply": {
      "post": {
        "operationId": "subledgerApplyReceipt",
        "summary": "Apply receipt",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#applyReceipt",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptApplicationInput"
              }
            }
          }
        }
      }
    },
    "/v1/receipts/{id}:post": {
      "post": {
        "operationId": "subledgerPostReceipt",
        "summary": "Post receipt",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#postReceipt",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ar:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionalApprovalGrantInput"
              }
            }
          }
        }
      }
    },
    "/v1/reconciliations": {
      "get": {
        "operationId": "listReconciliations",
        "summary": "List reconciliations",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#listReconciliations",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ]
      },
      "post": {
        "operationId": "createReconciliations",
        "summary": "Create reconciliation",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#createReconciliation",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/reconciliations/{id}": {
      "get": {
        "operationId": "getReconciliation",
        "summary": "Get reconciliation",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#getReconciliation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateReconciliation",
        "summary": "Update reconciliation",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#updateReconciliation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/reconciliations/{id}:auto-match": {
      "post": {
        "operationId": "autoMatchReconciliation",
        "summary": "Auto match reconciliation",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#autoMatchReconciliation",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:reconcile"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/reconciliations/{id}:certify": {
      "post": {
        "operationId": "certifyReconciliation",
        "summary": "Certify reconciliation",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#certifyReconciliation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "bank:reconcile"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/report-runs": {
      "get": {
        "operationId": "listReportRuns",
        "summary": "List report runs",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listReportRuns",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ]
      },
      "post": {
        "operationId": "createReportRuns",
        "summary": "Create report run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createReportRun",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/report-runs/{id}": {
      "get": {
        "operationId": "getReportRun",
        "summary": "Get report run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getReportRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateReportRun",
        "summary": "Update report run",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateReportRun",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/report-snapshots": {
      "get": {
        "operationId": "listReportSnapshots",
        "summary": "List report snapshots",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#listReportSnapshots",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ]
      },
      "post": {
        "operationId": "createReportSnapshots",
        "summary": "Create report snapshot",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#createReportSnapshot",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:run"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/report-snapshots/{id}": {
      "get": {
        "operationId": "getReportSnapshot",
        "summary": "Get report snapshot",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#getReportSnapshot",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateReportSnapshot",
        "summary": "Update report snapshot",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#updateReportSnapshot",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:run"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/report-snapshots/{id}:verify": {
      "post": {
        "operationId": "verifyReportSnapshot",
        "summary": "Verify report snapshot",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#verifyReportSnapshot",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "approvals:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/reports/balance-sheet": {
      "get": {
        "operationId": "reportingBalanceSheet",
        "summary": "Balance sheet",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#balanceSheet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/PeriodId"
          }
        ]
      }
    },
    "/v1/reports/general-ledger": {
      "get": {
        "operationId": "reportingGeneralLedger",
        "summary": "General ledger",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#generalLedger",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/PeriodId"
          },
          {
            "$ref": "#/components/parameters/AccountIdOptional"
          },
          {
            "$ref": "#/components/parameters/ReportLimit"
          }
        ]
      }
    },
    "/v1/reports/profit-and-loss": {
      "get": {
        "operationId": "reportingProfitAndLoss",
        "summary": "Profit and loss",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#profitAndLoss",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/PeriodId"
          }
        ]
      }
    },
    "/v1/reports/source-reconciliation": {
      "get": {
        "operationId": "reportingSourceReconciliation",
        "summary": "Source reconciliation",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#sourceReconciliation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceReconciliation"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string",
                  "const": "Accept"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Daily source contribution by source-supplied accounting date; no timezone conversion. Inclusive maximum 92 days. JSON requires reports:read; CSV requires reports:export. Explicit format wins; Accept: text/csv applies only when format is absent, otherwise JSON is the default. Responses carry Vary: Accept. External IDs omitted. Counts are decimal integer strings; monetary values have eight decimal places. A single functional currency is required for grandTotal. Four named integrity checks and their AND (reconciled) run in one read-only snapshot. If any check is false, stop accepting the shadow day and escalate with the report and request ID; inspect event/journal links for postedEventsJournaled or noOrphanJournals, and preserve evidence for hash or balance failures. Never edit posted journals. The scope guard admits reports:read or reports:export; the selected representation additionally requires its specific scope (default JSON: reports:read).",
        "x-required-any-scopes": [
          "reports:read",
          "reports:export"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/LegalEntityId"
          },
          {
            "$ref": "#/components/parameters/SourceSystem"
          },
          {
            "$ref": "#/components/parameters/ConnectionId"
          },
          {
            "$ref": "#/components/parameters/FromDate"
          },
          {
            "$ref": "#/components/parameters/ReconciliationTo"
          },
          {
            "$ref": "#/components/parameters/ReconciliationGranularity"
          },
          {
            "$ref": "#/components/parameters/ReconciliationFormat"
          }
        ]
      }
    },
    "/v1/reports/subledger-reconciliation": {
      "get": {
        "operationId": "reportingReconciliation",
        "summary": "Reconciliation",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#reconciliation",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LegalEntityId"
          },
          {
            "$ref": "#/components/parameters/Subledger"
          }
        ]
      }
    },
    "/v1/reports/trial-balance": {
      "get": {
        "operationId": "reportingTrialBalance",
        "summary": "Trial balance",
        "tags": [
          "reporting"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/reporting.controller.ts#trialBalance",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/BookId"
          },
          {
            "$ref": "#/components/parameters/PeriodId"
          }
        ]
      }
    },
    "/v1/revenue-schedules": {
      "get": {
        "operationId": "listRevenueSchedules",
        "summary": "List revenue schedules",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listRevenueSchedules",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ]
      },
      "post": {
        "operationId": "createRevenueSchedules",
        "summary": "Create revenue schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createRevenueSchedule",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/revenue-schedules/{id}": {
      "get": {
        "operationId": "getRevenueSchedule",
        "summary": "Get revenue schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getRevenueSchedule",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateRevenueSchedule",
        "summary": "Update revenue schedule",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateRevenueSchedule",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "assets:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/sandbox": {
      "get": {
        "operationId": "platformGetSandbox",
        "summary": "Get sandbox",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#getSandbox",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sandbox:manage"
        ]
      }
    },
    "/v1/sandboxes/{id}:reset": {
      "post": {
        "operationId": "platformResetSandbox",
        "summary": "Reset sandbox",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#resetSandbox",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sandbox:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/signup": {
      "post": {
        "operationId": "platformSignup",
        "summary": "Signup",
        "tags": [
          "platform"
        ],
        "x-ledgeros-source": "apps/api/src/platform/platform.controller.ts#signup",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-secret-response-paths": [
          "apiKey.value"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupInput"
              }
            }
          }
        }
      }
    },
    "/v1/source-events": {
      "get": {
        "operationId": "listSourceEvents",
        "summary": "List",
        "tags": [
          "sourceevent"
        ],
        "x-ledgeros-source": "apps/api/src/source-events/source-event.controller.ts#list",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/SourceEventStatus"
          },
          {
            "$ref": "#/components/parameters/EventType"
          }
        ]
      },
      "post": {
        "operationId": "createSourceEvents",
        "summary": "Create",
        "tags": [
          "sourceevent"
        ],
        "x-ledgeros-source": "apps/api/src/source-events/source-event.controller.ts#create",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceEventInput"
              }
            }
          }
        }
      }
    },
    "/v1/source-events/batch": {
      "post": {
        "operationId": "sourceEventBatch",
        "summary": "Batch",
        "tags": [
          "sourceevent"
        ],
        "x-ledgeros-source": "apps/api/src/source-events/source-event.controller.ts#batch",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceEventBatchInput"
              }
            }
          }
        }
      }
    },
    "/v1/source-events/{id}": {
      "get": {
        "operationId": "getSourceEvent",
        "summary": "Get",
        "tags": [
          "sourceevent"
        ],
        "x-ledgeros-source": "apps/api/src/source-events/source-event.controller.ts#get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "sources:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/source-events/{id}:reprocess": {
      "post": {
        "operationId": "reprocessSourceEvent",
        "summary": "Reprocess source event",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#reprocessSourceEvent",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "source:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/subledger/{kind}/{id}/held": {
      "get": {
        "operationId": "subledgerReadHeldSubledger",
        "summary": "Read held subledger",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#readHeldSubledger",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldSubledgerReview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply. Requires an authenticated HUMAN with active OWNER, FINANCE_OPERATOR, or APPROVER membership. The journal preparer receives 403 before release; creator separation also applies to bills/invoices only (cash documents have no creator column). AP/AR preparation uses machine credentials, so this is actor separation, not person-to-person maker-checker. expectedPayloadHash is required for approve-post. The document date must match journal effective_date and cash_account_id must occur in the cash journal. Approval, HUMAN grant minting against the APPROVED journal hash, and posting are atomic. Same-human repeats return the original result; different-human repeats after release return 409. Cash documents become RELEASED; their journals become POSTED. Generic journal submit/approve/post/reverse refuse SUBLEDGER and SOURCE_EVENT journals with 409 JOURNAL_MANAGED_BY_SUBLEDGER; that bypass is closed.",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "bills",
                "invoices",
                "payments",
                "receipts"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/subledger/{kind}/{id}:approve-post": {
      "post": {
        "operationId": "subledgerApproveHeldSubledger",
        "summary": "Approve held subledger",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#approveHeldSubledger",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldSubledgerRelease"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-any-scopes": [
          "approvals:approve",
          "ledger:post"
        ],
        "description": "Requires any one of: approvals:approve, ledger:post. All other authorization and business controls still apply. Requires an authenticated HUMAN with active OWNER, FINANCE_OPERATOR, or APPROVER membership. The journal preparer receives 403 before release; creator separation also applies to bills/invoices only (cash documents have no creator column). AP/AR preparation uses machine credentials, so this is actor separation, not person-to-person maker-checker. expectedPayloadHash is required for approve-post. The document date must match journal effective_date and cash_account_id must occur in the cash journal. Approval, HUMAN grant minting against the APPROVED journal hash, and posting are atomic. Same-human repeats return the original result; different-human repeats after release return 409. Cash documents become RELEASED; their journals become POSTED. Generic journal submit/approve/post/reverse refuse SUBLEDGER and SOURCE_EVENT journals with 409 JOURNAL_MANAGED_BY_SUBLEDGER; that bypass is closed.",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "bills",
                "invoices",
                "payments",
                "receipts"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldSubledgerApproveInput"
              }
            }
          }
        }
      }
    },
    "/v1/tax-packages": {
      "get": {
        "operationId": "listTaxPackages",
        "summary": "List tax packages",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listTaxPackages",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:read"
        ]
      },
      "post": {
        "operationId": "createTaxPackages",
        "summary": "Create tax package",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createTaxPackage",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/tax-packages/{id}": {
      "get": {
        "operationId": "getTaxPackage",
        "summary": "Get tax package",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getTaxPackage",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateTaxPackage",
        "summary": "Update tax package",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateTaxPackage",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/tax-packages/{id}:certify": {
      "post": {
        "operationId": "certifyTaxPackage",
        "summary": "Certify tax package",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#certifyTaxPackage",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/tax-returns": {
      "get": {
        "operationId": "listTaxReturns",
        "summary": "List tax returns",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listTaxReturns",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:read"
        ]
      },
      "post": {
        "operationId": "createTaxReturns",
        "summary": "Create tax return",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createTaxReturn",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/tax-returns/{id}": {
      "get": {
        "operationId": "getTaxReturn",
        "summary": "Get tax return",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getTaxReturn",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateTaxReturn",
        "summary": "Update tax return",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateTaxReturn",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/tax-returns/{id}:file": {
      "post": {
        "operationId": "fileTaxReturn",
        "summary": "File tax return",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#fileTaxReturn",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tax:file"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/tenant": {
      "get": {
        "operationId": "catalogTenant",
        "summary": "Tenant",
        "tags": [
          "catalog"
        ],
        "x-ledgeros-source": "apps/api/src/catalog/catalog.controller.ts#tenant",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "tenant:read"
        ]
      }
    },
    "/v1/timesheets": {
      "get": {
        "operationId": "listTimesheets",
        "summary": "List timesheets",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listTimesheets",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "time:read"
        ]
      },
      "post": {
        "operationId": "createTimesheets",
        "summary": "Create timesheet",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createTimesheet",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "time:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/timesheets/{id}": {
      "get": {
        "operationId": "getTimesheet",
        "summary": "Get timesheet",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getTimesheet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "time:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateTimesheet",
        "summary": "Update timesheet",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateTimesheet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "time:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/timesheets/{id}:approve": {
      "post": {
        "operationId": "approveTimesheet",
        "summary": "Approve timesheet",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#approveTimesheet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "time:approve"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/trial-balances": {
      "get": {
        "operationId": "getTrialBalance",
        "summary": "Target trial balance",
        "tags": [
          "controls"
        ],
        "x-ledgeros-source": "apps/api/src/controls/controls.controller.ts#targetTrialBalance",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usageSummary",
        "summary": "Summary",
        "tags": [
          "usage"
        ],
        "x-ledgeros-source": "apps/api/src/usage/usage.controller.ts#summary",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "usage:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/FromDate"
          },
          {
            "$ref": "#/components/parameters/ToDate"
          }
        ]
      }
    },
    "/v1/vendors": {
      "get": {
        "operationId": "listVendors",
        "summary": "List vendors",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#listVendors",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/LegalEntityIdOptional"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ]
      },
      "post": {
        "operationId": "createVendors",
        "summary": "Create vendor",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#createVendor",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/vendors/{id}": {
      "get": {
        "operationId": "getVendor",
        "summary": "Get vendor",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#getVendor",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateVendor",
        "summary": "Update vendor",
        "tags": [
          "subledger"
        ],
        "x-ledgeros-source": "apps/api/src/ledger/subledger.controller.ts#updateVendor",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "ap:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/wbs-nodes": {
      "get": {
        "operationId": "listWbsNodes",
        "summary": "List wbs nodes",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#listWbsNodes",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ]
      },
      "post": {
        "operationId": "createWbsNodes",
        "summary": "Create wbs node",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#createWbsNode",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/wbs-nodes/{id}": {
      "get": {
        "operationId": "getWbsNode",
        "summary": "Get wbs node",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#getWbsNode",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:read"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateWbsNode",
        "summary": "Update wbs node",
        "tags": [
          "domain"
        ],
        "x-ledgeros-source": "apps/api/src/domain/domain.controller.ts#updateWbsNode",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "jobcost:write"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/webhook-dead-letters": {
      "get": {
        "operationId": "webhookDeadLetters",
        "summary": "Dead letters",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#deadLetters",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/EndpointId"
          }
        ]
      }
    },
    "/v1/webhook-deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "Deliveries",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#deliveries",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/DeliveryStatus"
          },
          {
            "$ref": "#/components/parameters/EndpointId"
          }
        ]
      }
    },
    "/v1/webhook-deliveries/{id}:replay": {
      "post": {
        "operationId": "webhookReplay",
        "summary": "Replay",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#replay",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#list",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/WebhookStatus"
          }
        ]
      },
      "post": {
        "operationId": "createWebhookEndpoints",
        "summary": "Create",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#create",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "backfill": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "createdDeliveries": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000,
                          "description": "Deliveries queued as PENDING; sent when webhook dispatch is enabled for your environment."
                        }
                      },
                      "required": [
                        "createdDeliveries"
                      ],
                      "description": "Present when backfillFrom was provided."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "description": "VALIDATION_ERROR: WEBHOOK_BACKFILL_INVALID_RANGE or WEBHOOK_BACKFILL_LIMIT_EXCEEDED; no endpoint or deliveries are committed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Optional backfill on registration; required backfillFrom on the backfill action. Uses inclusive outbox creation time through statement start, at most 168 hours plus 5 minutes ago; future starts up to 5 minutes ahead are clamped to statement start, beyond that 422. Cap: 10,000 matching events for this tenant and endpoint subscriptions per request, including already-queued events. Over-cap requests fail atomically without truncation. Re-requesting never duplicates an original endpoint/event delivery. Arrival order is not guaranteed.",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreateInput"
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{id}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "summary": "Get",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "Update",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#update",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/webhook-endpoints/{id}:backfill": {
      "post": {
        "operationId": "webhookBackfill",
        "summary": "Backfill",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#backfill",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookBackfillResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "description": "VALIDATION_ERROR: WEBHOOK_BACKFILL_INVALID_RANGE or WEBHOOK_BACKFILL_LIMIT_EXCEEDED; no endpoint or deliveries are committed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Optional backfill on registration; required backfillFrom on the backfill action. Uses inclusive outbox creation time through statement start, at most 168 hours plus 5 minutes ago; future starts up to 5 minutes ahead are clamped to statement start, beyond that 422. Cap: 10,000 matching events for this tenant and endpoint subscriptions per request, including already-queued events. Over-cap requests fail atomically without truncation. Re-requesting never duplicates an original endpoint/event delivery. Arrival order is not guaranteed.",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookBackfillInput"
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{id}:disable": {
      "post": {
        "operationId": "webhookDisable",
        "summary": "Disable",
        "tags": [
          "webhook"
        ],
        "x-ledgeros-source": "apps/api/src/webhooks/webhook.controller.ts#disable",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyInput"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "LedgerOS API key or OAuth bearer token"
      }
    },
    "parameters": {
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "ReportLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "AuditCursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "BookId": {
        "name": "bookId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "BookIdOptional": {
        "name": "bookId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "PeriodId": {
        "name": "periodId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "PeriodIdOptional": {
        "name": "periodId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "AccountIdOptional": {
        "name": "accountId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "LegalEntityId": {
        "name": "legalEntityId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "LegalEntityIdOptional": {
        "name": "legalEntityId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "EndpointId": {
        "name": "endpointId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "JournalStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "DRAFT",
            "SUBMITTED",
            "APPROVED",
            "POSTED",
            "REJECTED"
          ]
        }
      },
      "DocumentStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 20
        }
      },
      "SourceEventStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "RECEIVED",
            "VALIDATED",
            "AWAITING_APPROVAL",
            "POSTED",
            "REJECTED",
            "FAILED"
          ]
        }
      },
      "WebhookStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "ACTIVE",
            "DISABLED"
          ]
        }
      },
      "DeliveryStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "PENDING",
            "DELIVERING",
            "DELIVERED",
            "RETRYING",
            "DEAD_LETTER"
          ]
        }
      },
      "Subledger": {
        "name": "subledger",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "AP",
            "AR"
          ]
        }
      },
      "EventType": {
        "name": "eventType",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 120
        }
      },
      "AuditAction": {
        "name": "action",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 120
        }
      },
      "ObjectType": {
        "name": "objectType",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 120
        }
      },
      "ActorId": {
        "name": "actorId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 240
        }
      },
      "FromDateTime": {
        "name": "from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ToDateTime": {
        "name": "to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "FromDate": {
        "name": "from",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "ToDate": {
        "name": "to",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "ConnectionId": {
        "name": "connectionId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "ReconciliationTo": {
        "name": "to",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date",
          "description": "Inclusive; at most 92 days from from."
        }
      },
      "ReconciliationGranularity": {
        "name": "granularity",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "day"
          ],
          "default": "day"
        }
      },
      "ReconciliationFormat": {
        "name": "format",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "json",
            "csv"
          ]
        }
      },
      "ThroughDate": {
        "name": "through",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "ExternalId": {
        "name": "externalId",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        }
      },
      "EventLookupLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "EventLookupOffset": {
        "name": "offset",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2147483647,
          "default": 0
        }
      },
      "ExternalVersion": {
        "name": "externalVersion",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        }
      },
      "SourceSystem": {
        "name": "sourceSystem",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 240
        }
      }
    },
    "schemas": {
      "EmptyInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {}
      },
      "OptionalApprovalGrantInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grantId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DimensionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dimensionId": {
            "type": "string",
            "format": "uuid"
          },
          "dimensionValueId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "dimensionId",
          "dimensionValueId"
        ]
      },
      "JournalLineInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "debit": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "credit": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "memo": {
            "type": "string",
            "maxLength": 2000
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionInput"
            },
            "default": []
          }
        },
        "required": [
          "accountId",
          "currency"
        ],
        "oneOf": [
          {
            "required": [
              "debit"
            ],
            "not": {
              "required": [
                "credit"
              ]
            }
          },
          {
            "required": [
              "credit"
            ],
            "not": {
              "required": [
                "debit"
              ]
            }
          }
        ]
      },
      "JournalCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "entityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "periodId": {
            "type": "string",
            "format": "uuid"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "memo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "lines": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/JournalLineInput"
            }
          }
        },
        "required": [
          "entityId",
          "bookId",
          "periodId",
          "effectiveDate",
          "memo",
          "lines"
        ]
      },
      "JournalReverseInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "periodId": {
            "type": "string",
            "format": "uuid"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "periodId",
          "effectiveDate",
          "reason"
        ]
      },
      "JournalLineRead": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "lineNo": {
            "type": "integer",
            "minimum": 1
          },
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "debit": {
            "type": "string",
            "pattern": "^\\d+(?:\\.\\d{1,8})?$"
          },
          "credit": {
            "type": "string",
            "pattern": "^\\d+(?:\\.\\d{1,8})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "memo": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionInput"
            }
          }
        },
        "required": [
          "id",
          "lineNo",
          "accountId",
          "debit",
          "credit",
          "currency",
          "dimensions"
        ]
      },
      "JournalRead": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "entityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "periodId": {
            "type": "string",
            "format": "uuid"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "memo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "SUBMITTED",
              "APPROVED",
              "POSTED",
              "REJECTED"
            ]
          },
          "entryType": {
            "type": "string",
            "description": "Open journal lifecycle type: ledger.journal_entries.entry_type is unconstrained text. Current API and provisioning writers use MANUAL, REVERSAL, SANDBOX_SEED, SUBLEDGER, SOURCE_EVENT and SOURCE_REVERSAL; legacy SQL fixtures also use AP_BILL and AP_PAYMENT. Other values may be returned. The generic routes refuse exactly SUBLEDGER, SOURCE_EVENT and SOURCE_REVERSAL with 409 JOURNAL_MANAGED_BY_SUBLEDGER; these use their owning sub-ledger or accounting-event workflow. Every other type remains eligible for generic actions, subject to status, authorization and approval controls."
          },
          "preparedByActorId": {
            "type": "string"
          },
          "approvedByActorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "requiresSeparateApprover": {
            "type": "boolean"
          },
          "contentHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$"
          },
          "reversalOfId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "sourceSubledger": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "AP",
              "AR",
              null
            ],
            "description": "The sub-ledger this journal was raised in. Set on SUBLEDGER journals, on SOURCE_EVENT and SOURCE_REVERSAL journals produced by an external event, and on a REVERSAL that mirrors its original."
          },
          "sourceEventId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The accounting event that owns this journal's release. Present on SOURCE_EVENT and SOURCE_REVERSAL journals."
          },
          "sourceDocumentKind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bills",
              "invoices",
              "payments",
              "receipts",
              null
            ],
            "description": "The held-document collection the source document lives in, resolved by looking sourceDocumentId up in ap.bills, ap.payments, ar.invoices and ar.receipts within the caller's tenant. Null on a non-SUBLEDGER journal, and null when the reference does not resolve to a document of this tenant."
          },
          "sourceDocumentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The held sub-ledger document that owns this journal, held under GET /v1/subledger/{kind}/{id}/held and released with POST /v1/subledger/{kind}/{id}:approve-post. Null when the journal is not sub-ledger managed or its reference is not a document id."
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalLineRead"
            }
          },
          "approvalRequestId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Present only when a policy threshold left the entry awaiting an approval request instead of posting."
          }
        },
        "required": [
          "id",
          "entityId",
          "bookId",
          "periodId",
          "effectiveDate",
          "memo",
          "status",
          "entryType",
          "preparedByActorId",
          "requiresSeparateApprover",
          "version",
          "lines"
        ]
      },
      "JournalList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalRead"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "data"
        ]
      },
      "OAuthTokenInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "client_credentials"
          },
          "client_id": {
            "type": "string",
            "minLength": 12,
            "maxLength": 200
          },
          "client_secret": {
            "type": "string",
            "minLength": 32,
            "maxLength": 500
          },
          "scope": {
            "type": "string",
            "maxLength": 2000
          }
        },
        "required": [
          "grant_type",
          "client_id",
          "client_secret"
        ]
      },
      "OAuthTokenResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "minimum": 1
          },
          "scope": {
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ]
      },
      "CredentialCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "environment": {
            "type": "string",
            "enum": [
              "LIVE",
              "SANDBOX"
            ]
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "account:read",
                "account:write",
                "account:billing",
                "account:security",
                "account:support",
                "ledger:read",
                "ledger:draft",
                "ledger:post",
                "ledger:reverse",
                "approvals:request",
                "approvals:approve",
                "sources:write",
                "sources:read",
                "source:read",
                "source:write",
                "source:sync",
                "documents:read",
                "documents:write",
                "reports:read",
                "reports:run",
                "reports:export",
                "ap:read",
                "ap:write",
                "ap:approve",
                "ap:pay",
                "ar:read",
                "ar:write",
                "bank:read",
                "bank:write",
                "bank:reconcile",
                "payroll:read",
                "payroll:write",
                "time:read",
                "time:write",
                "time:approve",
                "jobcost:read",
                "jobcost:write",
                "rates:approve",
                "assets:read",
                "assets:write",
                "close:read",
                "close:write",
                "close:certify",
                "tax:read",
                "tax:prepare",
                "tax:approve",
                "tax:file",
                "ai:read",
                "ai:review",
                "ai:policy",
                "tenant:read",
                "tenant:write",
                "coa:read",
                "coa:write",
                "audit:read",
                "audit:export",
                "access:read",
                "access:grant",
                "webhooks:manage",
                "usage:read",
                "keys:manage",
                "sandbox:manage"
              ]
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "environment",
          "scopes"
        ]
      },
      "SignupInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "organizationName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "coaTemplate": {
            "type": "string",
            "enum": [
              "STARTUP",
              "PROFESSIONAL_SERVICES",
              "CONTRACTOR"
            ]
          }
        },
        "required": [
          "email",
          "displayName",
          "organizationName",
          "legalName",
          "currency",
          "coaTemplate"
        ]
      },
      "LiveBusinessInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "ISO 4217 currency code"
          },
          "fiscalYearStartMonth": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "firstPeriod": {
            "type": "string",
            "pattern": "^[1-9][0-9]{3}-(0[1-9]|1[0-2])$",
            "description": "Defaults to the current month"
          }
        },
        "required": [
          "legalName",
          "currency",
          "fiscalYearStartMonth"
        ]
      },
      "LiveBusiness": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "periodId": {
            "type": "string",
            "format": "uuid"
          },
          "environment": {
            "const": "LIVE"
          }
        },
        "required": [
          "tenantId",
          "legalEntityId",
          "bookId",
          "periodId",
          "environment"
        ]
      },
      "BusinessList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "tenantId": {
                  "type": "string",
                  "format": "uuid"
                },
                "environment": {
                  "enum": [
                    "LIVE",
                    "SANDBOX"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "tenantId",
                "environment",
                "status",
                "createdAt"
              ]
            }
          },
          "allowance": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "allowed": {
                "type": "boolean"
              },
              "reason": {
                "enum": [
                  "ALLOWED",
                  "SUBSCRIPTION_REQUIRED",
                  "LIMIT_REACHED",
                  "SUBSCRIPTION_PLAN_UNMAPPED",
                  "SUBSCRIPTION_ENDED",
                  "SUBSCRIPTION_PAUSED",
                  "SUBSCRIPTION_UNPAID",
                  "SUBSCRIPTION_CANCELED",
                  "SUBSCRIPTION_INCOMPLETE",
                  "SUBSCRIPTION_INACTIVE",
                  "PAST_DUE",
                  "ACCOUNT_SUSPENDED",
                  "ACCOUNT_CLOSED"
                ]
              },
              "included": {
                "type": "integer"
              },
              "current": {
                "type": "integer"
              }
            },
            "required": [
              "allowed",
              "reason",
              "included",
              "current"
            ]
          }
        },
        "required": [
          "data",
          "allowance"
        ]
      },
      "CommercialAccountSignupInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "organizationName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "legalName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 240
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "coaTemplate": {
            "type": "string",
            "enum": [
              "STARTUP",
              "PROFESSIONAL_SERVICES",
              "CONTRACTOR"
            ]
          },
          "termsAccepted": {
            "type": "boolean",
            "const": true
          },
          "marketingConsent": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "displayName",
          "organizationName",
          "legalName",
          "currency",
          "coaTemplate",
          "termsAccepted"
        ]
      },
      "InvitationAcceptInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token": {
            "type": "string",
            "minLength": 43,
            "maxLength": 128
          },
          "displayName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          }
        },
        "required": [
          "token",
          "displayName"
        ]
      },
      "CommercialAccountUpdateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "legalName": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 240
          },
          "billingEmail": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "InvitationCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "BILLING_ADMIN",
              "SECURITY_ADMIN",
              "DEVELOPER",
              "FINANCE_OPERATOR",
              "APPROVER",
              "REVIEWER",
              "VIEWER"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ]
      },
      "MembershipUpdateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "OWNER",
              "BILLING_ADMIN",
              "SECURITY_ADMIN",
              "DEVELOPER",
              "FINANCE_OPERATOR",
              "APPROVER",
              "REVIEWER",
              "VIEWER"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "SUSPENDED"
            ]
          }
        }
      },
      "SupportCaseCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 8,
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "minLength": 20,
            "maxLength": 10000
          },
          "priority": {
            "type": "string",
            "enum": [
              "LOW",
              "NORMAL",
              "HIGH",
              "URGENT"
            ],
            "default": "NORMAL"
          }
        },
        "required": [
          "subject",
          "description"
        ]
      },
      "BillingCheckoutInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "planCode": {
            "type": "string",
            "enum": [
              "LAUNCH",
              "GROWTH"
            ]
          },
          "interval": {
            "type": "string",
            "enum": [
              "MONTH",
              "YEAR"
            ]
          }
        },
        "required": [
          "planCode",
          "interval"
        ]
      },
      "MarketingLeadInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 160
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "company": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "role": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "useCase": {
            "type": "string",
            "minLength": 20,
            "maxLength": 4000
          },
          "sourcePath": {
            "type": "string",
            "maxLength": 1000
          },
          "consent": {
            "type": "boolean",
            "const": true
          },
          "website": {
            "type": "string",
            "maxLength": 0
          }
        },
        "required": [
          "name",
          "email",
          "company",
          "role",
          "useCase",
          "sourcePath",
          "consent",
          "website"
        ]
      },
      "ApprovalRequestInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "objectType": {
            "type": "string"
          },
          "objectId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "payloadHash": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "objectType",
          "objectId",
          "action",
          "payloadHash"
        ]
      },
      "ApprovalDecisionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ttlSeconds": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "ttlSeconds"
        ]
      },
      "ApprovalRevokeInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "LegalEntityCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "displayName": {
            "type": "string",
            "maxLength": 200
          },
          "baseCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "legalName",
          "baseCurrency"
        ]
      },
      "BookCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "basis": {
            "type": "string",
            "enum": [
              "GAAP_ACCRUAL",
              "CASH",
              "TAX",
              "MANAGEMENT",
              "GOVERNMENT_COST",
              "STATUTORY",
              "CONSOLIDATION"
            ]
          },
          "functionalCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "legalEntityId",
          "name",
          "basis",
          "functionalCurrency"
        ]
      },
      "PeriodCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "periodKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "bookId",
          "periodKey",
          "startDate",
          "endDate"
        ]
      },
      "AccountCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "parentId": {
            "type": "string",
            "format": "uuid"
          },
          "accountType": {
            "type": "string",
            "enum": [
              "ASSET",
              "LIABILITY",
              "EQUITY",
              "REVENUE",
              "EXPENSE",
              "CONTRA_ASSET",
              "CONTRA_LIABILITY",
              "CONTRA_REVENUE",
              "STATISTICAL"
            ]
          },
          "normalBalance": {
            "type": "string",
            "enum": [
              "DEBIT",
              "CREDIT"
            ]
          },
          "canonicalTaxonomyCode": {
            "type": "string",
            "maxLength": 120
          },
          "manualPostingAllowed": {
            "type": "boolean",
            "description": "Defaults to true. Always false on a designated AP/AR control account; true there is refused with 422."
          },
          "controlSubledger": {
            "type": "string",
            "enum": [
              "AP",
              "AR"
            ]
          }
        },
        "required": [
          "bookId",
          "code",
          "name",
          "accountType",
          "normalBalance"
        ]
      },
      "VendorCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "paymentTerms": {
            "type": "string",
            "maxLength": 200
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "BLOCKED"
            ]
          },
          "defaultExpenseAccountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "legalEntityId",
          "code",
          "name"
        ]
      },
      "CustomerCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "paymentTerms": {
            "type": "string",
            "maxLength": 200
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "BLOCKED"
            ]
          },
          "defaultRevenueAccountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "legalEntityId",
          "code",
          "name"
        ]
      },
      "BillCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "totalAmount": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "controlAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4000
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                },
                "dimensions": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "required": [
                "description",
                "accountId",
                "amount"
              ]
            }
          },
          "vendorId": {
            "type": "string",
            "format": "uuid"
          },
          "billNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "billDate": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "legalEntityId",
          "bookId",
          "vendorId",
          "billNumber",
          "billDate",
          "dueDate",
          "currency",
          "totalAmount",
          "controlAccountId",
          "lines"
        ]
      },
      "InvoiceCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "dueDate": {
            "type": "string",
            "format": "date"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "totalAmount": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "controlAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4000
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                },
                "dimensions": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "required": [
                "description",
                "accountId",
                "amount"
              ]
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "invoiceNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "invoiceDate": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "legalEntityId",
          "bookId",
          "customerId",
          "invoiceNumber",
          "invoiceDate",
          "dueDate",
          "currency",
          "totalAmount",
          "controlAccountId",
          "lines"
        ]
      },
      "PaymentCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "vendorId": {
            "type": "string",
            "format": "uuid"
          },
          "paymentDate": {
            "type": "string",
            "format": "date"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "method": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "cashAccountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "legalEntityId",
          "vendorId",
          "paymentDate",
          "amount",
          "currency",
          "method"
        ]
      },
      "ReceiptCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "receiptDate": {
            "type": "string",
            "format": "date"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "method": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "cashAccountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "legalEntityId",
          "customerId",
          "receiptDate",
          "amount",
          "currency",
          "method"
        ]
      },
      "PaymentApplicationInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "applications": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "billId": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                }
              },
              "required": [
                "billId",
                "amount"
              ]
            }
          }
        },
        "required": [
          "applications"
        ]
      },
      "ReceiptApplicationInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "applications": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ]
            }
          }
        },
        "required": [
          "applications"
        ]
      },
      "ApprovalDecision": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "string",
            "enum": [
              "AUTO",
              "DECLARED",
              "HUMAN"
            ]
          },
          "policyVersion": {
            "type": [
              "integer",
              "null"
            ]
          },
          "policyVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "approvedByActorId": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "maximumAmount": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
          }
        },
        "required": [
          "path",
          "policyVersion"
        ]
      },
      "HeldEventReview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceEventId": {
            "type": "string",
            "format": "uuid"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          },
          "payloadHash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "sourceEventId",
          "payload",
          "payloadHash",
          "result"
        ]
      },
      "HeldSubledgerApproveInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedPayloadHash": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "Required SUBMITTED journal content hash returned by the reviewer read. A mismatch returns 409."
          }
        },
        "required": [
          "expectedPayloadHash"
        ]
      },
      "HeldSubledgerReview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "applications": {
            "type": "array",
            "description": "Payments: billId and amount; receipts: invoiceId and amount. Decimal amounts are strings. Empty for bills/invoices.",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "billId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "amount": {
                      "type": "string",
                      "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                    }
                  },
                  "required": [
                    "billId",
                    "amount"
                  ]
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "invoiceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "amount": {
                      "type": "string",
                      "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                    }
                  },
                  "required": [
                    "invoiceId",
                    "amount"
                  ]
                }
              ]
            }
          },
          "document": {
            "type": "object",
            "additionalProperties": true
          },
          "journalEntryId": {
            "type": "string",
            "format": "uuid"
          },
          "preparedByActorId": {
            "type": "string"
          },
          "payloadHash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "lineNo": {
                  "type": "integer"
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "debit": {
                  "type": "string",
                  "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                },
                "credit": {
                  "type": "string",
                  "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                },
                "currency": {
                  "type": "string"
                },
                "memo": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "dimensions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "required": [
                "id",
                "lineNo",
                "accountId",
                "debit",
                "credit",
                "currency",
                "memo",
                "dimensions"
              ]
            }
          }
        },
        "required": [
          "document",
          "journalEntryId",
          "preparedByActorId",
          "payloadHash",
          "lines",
          "applications"
        ]
      },
      "HeldSubledgerRelease": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "documentId": {
            "type": "string",
            "format": "uuid"
          },
          "journalEntryId": {
            "type": "string",
            "format": "uuid"
          },
          "grantId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "const": "POSTED",
            "description": "Journal status; cash document status becomes RELEASED."
          },
          "approvalPath": {
            "type": "string",
            "const": "HUMAN"
          },
          "approvedByActorId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "reviewedPayloadHash": {
            "type": "string"
          },
          "contentHash": {
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "journalEntryId",
          "grantId",
          "status",
          "approvalPath",
          "approvedByActorId",
          "action",
          "reviewedPayloadHash",
          "contentHash"
        ]
      },
      "HeldEventApproveInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedPayloadHash": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$"
          }
        }
      },
      "HeldEventRejectInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        },
        "required": [
          "reason"
        ]
      },
      "HeldEventRejection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceEventId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "REJECTED"
            ]
          },
          "reason": {
            "type": "string"
          },
          "rejectedByActorId": {
            "type": "string"
          }
        },
        "required": [
          "sourceEventId",
          "bookId",
          "status",
          "reason",
          "rejectedByActorId"
        ]
      },
      "AccountingEventResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceEventId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "POSTED",
              "AWAITING_APPROVAL"
            ]
          },
          "approval": {
            "$ref": "#/components/schemas/ApprovalDecision"
          },
          "objectType": {
            "type": "string"
          },
          "objectId": {
            "type": "string",
            "format": "uuid"
          },
          "journalEntryId": {
            "type": "string",
            "format": "uuid"
          },
          "contentHash": {
            "type": "string"
          }
        },
        "required": [
          "sourceEventId",
          "bookId",
          "status"
        ]
      },
      "ApprovalPolicyRule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventType": {
            "type": "string",
            "enum": [
              "ar.invoice.approved",
              "ar.invoice.reversal_approved",
              "ar.receipt.reconciled",
              "ap.bill.approved",
              "payroll.accrual.approved",
              "gl.adjustment.approved",
              "ap.bill.post",
              "ar.invoice.post",
              "ar.receipt.post",
              "ap.payment.post"
            ]
          },
          "effectKind": {
            "type": "string",
            "enum": [
              "AR_INVOICE",
              "AR_CREDIT_MEMO",
              "AR_RECEIPT",
              "AP_BILL",
              "AP_PAYMENT",
              "JOURNAL"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "maximumAmount": {
            "type": "string",
            "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
          }
        },
        "required": [
          "eventType",
          "currency",
          "maximumAmount"
        ]
      },
      "ApprovalPolicyVersion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalPolicyRule"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdByIdentityId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id",
          "version",
          "enabled",
          "rules"
        ]
      },
      "ApprovalPolicyList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalPolicyVersion"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ApprovalPolicyInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "rules": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ApprovalPolicyRule"
            }
          }
        },
        "required": [
          "rules"
        ]
      },
      "AccountingEventLookupResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "sourceEventId": {
                  "type": "string",
                  "format": "uuid"
                },
                "externalVersion": {
                  "type": "string"
                },
                "connectionId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "status": {
                  "type": "string"
                },
                "objectType": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "objectId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "journalEntryId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "contentHash": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "approval": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ApprovalDecision"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "sourceEventId",
                "externalVersion",
                "connectionId",
                "status",
                "objectType",
                "objectId",
                "journalEntryId",
                "contentHash"
              ]
            }
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        },
        "required": [
          "data",
          "nextOffset"
        ]
      },
      "ReconciliationAmount": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "currency": {
            "type": "string"
          },
          "debit": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
          },
          "credit": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
          },
          "netDebitBalance": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
          }
        },
        "required": [
          "accountId",
          "currency",
          "debit",
          "credit",
          "netDebitBalance"
        ]
      },
      "SourceReconciliation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timeBasis": {
            "type": "string"
          },
          "postedEventsJournaled": {
            "type": "boolean",
            "description": "Every POSTED event has exactly one POSTED journal with the same source event, book and effective date."
          },
          "noOrphanJournals": {
            "type": "boolean",
            "description": "Every included posted journal is linked to a POSTED event."
          },
          "journalHashesVerified": {
            "type": "boolean",
            "description": "Each included journal content hash matches a fresh recomputation."
          },
          "journalsBalanced": {
            "type": "boolean",
            "description": "Each included journal balances separately per functional currency."
          },
          "reconciled": {
            "type": "boolean",
            "description": "AND of all four integrity checks in the same snapshot; not a comparison with external source totals."
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "accountId": {
                  "type": "string",
                  "format": "uuid"
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                },
                "debit": {
                  "type": "string",
                  "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                },
                "credit": {
                  "type": "string",
                  "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                },
                "netDebitBalance": {
                  "type": "string",
                  "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
                }
              },
              "required": [
                "day",
                "accountId",
                "currency",
                "debit",
                "credit",
                "netDebitBalance"
              ]
            }
          },
          "totals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReconciliationAmount"
            }
          },
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "posted": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "rejected": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "failed": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "pending": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                }
              },
              "required": [
                "day",
                "posted",
                "rejected",
                "failed",
                "pending"
              ]
            }
          },
          "grandTotal": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "debit": {
                "type": "string",
                "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
              },
              "credit": {
                "type": "string",
                "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
              },
              "netDebitBalance": {
                "type": "string",
                "pattern": "^-?\\d+(?:\\.\\d{1,8})?$"
              }
            },
            "required": [
              "debit",
              "credit",
              "netDebitBalance"
            ]
          }
        },
        "required": [
          "timeBasis",
          "postedEventsJournaled",
          "noOrphanJournals",
          "journalHashesVerified",
          "journalsBalanced",
          "reconciled",
          "data",
          "totals",
          "days",
          "grandTotal"
        ]
      },
      "SourceEventInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "schemaVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "eventType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "sourceSystem": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "externalVersion": {
            "type": "string",
            "maxLength": 120
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 240
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "correlationId": {
            "type": "string",
            "maxLength": 240
          },
          "causationId": {
            "type": "string",
            "maxLength": 240
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          },
          "controlTotals": {
            "type": "object",
            "additionalProperties": true
          },
          "dimensionHints": {
            "type": "object",
            "additionalProperties": true
          },
          "sourceSignature": {
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": [
          "legalEntityId",
          "schemaVersion",
          "eventType",
          "sourceSystem",
          "externalId",
          "idempotencyKey",
          "occurredAt",
          "effectiveDate",
          "payload",
          "controlTotals"
        ]
      },
      "AccountingEventInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceSystem": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid"
          },
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "eventType": {
            "type": "string",
            "enum": [
              "ar.invoice.approved",
              "ar.invoice.reversal_approved",
              "ar.receipt.reconciled",
              "ap.bill.approved",
              "payroll.accrual.approved",
              "gl.adjustment.approved"
            ]
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "externalVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "correlationId": {
            "type": "string",
            "maxLength": 240
          },
          "causationId": {
            "type": "string",
            "maxLength": 240
          },
          "controlTotals": {
            "type": "object",
            "additionalProperties": true
          },
          "approval": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "preparedByActorId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240
              },
              "approvedByActorId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 240,
                "not": {
                  "pattern": "^[pP][oO][lL][iI][cC][yY]:[0-9a-fA-F-]{36}@[0-9]+$"
                }
              },
              "approvedAt": {
                "type": "string",
                "format": "date-time"
              },
              "evidence": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "preparedByActorId",
              "evidence"
            ]
          },
          "effect": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "AR_INVOICE"
                  },
                  "customer": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "paymentTerms": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "code",
                      "name"
                    ]
                  },
                  "invoiceNumber": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "invoiceDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "dueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "grossAmount": {
                    "type": "string",
                    "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                  },
                  "deductionCreditAmount": {
                    "type": "string",
                    "pattern": "^\\d+(?:\\.\\d{1,8})?$"
                  },
                  "netAmount": {
                    "type": "string",
                    "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                  },
                  "arAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "revenueAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "deductionAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "dimensions": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "dimensionCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "valueCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "valueName": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "dimensionCode",
                        "valueCode",
                        "valueName"
                      ]
                    },
                    "default": []
                  }
                },
                "required": [
                  "kind",
                  "customer",
                  "invoiceNumber",
                  "invoiceDate",
                  "dueDate",
                  "currency",
                  "grossAmount",
                  "deductionCreditAmount",
                  "netAmount",
                  "arAccountCode",
                  "revenueAccountCode",
                  "deductionAccountCode",
                  "description",
                  "dimensions"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "AR_CREDIT_MEMO"
                  },
                  "reversesExternalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 240
                  },
                  "reversesExternalVersion": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "creditMemoNumber": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "creditDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  }
                },
                "required": [
                  "kind",
                  "reversesExternalId",
                  "creditMemoNumber",
                  "creditDate",
                  "reason"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "AR_RECEIPT"
                  },
                  "invoiceExternalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 240
                  },
                  "invoiceExternalVersion": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "receiptDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "method": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "cashAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "kind",
                  "invoiceExternalId",
                  "receiptDate",
                  "amount",
                  "currency",
                  "method",
                  "cashAccountCode"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "AP_BILL"
                  },
                  "vendor": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "paymentTerms": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "code",
                      "name"
                    ]
                  },
                  "billNumber": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "billDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "dueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "totalAmount": {
                    "type": "string",
                    "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                  },
                  "apAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expenseAccountCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "dimensions": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "dimensionCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "valueCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "valueName": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "dimensionCode",
                        "valueCode",
                        "valueName"
                      ]
                    },
                    "default": []
                  }
                },
                "required": [
                  "kind",
                  "vendor",
                  "billNumber",
                  "billDate",
                  "dueDate",
                  "currency",
                  "totalAmount",
                  "apAccountCode",
                  "expenseAccountCode",
                  "description",
                  "dimensions"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "JOURNAL"
                  },
                  "sourceSubledger": {
                    "type": "string",
                    "enum": [
                      "PAYROLL",
                      "ADJUSTMENT"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "memo": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "lines": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "accountCode": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "debit": {
                          "type": "string",
                          "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                        },
                        "credit": {
                          "type": "string",
                          "pattern": "^(?!0+(?:\\.0+)?$)\\d+(?:\\.\\d{1,8})?$"
                        },
                        "memo": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "dimensions": {
                          "type": "array",
                          "maxItems": 20,
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "dimensionCode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              },
                              "valueCode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              },
                              "valueName": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 500
                              }
                            },
                            "required": [
                              "dimensionCode",
                              "valueCode",
                              "valueName"
                            ]
                          },
                          "default": []
                        }
                      },
                      "required": [
                        "accountCode",
                        "memo"
                      ],
                      "oneOf": [
                        {
                          "required": [
                            "debit"
                          ],
                          "not": {
                            "required": [
                              "credit"
                            ]
                          }
                        },
                        {
                          "required": [
                            "credit"
                          ],
                          "not": {
                            "required": [
                              "debit"
                            ]
                          }
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "kind",
                  "sourceSubledger",
                  "currency",
                  "memo",
                  "lines"
                ]
              }
            ],
            "discriminator": {
              "propertyName": "kind"
            }
          }
        },
        "required": [
          "sourceSystem",
          "legalEntityId",
          "bookId",
          "schemaVersion",
          "eventType",
          "externalId",
          "externalVersion",
          "occurredAt",
          "effectiveDate",
          "controlTotals",
          "approval",
          "effect"
        ]
      },
      "AccountingProfileInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "type": "string",
            "const": "GOVERNMENT_CONTRACTOR"
          },
          "sourceSystem": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "profile",
          "sourceSystem",
          "legalEntityId",
          "bookId"
        ]
      },
      "ProductPackSelectionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "UNIVERSAL_SMB",
              "FIELD_SERVICES",
              "GOVERNMENT_CONTRACTOR",
              "PAYMENTS_AND_SUBSCRIPTIONS"
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$"
          }
        },
        "required": [
          "code",
          "version"
        ]
      },
      "ProductPackInstallInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceSystem": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "legalEntityId": {
            "type": "string",
            "format": "uuid"
          },
          "bookId": {
            "type": "string",
            "format": "uuid"
          },
          "packs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/ProductPackSelectionInput"
            }
          }
        },
        "required": [
          "sourceSystem",
          "legalEntityId",
          "bookId",
          "packs"
        ]
      },
      "WebhookBackfillResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "endpointId": {
            "type": "string",
            "format": "uuid"
          },
          "createdDeliveries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          }
        },
        "required": [
          "endpointId",
          "createdDeliveries"
        ]
      },
      "WebhookBackfillInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "backfillFrom": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive outbox creation time; at most 168 hours plus 5 minutes ago; future starts up to 5 minutes ahead are clamped to statement start, beyond that 422. Maximum 10,000 matching tenant events per request, otherwise 422."
          }
        },
        "required": [
          "backfillFrom"
        ]
      },
      "WebhookEndpointCreateInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "backfillFrom": {
            "type": "string",
            "format": "date-time",
            "description": "Opt-in backfill in the creation transaction. At most 168 hours plus 5 minutes ago; future starts up to 5 minutes ahead are clamped to statement start, beyond that 422; maximum 10,000 matching tenant events, otherwise 422 and endpoint creation rolls back."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "eventTypes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        },
        "required": [
          "name",
          "url",
          "eventTypes"
        ]
      },
      "AccountUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "periodStart": {
            "type": "string",
            "format": "date-time"
          },
          "periodEnd": {
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "string",
            "enum": [
              "ACCOUNT",
              "TENANT"
            ]
          },
          "includedWrites": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "usedWrites": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "includedBusinesses": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "liveBusinesses": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "overageWrites": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "overageBusinesses": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "projectedWriteOverageCents": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d+$"
          },
          "projectedBusinessOverageCents": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "periodStart",
          "periodEnd",
          "scope",
          "includedWrites",
          "usedWrites",
          "includedBusinesses",
          "liveBusinesses",
          "overageWrites",
          "overageBusinesses",
          "projectedWriteOverageCents",
          "projectedBusinessOverageCents",
          "currency"
        ]
      },
      "GenericObject": {
        "type": "object",
        "additionalProperties": true
      },
      "ErrorEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "help_uri": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "retryable": {
                "type": "boolean"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "required": [
              "code",
              "message",
              "request_id"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "SourceEventBatchInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SourceEventInput"
            }
          }
        },
        "required": [
          "events"
        ]
      }
    },
    "responses": {
      "UnprocessableEntity": {
        "description": "ACCOUNTING_INVARIANT_VIOLATION: accounting invariants or foreign-key violations (SQLSTATE 23503). A referenced resource does not exist or is unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Error": {
        "description": "LedgerOS error envelope",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    }
  }
}
