{
  "openapi": "3.1.0",
  "info": {
    "title": "Budget Go Finance, Workbench & Account API",
    "version": "4.0.0",
    "description": "Exact integer-poisha BDT finance, manual asset/debt positions, dated valuations, reversible transfer matching, staged CSV/reconciliation, deliberate rules, planning and Bangladesh alert inbox. V4 workspace is authoritative; historical V3 rejects states it cannot represent. Planning and automation remain at their V3 URLs and share the same revision. No FX, live prices, background rule posting or external bank access. Profile/security/full backup are browser-session-only and unavailable through bearer/MCP.",
    "license": {
      "name": "MIT",
      "url": "https://github.com/creativekamrul/budget-go/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "http://127.0.0.1:3000",
      "description": "Local development; configure trusted origin and HTTPS for hosting"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    },
    {
      "SessionCookie": []
    }
  ],
  "paths": {
    "/api/v3/workspace": {
      "get": {
        "operationId": "getWorkspace",
        "summary": "Read the complete authenticated workspace",
        "responses": {
          "200": {
            "description": "Complete current owned workspace. Account balances are derived from opening balances and dated effects; transfers are neutral in consolidated cash flow. Export only: no whole-workspace restore endpoint in this MVP.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceData"
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Workspace"
        ],
        "description": "Historical bank/cash/mobile schema3; returns409 VERSION_UPGRADE_REQUIRED if families, dated valuations or matching cannot be represented. New integrations should use V4."
      },
      "post": {
        "operationId": "mutateWorkspace",
        "summary": "Apply one owned financial or classification command, including split/bulk/copy",
        "description": "Requires finance:write. Browser-cookie writes require matching Origin; bearer auth never falls back to cookies. Read current revision first. Every new command uses a fresh requestId. After an unknown outcome retry the exact same command/requestId; it returns current state without reapplying. Reusing an ID for another command returns 409. A stale revision with a new requestId returns 409; reload and review before a new write. Deletions require intentional user action. Selected transaction batches contain1–100 unique IDs and commit all-or-nothing. Bulk amount/account/type changes are not supported. Splits contain2–20 positive parts summing exactly to the original amount; first part retains the original ID and all parts retain account/date/type/status and metadata. A split audit is historical, not another posting. Re-splitting an already grouped part is rejected. budget_copy requires distinct source/target months and an empty target month's category budgets; it never silently overwrites targets or copies transactions. Historical schema3 only. Unsupported V4 state returns409 rather than dropping fields.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "expectedRevision",
                  "requestId",
                  "command"
                ],
                "properties": {
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "requestId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "command": {
                    "$ref": "#/components/schemas/WorkspaceCommand"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete current owned workspace. Account balances are derived from opening balances and dated effects; transfers are neutral in consolidated cash flow. Export only: no whole-workspace restore endpoint in this MVP.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceData"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Workspace"
        ]
      }
    },
    "/api/v3/automation": {
      "get": {
        "tags": [
          "Automation"
        ],
        "operationId": "getAutomation",
        "summary": "Read owned preferences, sources and one inbox page",
        "description": "Requires finance:read. Returns up to 200 events plus eventTotal and nextCursor. Follow the owned cursor for subsequent pages. Not a full inbox export. No financial writes.",
        "parameters": [
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Owned event ID returned as nextCursor from the preceding page.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Owned automation snapshot; nextCursor is null at the end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Automation"
        ],
        "operationId": "mutateAutomation",
        "summary": "Update preferences/sources or review an inbox event",
        "description": "Requires finance:write and current shared revision. New commands use fresh requestId; after an unknown outcome replay the identical envelope. event_accept requires a complete valid reviewed draft and explicit duplicate acknowledgement when a candidate exists. Transaction creation, provenance link, revision and receipt are atomic. Accepted events cannot produce another entry; edit the financial entry instead. Saving raw retention off purges stored raw inbox text.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current saved automation snapshot after the command or exact replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v3/ingest": {
      "post": {
        "tags": [
          "Automation"
        ],
        "operationId": "ingestAlert",
        "summary": "Idempotently stage an alert without posting money",
        "description": "Requires finance:write and enabled automation/source. Supply rawText or a structured partial draft. Explicit draft fields override conservative parser fields; missing/ambiguous values require review. All IDs are same-owner references. Same source/externalId/body returns existing event; changed body returns409. No expectedRevision is required for ingestion. Source/automation pause is enforced even on replay; reads can inspect the saved event. Maximum 100 sources, 2000 events and 16000 raw text characters per event.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Staged or replayed event. No transaction has been posted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revision",
                    "event",
                    "replayed"
                  ],
                  "properties": {
                    "revision": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "event": {
                      "$ref": "#/components/schemas/AutomationEvent"
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v3/automation/parse": {
      "post": {
        "tags": [
          "Automation"
        ],
        "operationId": "parseAlert",
        "summary": "Preview conservative Bangladesh alert extraction",
        "description": "Requires finance:read; cookie requests still require the configured Origin for this POST. Does not create an event or transaction. Recognized OTP/security text is rejected. Bengali digits normalize; explicit unambiguous BDT amounts and four-digit-year dates can be extracted. Missing fields remain null for review.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Candidate extraction, not a posting guarantee or bank authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertPreview"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens": {
      "get": {
        "tags": [
          "Credentials"
        ],
        "operationId": "listIntegrationTokens",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "List owned token metadata (browser session only)",
        "responses": {
          "200": {
            "description": "Metadata only; no token secrets.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TokenMetadata"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Credentials"
        ],
        "operationId": "createIntegrationToken",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Create a named expiring token (browser session only)",
        "description": "finance:read scope is required; finance:write optional. Unique scopes only. Name has no surrounding spaces. At most50 active tokens. Returned secret is shown once; store privately. Bearer callers cannot manage credentials.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "One-time secret plus metadata. Never log or commit it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "token",
                    "metadata"
                  ],
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Sensitive one-time response secret; never log or commit.",
                      "x-sensitive": true
                    },
                    "metadata": {
                      "$ref": "#/components/schemas/TokenMetadata"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/{id}": {
      "delete": {
        "tags": [
          "Credentials"
        ],
        "operationId": "revokeIntegrationToken",
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "summary": "Revoke an owned token (browser session only)",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token revoked; dependent automations lose access.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revoked"
                  ],
                  "properties": {
                    "revoked": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "operationId": "callMcpTransport",
        "summary": "Official MCP SDK Streamable HTTP endpoint",
        "description": "Official SDK Streamable HTTP JSON-RPC transport. Initialize and use tools/list/tools/call with an MCP client; inspect tool isError, because transport success alone does not confirm a financial mutation. Manual bearer authorization, no OAuth discovery. workspace_get/workspace_mutate use complete schema4; automation_get/automation_mutate, alert_ingest/alert_parse, planning_get/planning_mutate, workbench_get/workbench_mutate and rule_preview use the same REST services. Eleven legacy finance tools remain guarded.22 total tools. Profile, security and full backup are browser-only and are not MCP tools.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "MCP JSON-RPC protocol request; official SDK owns the transport schema."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP protocol response; transport success alone does not confirm a financial write.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Official MCP protocol result or notification response; inspect tool isError."
                }
              }
            }
          },
          "202": {
            "description": "MCP notification accepted where applicable."
          },
          "400": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. Inspect error.code before retrying; 409 can mean revision, idempotency, duplicate review, source pause or archive conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v3/planning": {
      "get": {
        "tags": [
          "Planning"
        ],
        "operationId": "getPlanning",
        "summary": "Read owned recurring schedules, occurrences, split audit and monthly plans",
        "description": "Requires finance:read. Returns the shared financial revision with bounded owned planning data. Reading never materializes a forecast or posts money. Historical occurrence/split references can remain after an associated financial entry is deliberately deleted.",
        "responses": {
          "200": {
            "description": "Current owned planning snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanningSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Planning"
        ],
        "operationId": "mutatePlanning",
        "summary": "Set monthly targets or manage and record a recurring schedule",
        "description": "Requires finance:write, current shared expectedRevision and fresh requestId. After an unknown result replay the identical envelope. Recording accepts exactly one valid owned active/unarchived schedule occurrence on or before financial today in Asia/Dhaka. It creates the transaction, historical occurrence link, shared revision and receipt atomically. Repeated dates never silently create another entry. Schedule start date/frequency are immutable; editing a template does not rewrite recorded entries. Pending generated entries do not affect posted balances.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanningEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current saved planning snapshot or exact replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanningSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error. A 409 can mean revision, idempotency, archived/paused schedule, immutable anchor or another planning conflict. Recording an already recorded date with the current revision is a successful no-op.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Operations"
        ],
        "security": [],
        "operationId": "getReadiness",
        "summary": "Read public container readiness and application version",
        "description": "Unauthenticated readiness probe: checks applied migrations and schema availability without returning financial records, credentials or configuration. Internal container probes do not require the public Host/Origin.",
        "responses": {
          "200": {
            "description": "Ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "status",
                    "version"
                  ],
                  "properties": {
                    "status": {
                      "const": "ok"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Database, migrations or schema unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "status",
                    "version"
                  ],
                  "properties": {
                    "status": {
                      "const": "unavailable"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/workspace": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "operationId": "getWorkspaceV4",
        "summary": "Read complete manual BDT accounts, valuations and transfer audit",
        "responses": {
          "200": {
            "description": "Complete owned schema4 financial snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDataV4"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Workspace"
        ],
        "operationId": "mutateWorkspaceV4",
        "summary": "Mutate financial/classification data, valuations or transfer matching",
        "description": "Requires finance:write. Read the latest shared revision. A new command needs a fresh requestId. After an unknown result, replay the exact envelope; changed request IDs can duplicate deliberate operations. Stale new commands return409; reload, review and explicitly resubmit. Cookie POSTs require matching Origin; bearer never falls back to cookies. Eleven manual BDT account families use signed positions: negative owed, positive assets or overpaid debt. Adjustments are dated deltas neutral to income/spending. Matching preserves both settlement dates and retains original entries for unmatch; matched transfers cannot be deleted directly.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceEnvelopeV4"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current owned financial snapshot after save or exact replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDataV4"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/workbench": {
      "get": {
        "tags": [
          "Workbench"
        ],
        "operationId": "getWorkbench",
        "summary": "Read rules, statement staging, reconciliation and run history",
        "description": "finance:read. Bounded complete snapshot: up to500 rules,100 statement imports,1000 rows per import,1000 rule runs and4MiB.",
        "responses": {
          "200": {
            "description": "Owned workbench and shared revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkbenchSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Workbench"
        ],
        "operationId": "mutateWorkbench",
        "summary": "Save/apply a rule or stage/commit/reconcile statement rows",
        "description": "finance:write. Read the latest shared revision. A new command needs a fresh requestId. After an unknown result, replay the exact envelope; changed request IDs can duplicate deliberate operations. Stale new commands return409; reload, review and explicitly resubmit. Cookie POSTs require matching Origin; bearer never falls back to cookies. Staging never posts money. Explicit commit imports up to100 selected rows or links existing same-account/date/direction/amount transactions. Duplicate candidates require explicit per-row includeDuplicateRowIds acknowledgement; duplicateIds lists existing entries and duplicateRowIds lists earlier same-statement rows. Reconciliation records reported closing balance and difference without creating balancing money. Rule apply rechecks matching selected IDs and commits classification changes plus run audit atomically. No background rule execution.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkbenchEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current owned workbench after command or exact replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkbenchSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/workbench/preview": {
      "post": {
        "tags": [
          "Workbench"
        ],
        "operationId": "previewRule",
        "summary": "Preview one rule without changing transactions",
        "description": "finance:read; cookie Origin still required. Optional explicit1–100 IDs. Returns at most100 matching before/after previews plus matchTotal and hasMore; issues describe blocked changes. Preview is not an apply guarantee.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RulePreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Read-only preview; apply requires current revision and selected IDs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revision",
                    "ruleId",
                    "matches",
                    "matchTotal",
                    "hasMore"
                  ],
                  "properties": {
                    "revision": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "ruleId": {
                      "type": "string"
                    },
                    "matchTotal": {
                      "type": "integer"
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "matches": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "description",
                          "before",
                          "after",
                          "issues"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "before": {
                            "type": "object"
                          },
                          "after": {
                            "type": "object"
                          },
                          "issues": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/profile": {
      "get": {
        "tags": [
          "Account"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "getProfile",
        "summary": "Read signed-in profile and shared revision",
        "responses": {
          "200": {
            "description": "Current name, sign-in email and creation date.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Account"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "updateProfile",
        "summary": "Update display name",
        "description": "Browser session only; email cannot be changed. Read the latest shared revision. A new command needs a fresh requestId. After an unknown result, replay the exact envelope; changed request IDs can duplicate deliberate operations. Stale new commands return409; reload, review and explicitly resubmit. Cookie POSTs require matching Origin; bearer never falls back to cookies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileEnvelope"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/security": {
      "post": {
        "tags": [
          "Account"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "changeSecurity",
        "summary": "Change password or invalidate all sessions and integration tokens",
        "description": "Browser session only; current password required. password_change requires12–256 nonblank characters. Both actions increment session version, invalidating current/other browser sessions and all old integration tokens; sign in again. Failed passwords are rate limited to5 attempts per15 minutes. No requestId receipt: if response is lost and session is rejected, sign in to determine outcome; do not describe this as replayable financial mutation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access invalidated. Clear browser session and return to sign-in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "signedOut"
                  ],
                  "properties": {
                    "signedOut": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/backup": {
      "get": {
        "tags": [
          "Backup"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "exportFullBackup",
        "summary": "Download owner data across20 supported models",
        "description": "Browser session only. Readable full format1/modelVersion-locked JSON, maximum64MiB. Includes finances, valuations, matching, classifications, planning, preferences, rules, statements and automation (including retained text). Excludes user IDs, password hashes, sessions, tokens, rate limits and request receipts. Profile name is informational and is not restored. Not a database dump or Sure import.",
        "responses": {
          "200": {
            "description": "Downloadable JSON with SHA-256 checksum. BigInt fields are decimal strings; no credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FullBackup"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/backup/validate": {
      "post": {
        "tags": [
          "Backup"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "validateFullBackup",
        "summary": "Validate backup structure, model version, checksum and bounded size",
        "description": "Browser session only. Read-only validation; does not replace anything. Preview counts and warnings. Complete cross-domain financial/reference validation additionally runs inside the restore transaction and can reject/roll back an otherwise structurally valid file.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "backup"
                ],
                "properties": {
                  "backup": {
                    "$ref": "#/components/schemas/FullBackup"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checksum,20 model counts and restore/privacy warnings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupPreview"
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/backup/restore": {
      "post": {
        "tags": [
          "Backup"
        ],
        "security": [
          {
            "SessionCookie": []
          }
        ],
        "operationId": "restoreFullBackup",
        "summary": "Deliberately replace current owner's supported data from validated backup",
        "description": "Browser session and current password required. Read the latest shared revision. A new command needs a fresh requestId. After an unknown result, replay the exact envelope; changed request IDs can duplicate deliberate operations. Stale new commands return409; reload, review and explicitly resubmit. Cookie POSTs require matching Origin; bearer never falls back to cookies. Destructive owner-scoped replacement is atomic and rolls back on invalid references/domain invariants or ID collision. Preserve current name/email/password, sessions/tokens and existing request receipts as replay tombstones; do not import backup auth. UI requires reviewed counts and typed RESTORE before calling. Backend enforces password, ownership, revision and validation; typed confirmation is a UI interaction, not a request field. Wrong password is rejected. This is an application backup, not infrastructure disaster recovery.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "backup",
                  "currentPassword",
                  "expectedRevision",
                  "requestId"
                ],
                "properties": {
                  "backup": {
                    "$ref": "#/components/schemas/FullBackup"
                  },
                  "currentPassword": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "writeOnly": true
                  },
                  "expectedRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "requestId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replacement committed or exact restore receipt replayed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "restored",
                    "revision",
                    "counts",
                    "replayed"
                  ],
                  "properties": {
                    "restored": {
                      "const": true
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "counts": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "replayed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "415": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Safe JSON error with code and message. 409 indicates a revision, idempotency, archive or V1 upgrade conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Manually configured expiring Budget Go integration token; not OAuth. Reads require finance:read, commands finance:write."
      },
      "SessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "authjs.session-token",
        "description": "Existing Auth.js browser sign-in. Secure hosted cookie uses __Secure-authjs.session-token. Not a client-issued user ID."
      }
    },
    "schemas": {
      "WorkspaceData": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 3
          },
          "currency": {
            "type": "string",
            "const": "BDT"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "accounts": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "bank",
                    "cash",
                    "mobile"
                  ]
                },
                "currency": {
                  "type": "string",
                  "const": "BDT"
                },
                "openingDate": {
                  "type": "string"
                },
                "openingPoisha": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "currency",
                "openingDate",
                "openingPoisha",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "transactions": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "category": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "income",
                    "expense"
                  ]
                },
                "poisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "categoryId": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "merchantId": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tagIds": {
                  "default": [],
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "notes": {
                  "default": "",
                  "type": "string",
                  "maxLength": 2000
                },
                "status": {
                  "default": "confirmed",
                  "type": "string",
                  "enum": [
                    "confirmed",
                    "pending"
                  ]
                },
                "excluded": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "accountId",
                "description",
                "category",
                "date",
                "type",
                "poisha",
                "categoryId",
                "merchantId",
                "tagIds",
                "notes",
                "status",
                "excluded"
              ],
              "additionalProperties": false
            }
          },
          "transfers": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "fromAccountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "toAccountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "date": {
                  "type": "string"
                },
                "poisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "id",
                "fromAccountId",
                "toAccountId",
                "description",
                "date",
                "poisha"
              ],
              "additionalProperties": false
            }
          },
          "budgets": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string"
                },
                "category": {
                  "type": "string",
                  "maxLength": 80
                },
                "categoryId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "limitPoisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "required": [
                "month",
                "category",
                "categoryId",
                "limitPoisha",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "categories": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "icon": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,40}$"
                },
                "parentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "income",
                    "expense",
                    "both"
                  ]
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "icon",
                "parentId",
                "kind",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "tags": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "merchants": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "website": {
                  "type": "string",
                  "maxLength": 500
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "website",
                "archived"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "schemaVersion",
          "currency",
          "revision",
          "accounts",
          "transactions",
          "transfers",
          "budgets",
          "categories",
          "tags",
          "merchants"
        ],
        "additionalProperties": false
      },
      "WorkspaceCommand": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_create"
              },
              "account": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "bank",
                      "cash",
                      "mobile"
                    ]
                  },
                  "openingDate": {
                    "type": "string"
                  },
                  "openingPoisha": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "openingDate",
                  "openingPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "account"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "account": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "account"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_create"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "date": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "accountId",
                  "description",
                  "type",
                  "category",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "transaction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "date": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "accountId",
                  "description",
                  "type",
                  "category",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "transaction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_bulk_update"
              },
              "ids": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "patch": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "date": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "ids",
              "patch"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_bulk_delete"
              },
              "ids": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              }
            },
            "required": [
              "type",
              "ids"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_split"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "parts": {
                "minItems": 2,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "description",
                    "category",
                    "categoryId",
                    "poisha"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "id",
              "parts"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_create"
              },
              "transfer": {
                "type": "object",
                "properties": {
                  "fromAccountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "toAccountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "date": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "fromAccountId",
                  "toAccountId",
                  "description",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "transfer"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_create"
              },
              "budget": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "limitPoisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "month",
                  "category",
                  "limitPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "budget"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "budget": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "limitPoisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "month",
                  "category",
                  "limitPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "budget"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_copy"
              },
              "fromMonth": {
                "type": "string"
              },
              "toMonth": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "fromMonth",
              "toMonth"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_create"
              },
              "category": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "icon": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,40}$"
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense",
                      "both"
                    ]
                  }
                },
                "required": [
                  "name",
                  "color",
                  "icon",
                  "parentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "category"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "category": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "icon": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,40}$"
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense",
                      "both"
                    ]
                  }
                },
                "required": [
                  "name",
                  "color",
                  "icon",
                  "parentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "category"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_create"
              },
              "tag": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "tag": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_create"
              },
              "merchant": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "name",
                  "color",
                  "website"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "merchant"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "merchant": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "name",
                  "color",
                  "website"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "merchant"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AutomationCommand": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "preferences_update"
              },
              "preferences": {
                "type": "object",
                "properties": {
                  "timezone": {
                    "type": "string",
                    "const": "Asia/Dhaka"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "en-BD",
                      "bn-BD"
                    ]
                  },
                  "density": {
                    "type": "string",
                    "enum": [
                      "comfortable",
                      "compact"
                    ]
                  },
                  "accent": {
                    "type": "string",
                    "enum": [
                      "emerald",
                      "teal",
                      "amber"
                    ]
                  },
                  "weekStart": {
                    "type": "string",
                    "enum": [
                      "sat",
                      "sun",
                      "mon"
                    ]
                  },
                  "fiscalYearStartMonth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "defaultEntryStatus": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "storeRawMessages": {
                    "type": "boolean"
                  },
                  "automationEnabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "timezone",
                  "locale",
                  "density",
                  "accent",
                  "weekStart",
                  "fiscalYearStartMonth",
                  "defaultEntryStatus",
                  "storeRawMessages",
                  "automationEnabled"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "preferences"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "source_create"
              },
              "source": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "email",
                      "manual"
                    ]
                  },
                  "providerLabel": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "accountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "channel",
                  "providerLabel",
                  "accountId",
                  "enabled"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "source_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "source": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "sms",
                      "email",
                      "manual"
                    ]
                  },
                  "providerLabel": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "accountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "channel",
                  "providerLabel",
                  "accountId",
                  "enabled"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "event_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "draft": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "poisha": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "accountId",
                  "description",
                  "type",
                  "category",
                  "categoryId",
                  "date",
                  "poisha",
                  "merchantId",
                  "tagIds",
                  "notes",
                  "status",
                  "excluded"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "draft"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "event_accept"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "acknowledgeDuplicate": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "acknowledgeDuplicate"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "event_ignore"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "ignored": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "ignored"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AutomationSnapshot": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "preferences": {
            "type": "object",
            "properties": {
              "timezone": {
                "type": "string",
                "const": "Asia/Dhaka"
              },
              "locale": {
                "type": "string",
                "enum": [
                  "en-BD",
                  "bn-BD"
                ]
              },
              "density": {
                "type": "string",
                "enum": [
                  "comfortable",
                  "compact"
                ]
              },
              "accent": {
                "type": "string",
                "enum": [
                  "emerald",
                  "teal",
                  "amber"
                ]
              },
              "weekStart": {
                "type": "string",
                "enum": [
                  "sat",
                  "sun",
                  "mon"
                ]
              },
              "fiscalYearStartMonth": {
                "type": "integer",
                "minimum": 1,
                "maximum": 12
              },
              "defaultEntryStatus": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "storeRawMessages": {
                "type": "boolean"
              },
              "automationEnabled": {
                "type": "boolean"
              }
            },
            "required": [
              "timezone",
              "locale",
              "density",
              "accent",
              "weekStart",
              "fiscalYearStartMonth",
              "defaultEntryStatus",
              "storeRawMessages",
              "automationEnabled"
            ],
            "additionalProperties": false
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "channel": {
                  "type": "string",
                  "enum": [
                    "sms",
                    "email",
                    "manual"
                  ]
                },
                "providerLabel": {
                  "type": "string",
                  "maxLength": 80
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "enabled": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "required": [
                "name",
                "channel",
                "providerLabel",
                "accountId",
                "enabled",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "sourceId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "externalId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "reference": {
                  "type": "string",
                  "maxLength": 120
                },
                "receivedAt": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "needs_review",
                    "ready",
                    "accepted",
                    "ignored"
                  ]
                },
                "draft": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 120
                    },
                    "type": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "income",
                            "expense"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "poisha": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "merchantId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending"
                      ]
                    },
                    "excluded": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "accountId",
                    "description",
                    "type",
                    "category",
                    "categoryId",
                    "date",
                    "poisha",
                    "merchantId",
                    "tagIds",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "additionalProperties": false
                },
                "issues": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "duplicateOfEventId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "duplicateTransactionIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "transactionId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "rawText": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "sourceId",
                "externalId",
                "reference",
                "receivedAt",
                "status",
                "draft",
                "issues",
                "duplicateOfEventId",
                "duplicateTransactionIds",
                "transactionId",
                "rawText"
              ],
              "additionalProperties": false
            }
          },
          "eventTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "eventLimit": {
            "type": "number",
            "const": 200
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "revision",
          "preferences",
          "sources",
          "events",
          "eventTotal",
          "eventLimit",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "AutomationEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "sourceId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "reference": {
            "type": "string",
            "maxLength": 120
          },
          "receivedAt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "needs_review",
              "ready",
              "accepted",
              "ignored"
            ]
          },
          "draft": {
            "type": "object",
            "properties": {
              "accountId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 120
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category": {
                "type": "string",
                "maxLength": 80
              },
              "categoryId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "poisha": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "merchantId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 2000
              },
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "excluded": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "description",
              "type",
              "category",
              "categoryId",
              "date",
              "poisha",
              "merchantId",
              "tagIds",
              "notes",
              "status",
              "excluded"
            ],
            "additionalProperties": false
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "duplicateOfEventId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "duplicateTransactionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          },
          "transactionId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "rawText": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "sourceId",
          "externalId",
          "reference",
          "receivedAt",
          "status",
          "draft",
          "issues",
          "duplicateOfEventId",
          "duplicateTransactionIds",
          "transactionId",
          "rawText"
        ],
        "additionalProperties": false
      },
      "AutomationDraft": {
        "type": "object",
        "properties": {
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 120
          },
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "income",
                  "expense"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "type": "string",
            "maxLength": 80
          },
          "categoryId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "poisha": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "merchantId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "tagIds": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "pending"
            ]
          },
          "excluded": {
            "type": "boolean"
          }
        },
        "required": [
          "accountId",
          "description",
          "type",
          "category",
          "categoryId",
          "date",
          "poisha",
          "merchantId",
          "tagIds",
          "notes",
          "status",
          "excluded"
        ],
        "additionalProperties": false
      },
      "WorkspacePreferences": {
        "type": "object",
        "properties": {
          "timezone": {
            "type": "string",
            "const": "Asia/Dhaka"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en-BD",
              "bn-BD"
            ]
          },
          "density": {
            "type": "string",
            "enum": [
              "comfortable",
              "compact"
            ]
          },
          "accent": {
            "type": "string",
            "enum": [
              "emerald",
              "teal",
              "amber"
            ]
          },
          "weekStart": {
            "type": "string",
            "enum": [
              "sat",
              "sun",
              "mon"
            ]
          },
          "fiscalYearStartMonth": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "defaultEntryStatus": {
            "type": "string",
            "enum": [
              "confirmed",
              "pending"
            ]
          },
          "storeRawMessages": {
            "type": "boolean"
          },
          "automationEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "timezone",
          "locale",
          "density",
          "accent",
          "weekStart",
          "fiscalYearStartMonth",
          "defaultEntryStatus",
          "storeRawMessages",
          "automationEnabled"
        ],
        "additionalProperties": false
      },
      "AutomationSourceInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "channel": {
            "type": "string",
            "enum": [
              "sms",
              "email",
              "manual"
            ]
          },
          "providerLabel": {
            "type": "string",
            "maxLength": 80
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "channel",
          "providerLabel",
          "accountId",
          "enabled"
        ],
        "additionalProperties": false
      },
      "IngestInput": {
        "type": "object",
        "properties": {
          "sourceId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "rawText": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "reference": {
            "type": "string",
            "maxLength": 120
          },
          "draft": {
            "type": "object",
            "properties": {
              "accountId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 120
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category": {
                "type": "string",
                "maxLength": 80
              },
              "categoryId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "poisha": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "merchantId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 2000
              },
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "excluded": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "sourceId",
          "externalId"
        ],
        "additionalProperties": false
      },
      "AutomationEnvelope": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "command": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "preferences_update"
                  },
                  "preferences": {
                    "type": "object",
                    "properties": {
                      "timezone": {
                        "type": "string",
                        "const": "Asia/Dhaka"
                      },
                      "locale": {
                        "type": "string",
                        "enum": [
                          "en-BD",
                          "bn-BD"
                        ]
                      },
                      "density": {
                        "type": "string",
                        "enum": [
                          "comfortable",
                          "compact"
                        ]
                      },
                      "accent": {
                        "type": "string",
                        "enum": [
                          "emerald",
                          "teal",
                          "amber"
                        ]
                      },
                      "weekStart": {
                        "type": "string",
                        "enum": [
                          "sat",
                          "sun",
                          "mon"
                        ]
                      },
                      "fiscalYearStartMonth": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      },
                      "defaultEntryStatus": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "storeRawMessages": {
                        "type": "boolean"
                      },
                      "automationEnabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "timezone",
                      "locale",
                      "density",
                      "accent",
                      "weekStart",
                      "fiscalYearStartMonth",
                      "defaultEntryStatus",
                      "storeRawMessages",
                      "automationEnabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "preferences"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "source_create"
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "sms",
                          "email",
                          "manual"
                        ]
                      },
                      "providerLabel": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "channel",
                      "providerLabel",
                      "accountId",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "source_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "sms",
                          "email",
                          "manual"
                        ]
                      },
                      "providerLabel": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "channel",
                      "providerLabel",
                      "accountId",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "event_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "draft": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "type": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "income",
                              "expense"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "date": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "poisha": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "accountId",
                      "description",
                      "type",
                      "category",
                      "categoryId",
                      "date",
                      "poisha",
                      "merchantId",
                      "tagIds",
                      "notes",
                      "status",
                      "excluded"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "draft"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "event_accept"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "acknowledgeDuplicate": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "acknowledgeDuplicate"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "event_ignore"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "ignored": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "ignored"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "expectedRevision",
          "requestId",
          "command"
        ],
        "additionalProperties": false
      },
      "AlertPreviewInput": {
        "type": "object",
        "properties": {
          "rawText": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          }
        },
        "required": [
          "rawText"
        ],
        "additionalProperties": false
      },
      "AlertPreview": {
        "type": "object",
        "properties": {
          "draft": {
            "type": "object",
            "properties": {
              "accountId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "description": {
                "type": "string",
                "maxLength": 120
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "category": {
                "type": "string",
                "maxLength": 80
              },
              "categoryId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "poisha": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "merchantId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 2000
              },
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "excluded": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "description",
              "type",
              "category",
              "categoryId",
              "date",
              "poisha",
              "merchantId",
              "tagIds",
              "notes",
              "status",
              "excluded"
            ],
            "additionalProperties": false
          },
          "reference": {
            "type": "string"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "draft",
          "reference",
          "issues"
        ],
        "additionalProperties": false
      },
      "TokenMetadata": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "finance:read",
                "finance:write"
              ]
            }
          },
          "expiresAt": {
            "type": "string"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "scopes",
          "expiresAt",
          "revokedAt",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "TokenCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "scopes": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "finance:read",
                "finance:write"
              ]
            }
          },
          "expiresInDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          }
        },
        "required": [
          "name",
          "scopes",
          "expiresInDays"
        ],
        "additionalProperties": false
      },
      "PlanningCommand": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "monthly_plan_set"
              },
              "month": {
                "type": "string"
              },
              "incomePoisha": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "spendingPoisha": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "type",
              "month",
              "incomePoisha",
              "spendingPoisha"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "recurring_create"
              },
              "schedule": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "transaction": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "poisha": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "accountId",
                      "description",
                      "type",
                      "category",
                      "categoryId",
                      "poisha",
                      "merchantId",
                      "tagIds",
                      "notes",
                      "status",
                      "excluded"
                    ],
                    "additionalProperties": false
                  },
                  "startDate": {
                    "type": "string"
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "monthly",
                      "yearly"
                    ]
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "transaction",
                  "startDate",
                  "frequency",
                  "active"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "schedule"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "recurring_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "schedule": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "transaction": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "poisha": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "accountId",
                      "description",
                      "type",
                      "category",
                      "categoryId",
                      "poisha",
                      "merchantId",
                      "tagIds",
                      "notes",
                      "status",
                      "excluded"
                    ],
                    "additionalProperties": false
                  },
                  "startDate": {
                    "type": "string"
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "monthly",
                      "yearly"
                    ]
                  },
                  "active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "transaction",
                  "startDate",
                  "frequency",
                  "active"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "schedule"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "recurring_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "recurring_record"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "date": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "id",
              "date"
            ],
            "additionalProperties": false
          }
        ]
      },
      "PlanningSnapshot": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "recurring": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "transaction": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "income",
                        "expense"
                      ]
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poisha": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "merchantId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending"
                      ]
                    },
                    "excluded": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "accountId",
                    "description",
                    "type",
                    "category",
                    "categoryId",
                    "poisha",
                    "merchantId",
                    "tagIds",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "additionalProperties": false
                },
                "startDate": {
                  "type": "string"
                },
                "frequency": {
                  "type": "string",
                  "enum": [
                    "weekly",
                    "monthly",
                    "yearly"
                  ]
                },
                "active": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "transaction",
                "startDate",
                "frequency",
                "active",
                "id",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "occurrences": {
            "maxItems": 5000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "scheduleId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "date": {
                  "type": "string"
                },
                "transactionId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "required": [
                "id",
                "scheduleId",
                "date",
                "transactionId"
              ],
              "additionalProperties": false
            }
          },
          "splits": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "originalTransactionId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "original": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "category": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "income",
                        "expense"
                      ]
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "categoryId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "merchantId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "default": [],
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "default": "",
                      "type": "string",
                      "maxLength": 2000
                    },
                    "status": {
                      "default": "confirmed",
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending"
                      ]
                    },
                    "excluded": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "accountId",
                    "description",
                    "category",
                    "date",
                    "type",
                    "poisha",
                    "categoryId",
                    "merchantId",
                    "tagIds",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "additionalProperties": false
                },
                "partIds": {
                  "minItems": 2,
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "createdAt": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "originalTransactionId",
                "original",
                "partIds",
                "createdAt"
              ],
              "additionalProperties": false
            }
          },
          "monthlyPlans": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string"
                },
                "incomePoisha": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "spendingPoisha": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "month",
                "incomePoisha",
                "spendingPoisha"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "revision",
          "recurring",
          "occurrences",
          "splits",
          "monthlyPlans"
        ],
        "additionalProperties": false
      },
      "PlanningEnvelope": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "command": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "monthly_plan_set"
                  },
                  "month": {
                    "type": "string"
                  },
                  "incomePoisha": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "spendingPoisha": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "type",
                  "month",
                  "incomePoisha",
                  "spendingPoisha"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "recurring_create"
                  },
                  "schedule": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "transaction": {
                        "type": "object",
                        "properties": {
                          "accountId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "income",
                              "expense"
                            ]
                          },
                          "category": {
                            "type": "string",
                            "maxLength": 80
                          },
                          "categoryId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poisha": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "merchantId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tagIds": {
                            "maxItems": 500,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            }
                          },
                          "notes": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "confirmed",
                              "pending"
                            ]
                          },
                          "excluded": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "accountId",
                          "description",
                          "type",
                          "category",
                          "categoryId",
                          "poisha",
                          "merchantId",
                          "tagIds",
                          "notes",
                          "status",
                          "excluded"
                        ],
                        "additionalProperties": false
                      },
                      "startDate": {
                        "type": "string"
                      },
                      "frequency": {
                        "type": "string",
                        "enum": [
                          "weekly",
                          "monthly",
                          "yearly"
                        ]
                      },
                      "active": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "transaction",
                      "startDate",
                      "frequency",
                      "active"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "schedule"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "recurring_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "schedule": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "transaction": {
                        "type": "object",
                        "properties": {
                          "accountId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "income",
                              "expense"
                            ]
                          },
                          "category": {
                            "type": "string",
                            "maxLength": 80
                          },
                          "categoryId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "poisha": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "merchantId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tagIds": {
                            "maxItems": 500,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            }
                          },
                          "notes": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "confirmed",
                              "pending"
                            ]
                          },
                          "excluded": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "accountId",
                          "description",
                          "type",
                          "category",
                          "categoryId",
                          "poisha",
                          "merchantId",
                          "tagIds",
                          "notes",
                          "status",
                          "excluded"
                        ],
                        "additionalProperties": false
                      },
                      "startDate": {
                        "type": "string"
                      },
                      "frequency": {
                        "type": "string",
                        "enum": [
                          "weekly",
                          "monthly",
                          "yearly"
                        ]
                      },
                      "active": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "transaction",
                      "startDate",
                      "frequency",
                      "active"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "schedule"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "recurring_archive"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "recurring_record"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "date": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "date"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "expectedRevision",
          "requestId",
          "command"
        ],
        "additionalProperties": false
      },
      "RecurringScheduleInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "transaction": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "type": {
                "type": "string",
                "enum": [
                  "income",
                  "expense"
                ]
              },
              "category": {
                "type": "string",
                "maxLength": 80
              },
              "categoryId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "poisha": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "merchantId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 2000
              },
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "excluded": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "description",
              "type",
              "category",
              "categoryId",
              "poisha",
              "merchantId",
              "tagIds",
              "notes",
              "status",
              "excluded"
            ],
            "additionalProperties": false
          },
          "startDate": {
            "type": "string"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "yearly"
            ]
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "transaction",
          "startDate",
          "frequency",
          "active"
        ],
        "additionalProperties": false
      },
      "RecurringSchedule": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "transaction": {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "type": {
                "type": "string",
                "enum": [
                  "income",
                  "expense"
                ]
              },
              "category": {
                "type": "string",
                "maxLength": 80
              },
              "categoryId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "poisha": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "merchantId": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tagIds": {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 2000
              },
              "status": {
                "type": "string",
                "enum": [
                  "confirmed",
                  "pending"
                ]
              },
              "excluded": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "description",
              "type",
              "category",
              "categoryId",
              "poisha",
              "merchantId",
              "tagIds",
              "notes",
              "status",
              "excluded"
            ],
            "additionalProperties": false
          },
          "startDate": {
            "type": "string"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "yearly"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "archived": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "transaction",
          "startDate",
          "frequency",
          "active",
          "id",
          "archived"
        ],
        "additionalProperties": false
      },
      "RecurringTransaction": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "type": {
            "type": "string",
            "enum": [
              "income",
              "expense"
            ]
          },
          "category": {
            "type": "string",
            "maxLength": 80
          },
          "categoryId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "poisha": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "merchantId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "tagIds": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "pending"
            ]
          },
          "excluded": {
            "type": "boolean"
          }
        },
        "required": [
          "accountId",
          "description",
          "type",
          "category",
          "categoryId",
          "poisha",
          "merchantId",
          "tagIds",
          "notes",
          "status",
          "excluded"
        ],
        "additionalProperties": false
      },
      "WorkspaceDataV4": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 4
          },
          "currency": {
            "type": "string",
            "const": "BDT"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "accounts": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "bank",
                    "cash",
                    "mobile",
                    "investment",
                    "crypto",
                    "property",
                    "vehicle",
                    "credit_card",
                    "loan",
                    "other_asset",
                    "other_liability"
                  ]
                },
                "currency": {
                  "type": "string",
                  "const": "BDT"
                },
                "openingDate": {
                  "type": "string"
                },
                "openingPoisha": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "currency",
                "openingDate",
                "openingPoisha",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "transactions": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "category": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "income",
                    "expense"
                  ]
                },
                "poisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "categoryId": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "merchantId": {
                  "default": null,
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tagIds": {
                  "default": [],
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "notes": {
                  "default": "",
                  "type": "string",
                  "maxLength": 2000
                },
                "status": {
                  "default": "confirmed",
                  "type": "string",
                  "enum": [
                    "confirmed",
                    "pending"
                  ]
                },
                "excluded": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "accountId",
                "description",
                "category",
                "date",
                "type",
                "poisha",
                "categoryId",
                "merchantId",
                "tagIds",
                "notes",
                "status",
                "excluded"
              ],
              "additionalProperties": false
            }
          },
          "transfers": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "fromAccountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "toAccountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "date": {
                  "type": "string"
                },
                "toDate": {
                  "type": "string"
                },
                "poisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "id",
                "fromAccountId",
                "toAccountId",
                "description",
                "date",
                "toDate",
                "poisha"
              ],
              "additionalProperties": false
            }
          },
          "budgets": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string"
                },
                "category": {
                  "type": "string",
                  "maxLength": 80
                },
                "categoryId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "limitPoisha": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "required": [
                "month",
                "category",
                "categoryId",
                "limitPoisha",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "categories": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "icon": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,40}$"
                },
                "parentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "income",
                    "expense",
                    "both"
                  ]
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "icon",
                "parentId",
                "kind",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "tags": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "merchants": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "color": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "website": {
                  "type": "string",
                  "maxLength": 500
                },
                "archived": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "website",
                "archived"
              ],
              "additionalProperties": false
            }
          },
          "adjustments": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "date": {
                  "type": "string"
                },
                "poisha": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "balancePoisha": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "required": [
                "id",
                "accountId",
                "date",
                "poisha",
                "balancePoisha",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "matches": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "transferId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "outgoing": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "category": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "const": "expense"
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "categoryId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "merchantId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "default": [],
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "default": "",
                      "type": "string",
                      "maxLength": 2000
                    },
                    "status": {
                      "default": "confirmed",
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending"
                      ]
                    },
                    "excluded": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "accountId",
                    "description",
                    "category",
                    "date",
                    "type",
                    "poisha",
                    "categoryId",
                    "merchantId",
                    "tagIds",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "additionalProperties": false
                },
                "incoming": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "category": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "const": "income"
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "categoryId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "merchantId": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "default": [],
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "default": "",
                      "type": "string",
                      "maxLength": 2000
                    },
                    "status": {
                      "default": "confirmed",
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "pending"
                      ]
                    },
                    "excluded": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "accountId",
                    "description",
                    "category",
                    "date",
                    "type",
                    "poisha",
                    "categoryId",
                    "merchantId",
                    "tagIds",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "transferId",
                "outgoing",
                "incoming"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "schemaVersion",
          "currency",
          "revision",
          "accounts",
          "transactions",
          "transfers",
          "budgets",
          "categories",
          "tags",
          "merchants",
          "adjustments",
          "matches"
        ],
        "additionalProperties": false
      },
      "WorkspaceCommandV4": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_create"
              },
              "account": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "bank",
                      "cash",
                      "mobile",
                      "investment",
                      "crypto",
                      "property",
                      "vehicle",
                      "credit_card",
                      "loan",
                      "other_asset",
                      "other_liability"
                    ]
                  },
                  "openingDate": {
                    "type": "string"
                  },
                  "openingPoisha": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "openingDate",
                  "openingPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "account"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "account": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "account"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_adjustment_set"
              },
              "accountId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "date": {
                "type": "string"
              },
              "balancePoisha": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            },
            "required": [
              "type",
              "accountId",
              "date",
              "balancePoisha",
              "description"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "account_adjustment_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_create"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "date": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "accountId",
                  "description",
                  "type",
                  "category",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "transaction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense"
                    ]
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "date": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "accountId",
                  "description",
                  "type",
                  "category",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "transaction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_bulk_update"
              },
              "ids": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "patch": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "date": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "merchantId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tagIds": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "confirmed",
                      "pending"
                    ]
                  },
                  "excluded": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "ids",
              "patch"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_bulk_delete"
              },
              "ids": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              }
            },
            "required": [
              "type",
              "ids"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transaction_split"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "parts": {
                "minItems": 2,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 80
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "description",
                    "category",
                    "categoryId",
                    "poisha"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "id",
              "parts"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_create"
              },
              "transfer": {
                "type": "object",
                "properties": {
                  "fromAccountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "toAccountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "date": {
                    "type": "string"
                  },
                  "toDate": {
                    "type": "string"
                  },
                  "poisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "fromAccountId",
                  "toAccountId",
                  "description",
                  "date",
                  "poisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "transfer"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_match"
              },
              "expenseId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "incomeId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "expenseId",
              "incomeId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "transfer_unmatch"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_create"
              },
              "budget": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "limitPoisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "month",
                  "category",
                  "limitPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "budget"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "budget": {
                "type": "object",
                "properties": {
                  "month": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "categoryId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "limitPoisha": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "month",
                  "category",
                  "limitPoisha"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "budget"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_delete"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "budget_copy"
              },
              "fromMonth": {
                "type": "string"
              },
              "toMonth": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "fromMonth",
              "toMonth"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_create"
              },
              "category": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "icon": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,40}$"
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense",
                      "both"
                    ]
                  }
                },
                "required": [
                  "name",
                  "color",
                  "icon",
                  "parentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "category"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "category": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "icon": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,40}$"
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "income",
                      "expense",
                      "both"
                    ]
                  }
                },
                "required": [
                  "name",
                  "color",
                  "icon",
                  "parentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "category"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "category_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_create"
              },
              "tag": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "tag": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "tag_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_create"
              },
              "merchant": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "name",
                  "color",
                  "website"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "merchant"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "merchant": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "name",
                  "color",
                  "website"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "merchant"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "merchant_archive"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "archived": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "archived"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WorkspaceEnvelopeV4": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "command": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account_create"
                  },
                  "account": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "bank",
                          "cash",
                          "mobile",
                          "investment",
                          "crypto",
                          "property",
                          "vehicle",
                          "credit_card",
                          "loan",
                          "other_asset",
                          "other_liability"
                        ]
                      },
                      "openingDate": {
                        "type": "string"
                      },
                      "openingPoisha": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "name",
                      "kind",
                      "openingDate",
                      "openingPoisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "account"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "account": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "account"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account_archive"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account_adjustment_set"
                  },
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "date": {
                    "type": "string"
                  },
                  "balancePoisha": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "type",
                  "accountId",
                  "date",
                  "balancePoisha",
                  "description"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "account_adjustment_delete"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_create"
                  },
                  "transaction": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "date": {
                        "type": "string"
                      },
                      "poisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "accountId",
                      "description",
                      "type",
                      "category",
                      "date",
                      "poisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "transaction"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "transaction": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "date": {
                        "type": "string"
                      },
                      "poisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "accountId",
                      "description",
                      "type",
                      "category",
                      "date",
                      "poisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "transaction"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_delete"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_bulk_update"
                  },
                  "ids": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "patch": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "date": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed",
                          "pending"
                        ]
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "ids",
                  "patch"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_bulk_delete"
                  },
                  "ids": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  }
                },
                "required": [
                  "type",
                  "ids"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction_split"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "parts": {
                    "minItems": 2,
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "category": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "categoryId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "poisha": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "description",
                        "category",
                        "categoryId",
                        "poisha"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "id",
                  "parts"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transfer_create"
                  },
                  "transfer": {
                    "type": "object",
                    "properties": {
                      "fromAccountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "toAccountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "date": {
                        "type": "string"
                      },
                      "toDate": {
                        "type": "string"
                      },
                      "poisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "fromAccountId",
                      "toAccountId",
                      "description",
                      "date",
                      "poisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "transfer"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transfer_delete"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transfer_match"
                  },
                  "expenseId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "incomeId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "expenseId",
                  "incomeId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transfer_unmatch"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "budget_create"
                  },
                  "budget": {
                    "type": "object",
                    "properties": {
                      "month": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "limitPoisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "month",
                      "category",
                      "limitPoisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "budget"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "budget_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "budget": {
                    "type": "object",
                    "properties": {
                      "month": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string",
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "limitPoisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "month",
                      "category",
                      "limitPoisha"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "budget"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "budget_delete"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "budget_copy"
                  },
                  "fromMonth": {
                    "type": "string"
                  },
                  "toMonth": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "fromMonth",
                  "toMonth"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "category_create"
                  },
                  "category": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "icon": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,40}$"
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense",
                          "both"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "color",
                      "icon",
                      "parentId",
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "category"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "category_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "category": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "icon": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,40}$"
                      },
                      "parentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense",
                          "both"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "color",
                      "icon",
                      "parentId",
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "category"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "category_archive"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "tag_create"
                  },
                  "tag": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      }
                    },
                    "required": [
                      "name",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "tag"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "tag_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "tag": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      }
                    },
                    "required": [
                      "name",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "tag"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "tag_archive"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "merchant_create"
                  },
                  "merchant": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "website": {
                        "type": "string",
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "name",
                      "color",
                      "website"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "merchant"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "merchant_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "merchant": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "color": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "website": {
                        "type": "string",
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "name",
                      "color",
                      "website"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "merchant"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "merchant_archive"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "archived"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "expectedRevision",
          "requestId",
          "command"
        ],
        "additionalProperties": false
      },
      "WorkbenchSnapshot": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "rules": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "active": {
                  "type": "boolean"
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9999
                },
                "conditions": {
                  "minItems": 1,
                  "maxItems": 8,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "enum": [
                          "description",
                          "notes",
                          "category",
                          "accountId",
                          "type",
                          "merchantId"
                        ]
                      },
                      "operator": {
                        "type": "string",
                        "enum": [
                          "contains",
                          "equals"
                        ]
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      }
                    },
                    "required": [
                      "field",
                      "operator",
                      "value"
                    ],
                    "additionalProperties": false
                  }
                },
                "actions": {
                  "type": "object",
                  "properties": {
                    "categoryId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "merchantId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tagIds": {
                      "maxItems": 500,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      }
                    },
                    "notes": {
                      "type": "string",
                      "maxLength": 2000
                    },
                    "excluded": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "required": [
                "name",
                "active",
                "priority",
                "conditions",
                "actions",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "statements": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "rows": {
                  "maxItems": 1000,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "income",
                          "expense"
                        ]
                      },
                      "poisha": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "category": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "categoryId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "transactionId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "imported",
                          "linked",
                          "ignored"
                        ]
                      },
                      "duplicateIds": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "duplicateRowIds": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      }
                    },
                    "required": [
                      "date",
                      "description",
                      "type",
                      "poisha",
                      "category",
                      "categoryId",
                      "id",
                      "transactionId",
                      "status",
                      "duplicateIds",
                      "duplicateRowIds"
                    ],
                    "additionalProperties": false
                  }
                },
                "closingDate": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "closingBalancePoisha": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ledgerBalancePoisha": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "differencePoisha": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reconciled": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "accountId",
                "createdAt",
                "rows",
                "closingDate",
                "closingBalancePoisha",
                "ledgerBalancePoisha",
                "differencePoisha",
                "reconciled"
              ],
              "additionalProperties": false
            }
          },
          "runs": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "ruleId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "matchedCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                },
                "changedIds": {
                  "minItems": 1,
                  "maxItems": 100,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  }
                }
              },
              "required": [
                "id",
                "ruleId",
                "createdAt",
                "matchedCount",
                "changedIds"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "revision",
          "rules",
          "statements",
          "runs"
        ],
        "additionalProperties": false
      },
      "WorkbenchCommand": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "rule_create"
              },
              "rule": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999
                  },
                  "conditions": {
                    "minItems": 1,
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": [
                            "description",
                            "notes",
                            "category",
                            "accountId",
                            "type",
                            "merchantId"
                          ]
                        },
                        "operator": {
                          "type": "string",
                          "enum": [
                            "contains",
                            "equals"
                          ]
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "field",
                        "operator",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "actions": {
                    "type": "object",
                    "properties": {
                      "categoryId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "name",
                  "active",
                  "priority",
                  "conditions",
                  "actions"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "rule"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "rule_update"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "rule": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999
                  },
                  "conditions": {
                    "minItems": 1,
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": [
                            "description",
                            "notes",
                            "category",
                            "accountId",
                            "type",
                            "merchantId"
                          ]
                        },
                        "operator": {
                          "type": "string",
                          "enum": [
                            "contains",
                            "equals"
                          ]
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "field",
                        "operator",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "actions": {
                    "type": "object",
                    "properties": {
                      "categoryId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,80}$"
                      },
                      "merchantId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tagIds": {
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "notes": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "excluded": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "name",
                  "active",
                  "priority",
                  "conditions",
                  "actions"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "id",
              "rule"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "rule_apply"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "ids": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              }
            },
            "required": [
              "type",
              "id",
              "ids"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "statement_create"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "accountId": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "rows": {
                "minItems": 1,
                "maxItems": 1000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "income",
                        "expense"
                      ]
                    },
                    "poisha": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "category": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "date",
                    "description",
                    "type",
                    "poisha",
                    "category",
                    "categoryId"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "name",
              "accountId",
              "rows"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "statement_commit"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "rowIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "includeDuplicateRowIds": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "links": {
                "default": [],
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rowId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "transactionId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "required": [
                    "rowId",
                    "transactionId"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "id",
              "rowIds",
              "includeDuplicateRowIds",
              "links"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "statement_ignore"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "rowIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                }
              },
              "ignored": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "id",
              "rowIds",
              "ignored"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "statement_reconcile"
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,80}$"
              },
              "date": {
                "type": "string"
              },
              "balancePoisha": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "type",
              "id",
              "date",
              "balancePoisha"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WorkbenchEnvelope": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "command": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "rule_create"
                  },
                  "rule": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "priority": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999
                      },
                      "conditions": {
                        "minItems": 1,
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string",
                              "enum": [
                                "description",
                                "notes",
                                "category",
                                "accountId",
                                "type",
                                "merchantId"
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "contains",
                                "equals"
                              ]
                            },
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            }
                          },
                          "required": [
                            "field",
                            "operator",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "actions": {
                        "type": "object",
                        "properties": {
                          "categoryId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          "merchantId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tagIds": {
                            "maxItems": 500,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            }
                          },
                          "notes": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "excluded": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "name",
                      "active",
                      "priority",
                      "conditions",
                      "actions"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "rule"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "rule_update"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "rule": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "priority": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9999
                      },
                      "conditions": {
                        "minItems": 1,
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string",
                              "enum": [
                                "description",
                                "notes",
                                "category",
                                "accountId",
                                "type",
                                "merchantId"
                              ]
                            },
                            "operator": {
                              "type": "string",
                              "enum": [
                                "contains",
                                "equals"
                              ]
                            },
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            }
                          },
                          "required": [
                            "field",
                            "operator",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "actions": {
                        "type": "object",
                        "properties": {
                          "categoryId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,80}$"
                          },
                          "merchantId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9_-]{1,80}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tagIds": {
                            "maxItems": 500,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            }
                          },
                          "notes": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "excluded": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "name",
                      "active",
                      "priority",
                      "conditions",
                      "actions"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "id",
                  "rule"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "rule_apply"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "ids": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  }
                },
                "required": [
                  "type",
                  "id",
                  "ids"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "statement_create"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "rows": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "income",
                            "expense"
                          ]
                        },
                        "poisha": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "category": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "categoryId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[A-Za-z0-9_-]{1,80}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "date",
                        "description",
                        "type",
                        "poisha",
                        "category",
                        "categoryId"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "name",
                  "accountId",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "statement_commit"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "rowIds": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "includeDuplicateRowIds": {
                    "default": [],
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "links": {
                    "default": [],
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "rowId": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        "transactionId": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        }
                      },
                      "required": [
                        "rowId",
                        "transactionId"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "id",
                  "rowIds",
                  "includeDuplicateRowIds",
                  "links"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "statement_ignore"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "rowIds": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  },
                  "ignored": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "rowIds",
                  "ignored"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "statement_reconcile"
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,80}$"
                  },
                  "date": {
                    "type": "string"
                  },
                  "balancePoisha": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "type",
                  "id",
                  "date",
                  "balancePoisha"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "expectedRevision",
          "requestId",
          "command"
        ],
        "additionalProperties": false
      },
      "RulePreviewInput": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "ids": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,80}$"
            }
          }
        },
        "required": [
          "ruleId"
        ],
        "additionalProperties": false
      },
      "Profile": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "profile": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "createdAt": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "email",
              "createdAt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "revision",
          "profile"
        ],
        "additionalProperties": false
      },
      "ProfileEnvelope": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "command": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "profile_update"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            },
            "required": [
              "type",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "expectedRevision",
          "requestId",
          "command"
        ],
        "additionalProperties": false
      },
      "SecurityInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "password_change"
              },
              "currentPassword": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "newPassword": {
                "type": "string"
              }
            },
            "required": [
              "action",
              "currentPassword",
              "newPassword"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "sessions_revoke"
              },
              "currentPassword": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "action",
              "currentPassword"
            ],
            "additionalProperties": false
          }
        ]
      },
      "FullBackup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "formatVersion",
          "modelVersion",
          "createdAt",
          "sourceRevision",
          "profile",
          "tables",
          "checksum"
        ],
        "properties": {
          "format": {
            "const": "budget-go-full"
          },
          "formatVersion": {
            "const": 1
          },
          "modelVersion": {
            "const": "d628375ddc01c34c12fe5ae00b1d4aa07c83241e94e1020bf93ebecf3a35f1dc"
          },
          "createdAt": {
            "type": "string"
          },
          "sourceRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "profile": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            }
          },
          "tables": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "Category",
              "Tag",
              "Merchant",
              "FinancialAccount",
              "Transaction",
              "TransactionTag",
              "Transfer",
              "BalanceAdjustment",
              "MatchedTransfer",
              "Budget",
              "WorkspacePreference",
              "AutomationSource",
              "AutomationEvent",
              "RecurringSchedule",
              "RecurringOccurrence",
              "TransactionSplit",
              "MonthlyPlan",
              "FinanceRule",
              "StatementImport",
              "RuleRun"
            ],
            "properties": {
              "Category": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "color",
                    "icon",
                    "parentId",
                    "kind",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "icon": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "parentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "Tag": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "color",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "Merchant": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "color",
                    "website",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "color": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "website": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "FinancialAccount": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "kind",
                    "currency",
                    "openingDate",
                    "openingPoisha",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "kind": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "currency": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "openingDate": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "openingPoisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "Transaction": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "description",
                    "category",
                    "date",
                    "type",
                    "poisha",
                    "accountId",
                    "categoryId",
                    "merchantId",
                    "notes",
                    "status",
                    "excluded"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "type": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "poisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "merchantId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "excluded": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "TransactionTag": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "transactionId",
                    "tagId"
                  ],
                  "properties": {
                    "transactionId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "tagId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  }
                }
              },
              "Transfer": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "fromAccountId",
                    "toAccountId",
                    "description",
                    "date",
                    "toDate",
                    "poisha"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "fromAccountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "toAccountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "toDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1048576
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    }
                  }
                }
              },
              "BalanceAdjustment": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "accountId",
                    "date",
                    "poisha",
                    "balancePoisha",
                    "description"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "poisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "balancePoisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 1048576
                    }
                  }
                }
              },
              "MatchedTransfer": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "transferId",
                    "outgoing",
                    "incoming"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "transferId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "outgoing": {},
                    "incoming": {}
                  }
                }
              },
              "Budget": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "month",
                    "category",
                    "limitPoisha",
                    "categoryId"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "month": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "category": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "limitPoisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "categoryId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "WorkspacePreference": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {}
                  }
                }
              },
              "AutomationSource": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "channel",
                    "providerLabel",
                    "accountId",
                    "enabled"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "channel": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "providerLabel": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "AutomationEvent": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "sourceId",
                    "externalId",
                    "payloadHash",
                    "messageHash",
                    "reference",
                    "receivedAt",
                    "status",
                    "draft",
                    "issues",
                    "duplicateOfEventId",
                    "transactionId",
                    "rawText"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "sourceId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "externalId": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "payloadHash": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "messageHash": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1048576
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reference": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "receivedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "status": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "draft": {},
                    "issues": {
                      "type": "array",
                      "maxItems": 10000,
                      "items": {
                        "type": "string",
                        "maxLength": 1048576
                      }
                    },
                    "duplicateOfEventId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "transactionId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,80}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rawText": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1048576
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "RecurringSchedule": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "accountId",
                    "transaction",
                    "startDate",
                    "frequency",
                    "active",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "transaction": {},
                    "startDate": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "frequency": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "archived": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "RecurringOccurrence": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "scheduleId",
                    "date",
                    "transactionId"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "scheduleId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "date": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "transactionId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    }
                  }
                }
              },
              "TransactionSplit": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "originalTransactionId",
                    "original",
                    "partIds",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "originalTransactionId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "original": {},
                    "partIds": {
                      "type": "array",
                      "maxItems": 10000,
                      "items": {
                        "type": "string",
                        "maxLength": 1048576
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              },
              "MonthlyPlan": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "month",
                    "incomePoisha",
                    "spendingPoisha"
                  ],
                  "properties": {
                    "month": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "incomePoisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    },
                    "spendingPoisha": {
                      "type": "string",
                      "pattern": "^-?\\d{1,16}$",
                      "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                    }
                  }
                }
              },
              "FinanceRule": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "active",
                    "priority",
                    "conditions",
                    "actions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "conditions": {},
                    "actions": {}
                  }
                }
              },
              "StatementImport": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "accountId",
                    "name",
                    "createdAt",
                    "rows",
                    "closingDate",
                    "closingBalancePoisha"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "name": {
                      "type": "string",
                      "maxLength": 1048576
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "rows": {},
                    "closingDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 1048576
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "closingBalancePoisha": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d{1,16}$",
                          "description": "Exact signed integer, bounded by Number.MAX_SAFE_INTEGER at runtime."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              },
              "RuleRun": {
                "type": "array",
                "maxItems": 10000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "ruleId",
                    "createdAt",
                    "matchedCount",
                    "changedIds"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "ruleId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,80}$"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "matchedCount": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "changedIds": {
                      "type": "array",
                      "maxItems": 10000,
                      "items": {
                        "type": "string",
                        "maxLength": 1048576
                      }
                    }
                  }
                }
              }
            }
          },
          "checksum": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "BackupPreview": {
        "type": "object",
        "required": [
          "checksum",
          "counts",
          "warnings"
        ],
        "properties": {
          "checksum": {
            "type": "string"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Workspace"
    },
    {
      "name": "Automation"
    },
    {
      "name": "Credentials"
    },
    {
      "name": "MCP"
    },
    {
      "name": "Planning"
    },
    {
      "name": "Workbench"
    },
    {
      "name": "Account"
    },
    {
      "name": "Backup"
    }
  ]
}
