{ "components": { "schemas": { "AccountBalance": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "balance": { "description": "decimal as string", "title": "Balance", "type": "string" }, "balance_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Balance Rub" }, "currency": { "title": "Currency", "type": "string" }, "name": { "title": "Name", "type": "string" }, "role": { "$ref": "#/components/schemas/AccountRole" } }, "required": [ "account_id", "name", "currency", "role", "balance", "balance_rub" ], "title": "AccountBalance", "type": "object" }, "AccountCreate": { "additionalProperties": false, "description": "A broker account for report imports. T-Invest accounts come from the sync, not from here.", "properties": { "broker": { "$ref": "#/components/schemas/Broker" }, "currency": { "default": "RUB", "maxLength": 3, "minLength": 3, "title": "Currency", "type": "string" }, "name": { "maxLength": 256, "minLength": 1, "title": "Name", "type": "string" }, "source_id": { "description": "Agreement number exactly as the broker's report prints it", "maxLength": 128, "minLength": 1, "title": "Source Id", "type": "string" } }, "required": [ "name", "broker", "source_id" ], "title": "AccountCreate", "type": "object" }, "AccountKind": { "enum": [ "zm_cash", "zm_card", "zm_checking", "zm_deposit", "zm_loan", "zm_emoney", "zm_debt", "broker", "manual_asset" ], "title": "AccountKind", "type": "string" }, "AccountOut": { "properties": { "archived": { "title": "Archived", "type": "boolean" }, "balance": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Balance" }, "balance_as_of": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Balance As Of" }, "broker": { "anyOf": [ { "$ref": "#/components/schemas/Broker" }, { "type": "null" } ] }, "credit_limit": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Credit Limit" }, "currency": { "title": "Currency", "type": "string" }, "disabled": { "title": "Disabled", "type": "boolean" }, "id": { "title": "Id", "type": "integer" }, "include_in_net_worth": { "title": "Include In Net Worth", "type": "boolean" }, "kind": { "$ref": "#/components/schemas/AccountKind" }, "mirror_of_account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mirror Of Account Id" }, "name": { "title": "Name", "type": "string" }, "opened_at": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Opened At" }, "primary_event_source": { "anyOf": [ { "$ref": "#/components/schemas/EventSource" }, { "type": "null" } ] }, "role": { "$ref": "#/components/schemas/AccountRole" }, "source": { "title": "Source", "type": "string" }, "source_id": { "title": "Source Id", "type": "string" }, "start_balance": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Start Balance" }, "value_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Value Rub" } }, "required": [ "id", "kind", "source", "source_id", "broker", "name", "currency", "role", "include_in_net_worth", "mirror_of_account_id", "primary_event_source", "archived", "disabled", "opened_at", "balance", "balance_as_of", "start_balance", "credit_limit" ], "title": "AccountOut", "type": "object" }, "AccountPatch": { "additionalProperties": false, "description": "Only the fields the user owns: everything else comes from the source on each sync.\n\nUnset fields are left alone; an explicit `null` clears the column.", "properties": { "disabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Disabled" }, "include_in_net_worth": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Include In Net Worth" }, "mirror_of_account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mirror Of Account Id" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "primary_event_source": { "anyOf": [ { "$ref": "#/components/schemas/EventSource" }, { "type": "null" } ] }, "role": { "anyOf": [ { "$ref": "#/components/schemas/AccountRole" }, { "type": "null" } ] } }, "title": "AccountPatch", "type": "object" }, "AccountRole": { "enum": [ "liquid", "savings", "investment", "debt" ], "title": "AccountRole", "type": "string" }, "AccountSuggestion": { "description": "A broker account the user may attach an import to when the report's number matched none.", "properties": { "broker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Broker" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "source_id": { "title": "Source Id", "type": "string" } }, "required": [ "id", "name", "broker", "source_id" ], "title": "AccountSuggestion", "type": "object" }, "AllocationBucket": { "properties": { "bucket": { "title": "Bucket", "type": "string" }, "dimension": { "$ref": "#/components/schemas/AllocationDimension" }, "holding_count": { "title": "Holding Count", "type": "integer" }, "value_rub": { "description": "decimal as string", "title": "Value Rub", "type": "string" }, "weight": { "description": "decimal as string", "title": "Weight", "type": "string" } }, "required": [ "dimension", "bucket", "value_rub", "weight", "holding_count" ], "title": "AllocationBucket", "type": "object" }, "AllocationDimension": { "description": "How a portfolio can be sliced. Every dimension covers the SAME total — securities\nplus cash — so the weights of any one of them add up to 1 and the charts agree.", "enum": [ "asset_class", "sector", "country", "currency" ], "title": "AllocationDimension", "type": "string" }, "BenchmarkComparison": { "properties": { "rows": { "items": { "$ref": "#/components/schemas/BenchmarkComparisonOut" }, "title": "Rows", "type": "array" } }, "required": [ "rows" ], "title": "BenchmarkComparison", "type": "object" }, "BenchmarkComparisonOut": { "properties": { "benchmarks": { "items": { "$ref": "#/components/schemas/BenchmarkReturnOut" }, "title": "Benchmarks", "type": "array" }, "date_from": { "format": "date", "title": "Date From", "type": "string" }, "date_to": { "format": "date", "title": "Date To", "type": "string" }, "period": { "title": "Period", "type": "string" }, "portfolio_days_skipped": { "title": "Portfolio Days Skipped", "type": "integer" }, "portfolio_twr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Portfolio Twr" }, "portfolio_twr_annualized": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Portfolio Twr Annualized" } }, "required": [ "period", "date_from", "date_to", "portfolio_twr", "portfolio_twr_annualized", "portfolio_days_skipped", "benchmarks" ], "title": "BenchmarkComparisonOut", "type": "object" }, "BenchmarkCreate": { "properties": { "code": { "maxLength": 32, "minLength": 1, "title": "Code", "type": "string" }, "currency": { "default": "RUB", "title": "Currency", "type": "string" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "is_active": { "default": true, "title": "Is Active", "type": "boolean" }, "is_default": { "default": false, "title": "Is Default", "type": "boolean" }, "kind": { "title": "Kind", "type": "string" }, "name": { "maxLength": 128, "minLength": 1, "title": "Name", "type": "string" }, "source": { "default": "moex", "title": "Source", "type": "string" } }, "required": [ "code", "name", "kind" ], "title": "BenchmarkCreate", "type": "object" }, "BenchmarkOut": { "properties": { "code": { "title": "Code", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "history_from": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "History From" }, "history_to": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "History To" }, "id": { "title": "Id", "type": "integer" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "is_active": { "title": "Is Active", "type": "boolean" }, "is_default": { "title": "Is Default", "type": "boolean" }, "kind": { "title": "Kind", "type": "string" }, "name": { "title": "Name", "type": "string" }, "source": { "title": "Source", "type": "string" } }, "required": [ "id", "code", "name", "kind", "source", "currency", "is_default", "is_active", "instrument_id", "history_from", "history_to" ], "title": "BenchmarkOut", "type": "object" }, "BenchmarkPatch": { "properties": { "code": { "anyOf": [ { "maxLength": 32, "minLength": 1, "type": "string" }, { "type": "null" } ], "title": "Code" }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Currency" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" }, "is_default": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Default" }, "kind": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Kind" }, "name": { "anyOf": [ { "maxLength": 128, "minLength": 1, "type": "string" }, { "type": "null" } ], "title": "Name" }, "source": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Source" } }, "title": "BenchmarkPatch", "type": "object" }, "BenchmarkReturnOut": { "properties": { "benchmark_id": { "title": "Benchmark Id", "type": "integer" }, "code": { "title": "Code", "type": "string" }, "days_skipped": { "title": "Days Skipped", "type": "integer" }, "excess": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Excess" }, "kind": { "title": "Kind", "type": "string" }, "name": { "title": "Name", "type": "string" }, "twr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Twr" }, "twr_annualized": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Twr Annualized" } }, "required": [ "benchmark_id", "code", "name", "kind", "twr", "twr_annualized", "days_skipped", "excess" ], "title": "BenchmarkReturnOut", "type": "object" }, "Body_imports_create": { "properties": { "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "target account, if known", "title": "Account Id" }, "file": { "contentMediaType": "application/octet-stream", "description": "the report itself", "title": "File", "type": "string" }, "parser": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "force a parser from registry.names()", "title": "Parser" } }, "required": [ "file" ], "title": "Body_imports_create", "type": "object" }, "Broker": { "enum": [ "tinvest", "sber", "vtb", "other" ], "title": "Broker", "type": "string" }, "CalendarEntry": { "properties": { "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "amount_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Amount Rub" }, "basis": { "title": "Basis", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "expected_date": { "format": "date", "title": "Expected Date", "type": "string" }, "instrument_id": { "title": "Instrument Id", "type": "integer" }, "kind": { "title": "Kind", "type": "string" }, "name": { "title": "Name", "type": "string" }, "per_unit": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Per Unit" }, "qty": { "description": "decimal as string", "title": "Qty", "type": "string" }, "record_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Record Date" }, "tax_withheld": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Tax Withheld" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" } }, "required": [ "instrument_id", "ticker", "name", "kind", "expected_date", "record_date", "qty", "per_unit", "amount", "currency", "amount_rub", "basis", "tax_withheld" ], "title": "CalendarEntry", "type": "object" }, "CalendarOut": { "properties": { "as_of": { "format": "date", "title": "As Of", "type": "string" }, "by_basis": { "additionalProperties": { "description": "decimal as string", "type": "string" }, "title": "By Basis", "type": "object" }, "currency": { "title": "Currency", "type": "string" }, "entries": { "items": { "$ref": "#/components/schemas/CalendarEntry" }, "title": "Entries", "type": "array" }, "total_expected_rub": { "description": "decimal as string", "title": "Total Expected Rub", "type": "string" } }, "required": [ "as_of", "currency", "total_expected_rub", "entries", "by_basis" ], "title": "CalendarOut", "type": "object" }, "CashFlowBrokerMonth": { "properties": { "deposits_rub": { "description": "decimal as string", "title": "Deposits Rub", "type": "string" }, "event_count": { "title": "Event Count", "type": "integer" }, "month": { "format": "date", "title": "Month", "type": "string" }, "net_rub": { "description": "decimal as string", "title": "Net Rub", "type": "string" }, "withdrawals_rub": { "description": "decimal as string", "title": "Withdrawals Rub", "type": "string" } }, "required": [ "month", "deposits_rub", "withdrawals_rub", "net_rub", "event_count" ], "title": "CashFlowBrokerMonth", "type": "object" }, "CashFlowMonth": { "properties": { "baseline_rub": { "description": "decimal as string", "title": "Baseline Rub", "type": "string" }, "expense_rub": { "description": "decimal as string", "title": "Expense Rub", "type": "string" }, "income_rub": { "description": "decimal as string", "title": "Income Rub", "type": "string" }, "month": { "format": "date", "title": "Month", "type": "string" }, "one_off_rub": { "description": "decimal as string", "title": "One Off Rub", "type": "string" }, "savings_rate": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Savings Rate" }, "savings_transfer_rub": { "description": "decimal as string", "title": "Savings Transfer Rub", "type": "string" }, "txn_count": { "title": "Txn Count", "type": "integer" } }, "required": [ "month", "income_rub", "expense_rub", "baseline_rub", "one_off_rub", "savings_transfer_rub", "savings_rate", "txn_count" ], "title": "CashFlowMonth", "type": "object" }, "CategoryOut": { "description": "Flat list; the client builds the tree from `parent_id` (ZenMoney nests one level).", "properties": { "archived": { "title": "Archived", "type": "boolean" }, "color": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Color" }, "icon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Icon" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "parent_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Parent Id" }, "show_income": { "title": "Show Income", "type": "boolean" }, "show_outcome": { "title": "Show Outcome", "type": "boolean" } }, "required": [ "id", "parent_id", "name", "icon", "color", "show_income", "show_outcome", "archived" ], "title": "CategoryOut", "type": "object" }, "CommitRequest": { "properties": { "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" }, "confirm_duplicates": { "default": false, "title": "Confirm Duplicates", "type": "boolean" }, "dry_run": { "default": false, "title": "Dry Run", "type": "boolean" } }, "title": "CommitRequest", "type": "object" }, "DataQualityRow": { "properties": { "check_name": { "title": "Check Name", "type": "string" }, "computed_at": { "format": "date-time", "title": "Computed At", "type": "string" }, "count": { "title": "Count", "type": "integer" }, "detail": { "title": "Detail", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "ref": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Ref" }, "severity": { "title": "Severity", "type": "string" } }, "required": [ "id", "check_name", "severity", "detail", "count", "ref", "computed_at" ], "title": "DataQualityRow", "type": "object" }, "EventKind": { "enum": [ "buy", "sell", "dividend", "coupon", "interest", "tax", "tax_refund", "commission", "deposit", "withdrawal", "transfer_in", "transfer_out", "split", "amortization", "repayment", "fx_exchange", "other" ], "title": "EventKind", "type": "string" }, "EventOut": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "accrued_interest": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Accrued Interest" }, "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "amount_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Amount Rub" }, "currency": { "title": "Currency", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "external_flow": { "title": "External Flow", "type": "boolean" }, "fee": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Fee" }, "id": { "title": "Id", "type": "integer" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "kind": { "$ref": "#/components/schemas/EventKind" }, "price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Price" }, "price_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Price Currency" }, "quantity": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Quantity" }, "source": { "title": "Source", "type": "string" }, "status": { "$ref": "#/components/schemas/EventStatus" }, "tax": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Tax" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" }, "trade_date": { "format": "date", "title": "Trade Date", "type": "string" }, "ts": { "format": "date-time", "title": "Ts", "type": "string" } }, "required": [ "id", "account_id", "instrument_id", "ticker", "kind", "status", "trade_date", "ts", "quantity", "price", "price_currency", "amount", "amount_rub", "currency", "fee", "tax", "accrued_interest", "description", "source", "external_flow" ], "title": "EventOut", "type": "object" }, "EventPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/EventOut" }, "title": "Items", "type": "array" }, "page": { "title": "Page", "type": "integer" }, "page_size": { "title": "Page Size", "type": "integer" }, "total": { "title": "Total", "type": "integer" } }, "required": [ "items", "total", "page", "page_size" ], "title": "EventPage", "type": "object" }, "EventSource": { "description": "Which feed is the truth for an account's ledger; others become `shadow` events.", "enum": [ "tinvest_api", "report_sber", "report_vtb", "csv", "manual" ], "title": "EventSource", "type": "string" }, "EventStatus": { "enum": [ "confirmed", "pending", "shadow", "ignored" ], "title": "EventStatus", "type": "string" }, "FlowType": { "enum": [ "income", "expense", "internal_transfer", "savings_transfer", "broker_external_flow", "deleted", "other" ], "title": "FlowType", "type": "string" }, "ForecastMonth": { "properties": { "amount_rub": { "description": "decimal as string", "title": "Amount Rub", "type": "string" }, "by_basis": { "additionalProperties": { "description": "decimal as string", "type": "string" }, "title": "By Basis", "type": "object" }, "month": { "format": "date", "title": "Month", "type": "string" } }, "required": [ "month", "amount_rub", "by_basis" ], "title": "ForecastMonth", "type": "object" }, "ForecastOut": { "properties": { "annual_yield_on_value": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Annual Yield On Value" }, "months": { "items": { "$ref": "#/components/schemas/ForecastMonth" }, "title": "Months", "type": "array" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" }, "warnings": { "items": { "type": "string" }, "title": "Warnings", "type": "array" } }, "required": [ "months", "total_rub", "annual_yield_on_value", "warnings" ], "title": "ForecastOut", "type": "object" }, "GoalCreate": { "additionalProperties": false, "properties": { "archived": { "default": false, "title": "Archived", "type": "boolean" }, "currency": { "default": "RUB", "maxLength": 3, "minLength": 3, "title": "Currency", "type": "string" }, "monthly_contribution": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Monthly Contribution" }, "name": { "maxLength": 128, "minLength": 1, "title": "Name", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "scope": { "default": "all", "maxLength": 32, "title": "Scope", "type": "string" }, "target_amount": { "description": "decimal as string", "title": "Target Amount", "type": "string" }, "target_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Target Date" } }, "required": [ "name", "target_amount" ], "title": "GoalCreate", "type": "object" }, "GoalOut": { "properties": { "archived": { "title": "Archived", "type": "boolean" }, "currency": { "title": "Currency", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "monthly_contribution": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Monthly Contribution" }, "name": { "title": "Name", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "scope": { "title": "Scope", "type": "string" }, "target_amount": { "description": "decimal as string", "title": "Target Amount", "type": "string" }, "target_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Target Date" } }, "required": [ "id", "name", "scope", "target_amount", "currency", "target_date", "monthly_contribution", "note", "archived" ], "title": "GoalOut", "type": "object" }, "GoalPatch": { "additionalProperties": false, "properties": { "archived": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Archived" }, "currency": { "anyOf": [ { "maxLength": 3, "minLength": 3, "type": "string" }, { "type": "null" } ], "title": "Currency" }, "monthly_contribution": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Monthly Contribution" }, "name": { "anyOf": [ { "maxLength": 128, "minLength": 1, "type": "string" }, { "type": "null" } ], "title": "Name" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "scope": { "anyOf": [ { "maxLength": 32, "type": "string" }, { "type": "null" } ], "title": "Scope" }, "target_amount": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Target Amount" }, "target_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Target Date" } }, "title": "GoalPatch", "type": "object" }, "GoalProgressOut": { "properties": { "as_of": { "format": "date", "title": "As Of", "type": "string" }, "assumed_rate": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Assumed Rate" }, "basis": { "title": "Basis", "type": "string" }, "current_value_rub": { "description": "decimal as string", "title": "Current Value Rub", "type": "string" }, "goal_id": { "title": "Goal Id", "type": "integer" }, "monthly_needed_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Monthly Needed Rub" }, "on_track": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "On Track" }, "progress": { "description": "decimal as string", "title": "Progress", "type": "string" }, "projected_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Projected Date" }, "target_amount_rub": { "description": "decimal as string", "title": "Target Amount Rub", "type": "string" } }, "required": [ "goal_id", "as_of", "current_value_rub", "target_amount_rub", "progress", "projected_date", "basis", "assumed_rate", "monthly_needed_rub", "on_track" ], "title": "GoalProgressOut", "type": "object" }, "Health": { "properties": { "database": { "title": "Database", "type": "string" }, "status": { "title": "Status", "type": "string" }, "version": { "title": "Version", "type": "string" } }, "required": [ "status", "version", "database" ], "title": "Health", "type": "object" }, "HistoryOut": { "properties": { "rows": { "items": { "$ref": "#/components/schemas/HistoryRow" }, "title": "Rows", "type": "array" }, "totals": { "$ref": "#/components/schemas/HistoryTotals" } }, "required": [ "rows", "totals" ], "title": "HistoryOut", "type": "object" }, "HistoryRow": { "properties": { "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "amount_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Amount Rub" }, "currency": { "title": "Currency", "type": "string" }, "kind": { "title": "Kind", "type": "string" }, "month": { "format": "date", "title": "Month", "type": "string" }, "payment_count": { "title": "Payment Count", "type": "integer" }, "tax_withheld": { "description": "decimal as string", "title": "Tax Withheld", "type": "string" } }, "required": [ "month", "kind", "currency", "amount", "amount_rub", "tax_withheld", "payment_count" ], "title": "HistoryRow", "type": "object" }, "HistoryTotals": { "properties": { "amount_rub": { "description": "decimal as string", "title": "Amount Rub", "type": "string" }, "tax_withheld_rub": { "description": "decimal as string", "title": "Tax Withheld Rub", "type": "string" } }, "required": [ "amount_rub", "tax_withheld_rub" ], "title": "HistoryTotals", "type": "object" }, "HoldingOut": { "properties": { "accrued_interest_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Accrued Interest Rub" }, "asset_class": { "title": "Asset Class", "type": "string" }, "avg_cost": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Avg Cost" }, "board": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Board" }, "cost_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cost Currency" }, "cost_total_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Cost Total Rub" }, "currency": { "title": "Currency", "type": "string" }, "days_held": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Days Held" }, "first_buy_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "First Buy Date" }, "income_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Income Rub" }, "instrument_id": { "title": "Instrument Id", "type": "integer" }, "ldv_eligible_qty": { "description": "decimal as string", "title": "Ldv Eligible Qty", "type": "string" }, "logo_color": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Logo Color" }, "logo_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Logo Url" }, "market_price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Market Price" }, "name": { "title": "Name", "type": "string" }, "price_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Price Currency" }, "price_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Price Date" }, "price_status": { "title": "Price Status", "type": "string" }, "qty": { "description": "decimal as string", "title": "Qty", "type": "string" }, "realized_pnl_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Realized Pnl Rub" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" }, "unrealized_pnl_native": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Unrealized Pnl Native" }, "unrealized_pnl_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Unrealized Pnl Rub" }, "value_native": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Value Native" }, "value_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Value Rub" }, "weight": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Weight" }, "xirr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Xirr" } }, "required": [ "instrument_id", "ticker", "name", "asset_class", "board", "currency", "qty", "avg_cost", "cost_currency", "cost_total_rub", "market_price", "price_currency", "price_date", "price_status", "value_native", "value_rub", "accrued_interest_rub", "unrealized_pnl_native", "unrealized_pnl_rub", "realized_pnl_rub", "income_rub", "weight", "xirr", "first_buy_date", "days_held", "ldv_eligible_qty" ], "title": "HoldingOut", "type": "object" }, "ImportCounts": { "properties": { "by_kind": { "additionalProperties": { "type": "integer" }, "title": "By Kind", "type": "object" }, "events_duplicate": { "title": "Events Duplicate", "type": "integer" }, "events_new": { "title": "Events New", "type": "integer" }, "events_pending": { "title": "Events Pending", "type": "integer" }, "events_shadow": { "title": "Events Shadow", "type": "integer" }, "events_total": { "title": "Events Total", "type": "integer" }, "lines": { "title": "Lines", "type": "integer" } }, "required": [ "lines", "events_total", "events_new", "events_duplicate", "events_shadow", "events_pending", "by_kind" ], "title": "ImportCounts", "type": "object" }, "ImportPreview": { "description": "The full preview: `POST /imports` and `GET /imports/{id}` both return this.", "properties": { "account_external_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Account External Id" }, "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" }, "account_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Account Name" }, "account_suggestions": { "items": { "$ref": "#/components/schemas/AccountSuggestion" }, "title": "Account Suggestions", "type": "array" }, "broker": { "title": "Broker", "type": "string" }, "committed_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Committed At" }, "counts": { "$ref": "#/components/schemas/ImportCounts" }, "duplicate_of_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duplicate Of Id" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" }, "filename": { "title": "Filename", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "parse_status": { "title": "Parse Status", "type": "string" }, "parser_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Parser Name" }, "parser_version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Parser Version" }, "pending_instruments": { "items": { "$ref": "#/components/schemas/PendingInstrumentOut" }, "title": "Pending Instruments", "type": "array" }, "period_from": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Period From" }, "period_to": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Period To" }, "reconciliation": { "$ref": "#/components/schemas/ReconciliationOut" }, "sample_events": { "items": { "$ref": "#/components/schemas/SampleEventOut" }, "title": "Sample Events", "type": "array" }, "sha256": { "title": "Sha256", "type": "string" }, "size_bytes": { "title": "Size Bytes", "type": "integer" }, "uploaded_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Uploaded At" }, "warnings": { "items": { "type": "string" }, "title": "Warnings", "type": "array" } }, "required": [ "id", "broker", "filename", "sha256", "size_bytes", "parse_status", "counts", "reconciliation" ], "title": "ImportPreview", "type": "object" }, "ImportResult": { "properties": { "committed": { "title": "Committed", "type": "boolean" }, "events_created": { "title": "Events Created", "type": "integer" }, "events_shadow": { "title": "Events Shadow", "type": "integer" }, "events_skipped": { "title": "Events Skipped", "type": "integer" }, "events_updated": { "title": "Events Updated", "type": "integer" }, "import_id": { "title": "Import Id", "type": "integer" }, "metrics_refreshed": { "title": "Metrics Refreshed", "type": "boolean" }, "pending_instruments": { "title": "Pending Instruments", "type": "integer" }, "reconciliation": { "$ref": "#/components/schemas/ReconciliationOut" } }, "required": [ "import_id", "committed", "events_created", "events_updated", "events_skipped", "events_shadow", "pending_instruments", "reconciliation", "metrics_refreshed" ], "title": "ImportResult", "type": "object" }, "ImportSummary": { "description": "One import without the heavy parts — what `GET /imports` lists.", "properties": { "account_external_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Account External Id" }, "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" }, "account_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Account Name" }, "broker": { "title": "Broker", "type": "string" }, "committed_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Committed At" }, "counts": { "$ref": "#/components/schemas/ImportCounts" }, "duplicate_of_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duplicate Of Id" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" }, "filename": { "title": "Filename", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "parse_status": { "title": "Parse Status", "type": "string" }, "parser_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Parser Name" }, "parser_version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Parser Version" }, "period_from": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Period From" }, "period_to": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Period To" }, "sha256": { "title": "Sha256", "type": "string" }, "size_bytes": { "title": "Size Bytes", "type": "integer" }, "uploaded_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Uploaded At" } }, "required": [ "id", "broker", "filename", "sha256", "size_bytes", "parse_status", "counts" ], "title": "ImportSummary", "type": "object" }, "InstrumentDetail": { "properties": { "events": { "items": { "$ref": "#/components/schemas/EventOut" }, "title": "Events", "type": "array" }, "holding": { "anyOf": [ { "$ref": "#/components/schemas/HoldingOut" }, { "type": "null" } ] }, "instrument": { "$ref": "#/components/schemas/InstrumentOut" }, "lots": { "items": { "$ref": "#/components/schemas/LotOut" }, "title": "Lots", "type": "array" }, "prices": { "items": { "$ref": "#/components/schemas/PricePoint" }, "title": "Prices", "type": "array" } }, "required": [ "instrument", "holding", "lots", "events", "prices" ], "title": "InstrumentDetail", "type": "object" }, "InstrumentOut": { "properties": { "asset_class": { "title": "Asset Class", "type": "string" }, "board": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Board" }, "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Country" }, "currency": { "title": "Currency", "type": "string" }, "exchange": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Exchange" }, "figi": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Figi" }, "id": { "title": "Id", "type": "integer" }, "is_active": { "title": "Is Active", "type": "boolean" }, "isin": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Isin" }, "issuer": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Issuer" }, "logo_color": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Logo Color" }, "logo_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Logo Url" }, "lot": { "title": "Lot", "type": "integer" }, "maturity_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Maturity Date" }, "name": { "title": "Name", "type": "string" }, "nominal": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Nominal" }, "nominal_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Nominal Currency" }, "sector": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Sector" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" } }, "required": [ "id", "asset_class", "isin", "figi", "ticker", "board", "exchange", "name", "issuer", "currency", "lot", "nominal", "nominal_currency", "maturity_date", "sector", "country", "is_active" ], "title": "InstrumentOut", "type": "object" }, "InstrumentPatch": { "additionalProperties": false, "description": "The fields a person may correct by hand. Unset fields are left alone; an explicit `null`\nclears the nullable ones (`board`, `sector`).", "properties": { "asset_class": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Asset Class" }, "board": { "anyOf": [ { "maxLength": 16, "type": "string" }, { "type": "null" } ], "title": "Board" }, "lot": { "anyOf": [ { "minimum": 1.0, "type": "integer" }, { "type": "null" } ], "title": "Lot" }, "name": { "anyOf": [ { "maxLength": 256, "minLength": 1, "type": "string" }, { "type": "null" } ], "title": "Name" }, "sector": { "anyOf": [ { "maxLength": 64, "type": "string" }, { "type": "null" } ], "title": "Sector" } }, "title": "InstrumentPatch", "type": "object" }, "JobStatus": { "enum": [ "queued", "running", "done", "error" ], "title": "JobStatus", "type": "string" }, "LinkCreate": { "properties": { "cash_txn_id": { "title": "Cash Txn Id", "type": "integer" }, "event_id": { "title": "Event Id", "type": "integer" } }, "required": [ "cash_txn_id", "event_id" ], "title": "LinkCreate", "type": "object" }, "LinkOut": { "properties": { "amount_delta": { "description": "decimal as string", "title": "Amount Delta", "type": "string" }, "cash_txn_id": { "title": "Cash Txn Id", "type": "integer" }, "confidence": { "description": "decimal as string", "title": "Confidence", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "day_gap": { "title": "Day Gap", "type": "integer" }, "event_id": { "title": "Event Id", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "kind": { "title": "Kind", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" } }, "required": [ "id", "cash_txn_id", "event_id", "kind", "confidence", "amount_delta", "currency", "day_gap", "note" ], "title": "LinkOut", "type": "object" }, "LoginRequest": { "properties": { "email": { "format": "email", "title": "Email", "type": "string" }, "password": { "maxLength": 1024, "minLength": 1, "title": "Password", "type": "string" } }, "required": [ "email", "password" ], "title": "LoginRequest", "type": "object" }, "LotOut": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "closed_at": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Closed At" }, "cost_currency": { "title": "Cost Currency", "type": "string" }, "cost_per_unit": { "description": "decimal as string", "title": "Cost Per Unit", "type": "string" }, "cost_total_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Cost Total Rub" }, "id": { "title": "Id", "type": "integer" }, "open_date": { "format": "date", "title": "Open Date", "type": "string" }, "qty_open": { "description": "decimal as string", "title": "Qty Open", "type": "string" }, "qty_remaining": { "description": "decimal as string", "title": "Qty Remaining", "type": "string" } }, "required": [ "id", "account_id", "open_date", "qty_open", "qty_remaining", "cost_per_unit", "cost_currency", "cost_total_rub", "closed_at" ], "title": "LotOut", "type": "object" }, "ManualEventCreate": { "additionalProperties": false, "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "accrued_interest": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Accrued Interest" }, "amount": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Amount" }, "currency": { "anyOf": [ { "maxLength": 3, "minLength": 3, "type": "string" }, { "type": "null" } ], "title": "Currency" }, "description": { "anyOf": [ { "maxLength": 500, "type": "string" }, { "type": "null" } ], "title": "Description" }, "fee": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Fee" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "kind": { "$ref": "#/components/schemas/EventKind" }, "price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Price" }, "quantity": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Quantity" }, "trade_date": { "format": "date", "title": "Trade Date", "type": "string" } }, "required": [ "account_id", "kind", "trade_date" ], "title": "ManualEventCreate", "type": "object" }, "MetricsStatusOut": { "properties": { "consistent": { "title": "Consistent", "type": "boolean" }, "last_refresh": { "anyOf": [ { "$ref": "#/components/schemas/RefreshLogOut" }, { "type": "null" } ] }, "refreshing": { "title": "Refreshing", "type": "boolean" } }, "required": [ "last_refresh", "consistent", "refreshing" ], "title": "MetricsStatusOut", "type": "object" }, "NetWorthBreakdown": { "properties": { "accounts": { "items": { "$ref": "#/components/schemas/AccountBalance" }, "title": "Accounts", "type": "array" }, "by_currency": { "additionalProperties": { "type": "string" }, "title": "By Currency", "type": "object" }, "d": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "D" }, "debt_rub": { "description": "decimal as string", "title": "Debt Rub", "type": "string" }, "investment_rub": { "description": "decimal as string", "title": "Investment Rub", "type": "string" }, "liquid_rub": { "description": "decimal as string", "title": "Liquid Rub", "type": "string" }, "missing_fx_count": { "title": "Missing Fx Count", "type": "integer" }, "savings_rub": { "description": "decimal as string", "title": "Savings Rub", "type": "string" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" } }, "required": [ "d", "total_rub", "liquid_rub", "savings_rub", "investment_rub", "debt_rub", "by_currency", "missing_fx_count", "accounts" ], "title": "NetWorthBreakdown", "type": "object" }, "NetWorthDay": { "properties": { "by_currency": { "additionalProperties": { "type": "string" }, "title": "By Currency", "type": "object" }, "d": { "format": "date", "title": "D", "type": "string" }, "debt_rub": { "description": "decimal as string", "title": "Debt Rub", "type": "string" }, "investment_rub": { "description": "decimal as string", "title": "Investment Rub", "type": "string" }, "liquid_rub": { "description": "decimal as string", "title": "Liquid Rub", "type": "string" }, "missing_fx_count": { "title": "Missing Fx Count", "type": "integer" }, "savings_rub": { "description": "decimal as string", "title": "Savings Rub", "type": "string" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" } }, "required": [ "d", "total_rub", "liquid_rub", "savings_rub", "investment_rub", "debt_rub", "by_currency", "missing_fx_count" ], "title": "NetWorthDay", "type": "object" }, "NewInstrument": { "description": "The instrument to create from a report's own data (`action = \"create\"`).", "properties": { "asset_class": { "title": "Asset Class", "type": "string" }, "board": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Board" }, "currency": { "default": "RUB", "title": "Currency", "type": "string" }, "isin": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Isin" }, "lot": { "default": 1, "title": "Lot", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" } }, "required": [ "asset_class", "name" ], "title": "NewInstrument", "type": "object" }, "PendingInstrumentOut": { "properties": { "asset_class_hint": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Asset Class Hint" }, "board": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Board" }, "created_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Created At" }, "currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Currency" }, "first_seen_file_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "First Seen File Id" }, "id": { "title": "Id", "type": "integer" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "isin": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Isin" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "occurrences": { "title": "Occurrences", "type": "integer" }, "sample_price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Sample Price" }, "sample_quantity": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Sample Quantity" }, "source": { "title": "Source", "type": "string" }, "source_key": { "title": "Source Key", "type": "string" }, "status": { "title": "Status", "type": "string" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" } }, "required": [ "id", "source", "source_key", "occurrences", "status" ], "title": "PendingInstrumentOut", "type": "object" }, "PendingResolveRequest": { "properties": { "action": { "enum": [ "link", "create", "ignore" ], "title": "Action", "type": "string" }, "instrument": { "anyOf": [ { "$ref": "#/components/schemas/NewInstrument" }, { "type": "null" } ] }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" } }, "required": [ "action" ], "title": "PendingResolveRequest", "type": "object" }, "PendingResolveResult": { "properties": { "alias_created": { "title": "Alias Created", "type": "boolean" }, "events_bound": { "title": "Events Bound", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "metrics_refreshed": { "title": "Metrics Refreshed", "type": "boolean" }, "status": { "title": "Status", "type": "string" } }, "required": [ "id", "status", "events_bound", "alias_created", "metrics_refreshed" ], "title": "PendingResolveResult", "type": "object" }, "PortfolioAccountsIn": { "additionalProperties": false, "description": "The complete set: accounts not listed are removed from the portfolio.", "properties": { "account_ids": { "items": { "type": "integer" }, "title": "Account Ids", "type": "array" } }, "required": [ "account_ids" ], "title": "PortfolioAccountsIn", "type": "object" }, "PortfolioCreate": { "additionalProperties": false, "properties": { "account_ids": { "items": { "type": "integer" }, "title": "Account Ids", "type": "array" }, "name": { "maxLength": 128, "minLength": 1, "title": "Name", "type": "string" } }, "required": [ "name" ], "title": "PortfolioCreate", "type": "object" }, "PortfolioOut": { "properties": { "account_ids": { "items": { "type": "integer" }, "title": "Account Ids", "type": "array" }, "base_currency": { "title": "Base Currency", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" } }, "required": [ "id", "name", "base_currency", "account_ids" ], "title": "PortfolioOut", "type": "object" }, "PortfolioPatch": { "additionalProperties": false, "properties": { "name": { "maxLength": 128, "minLength": 1, "title": "Name", "type": "string" } }, "required": [ "name" ], "title": "PortfolioPatch", "type": "object" }, "PriceManualIn": { "properties": { "currency": { "title": "Currency", "type": "string" }, "d": { "format": "date", "title": "D", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "price": { "description": "decimal as string", "title": "Price", "type": "string" } }, "required": [ "d", "price", "currency" ], "title": "PriceManualIn", "type": "object" }, "PriceManualOut": { "properties": { "currency": { "title": "Currency", "type": "string" }, "d": { "format": "date", "title": "D", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "instrument_id": { "title": "Instrument Id", "type": "integer" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "price": { "description": "decimal as string", "title": "Price", "type": "string" } }, "required": [ "id", "instrument_id", "d", "price", "currency", "note" ], "title": "PriceManualOut", "type": "object" }, "PricePoint": { "properties": { "accrued_interest": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Accrued Interest" }, "close": { "description": "decimal as string", "title": "Close", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "d": { "format": "date", "title": "D", "type": "string" }, "source": { "default": "daily", "title": "Source", "type": "string" } }, "required": [ "d", "close", "currency", "accrued_interest" ], "title": "PricePoint", "type": "object" }, "Problem": { "description": "RFC 7807 error body (application/problem+json)", "properties": { "detail": { "type": "string" }, "errors": { "items": {}, "type": "array" }, "status": { "type": "integer" }, "title": { "type": "string" } }, "required": [ "status", "title" ], "title": "Problem", "type": "object" }, "RebalanceBucketOut": { "properties": { "bucket": { "title": "Bucket", "type": "string" }, "current_value_rub": { "description": "decimal as string", "title": "Current Value Rub", "type": "string" }, "current_weight": { "description": "decimal as string", "title": "Current Weight", "type": "string" }, "delta_value_rub": { "description": "decimal as string", "title": "Delta Value Rub", "type": "string" }, "drift": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Drift" }, "target_weight": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Target Weight" }, "trades": { "items": { "$ref": "#/components/schemas/TradeOut" }, "title": "Trades", "type": "array" }, "within_band": { "title": "Within Band", "type": "boolean" } }, "required": [ "bucket", "current_value_rub", "current_weight", "target_weight", "drift", "within_band", "delta_value_rub", "trades" ], "title": "RebalanceBucketOut", "type": "object" }, "RebalanceOut": { "properties": { "as_of": { "format": "date", "title": "As Of", "type": "string" }, "buckets": { "items": { "$ref": "#/components/schemas/RebalanceBucketOut" }, "title": "Buckets", "type": "array" }, "cash_available_rub": { "description": "decimal as string", "title": "Cash Available Rub", "type": "string" }, "dimension": { "title": "Dimension", "type": "string" }, "portfolio_id": { "title": "Portfolio Id", "type": "integer" }, "total_value_rub": { "description": "decimal as string", "title": "Total Value Rub", "type": "string" }, "warnings": { "items": { "type": "string" }, "title": "Warnings", "type": "array" } }, "required": [ "portfolio_id", "dimension", "as_of", "total_value_rub", "cash_available_rub", "buckets", "warnings" ], "title": "RebalanceOut", "type": "object" }, "ReconciliationCash": { "properties": { "balance_derived": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Balance Derived" }, "balance_report": { "description": "decimal as string", "title": "Balance Report", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "delta": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Delta" }, "matches": { "title": "Matches", "type": "boolean" } }, "required": [ "currency", "balance_report", "balance_derived", "delta", "matches" ], "title": "ReconciliationCash", "type": "object" }, "ReconciliationOut": { "properties": { "as_of": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "As Of" }, "cash": { "items": { "$ref": "#/components/schemas/ReconciliationCash" }, "title": "Cash", "type": "array" }, "matches": { "default": true, "title": "Matches", "type": "boolean" }, "positions": { "items": { "$ref": "#/components/schemas/ReconciliationPosition" }, "title": "Positions", "type": "array" } }, "required": [ "as_of" ], "title": "ReconciliationOut", "type": "object" }, "ReconciliationPosition": { "properties": { "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "instrument_name": { "title": "Instrument Name", "type": "string" }, "isin": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Isin" }, "matches": { "title": "Matches", "type": "boolean" }, "qty_delta": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Qty Delta" }, "qty_derived": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Qty Derived" }, "qty_report": { "description": "decimal as string", "title": "Qty Report", "type": "string" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" } }, "required": [ "instrument_id", "instrument_name", "ticker", "isin", "qty_report", "qty_derived", "qty_delta", "matches" ], "title": "ReconciliationPosition", "type": "object" }, "RefreshLogOut": { "properties": { "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" }, "failed_step": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Failed Step" }, "finished_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Finished At" }, "id": { "title": "Id", "type": "integer" }, "started_at": { "format": "date-time", "title": "Started At", "type": "string" }, "step_timings": { "anyOf": [ { "additionalProperties": { "type": "number" }, "type": "object" }, { "type": "null" } ], "title": "Step Timings" }, "trigger": { "title": "Trigger", "type": "string" } }, "required": [ "id", "started_at", "finished_at", "trigger", "error", "failed_step", "step_timings" ], "title": "RefreshLogOut", "type": "object" }, "RefreshRequest": { "properties": { "refresh_token": { "minLength": 1, "title": "Refresh Token", "type": "string" } }, "required": [ "refresh_token" ], "title": "RefreshRequest", "type": "object" }, "ReturnsOut": { "properties": { "abs_pnl_rub": { "description": "decimal as string", "title": "Abs Pnl Rub", "type": "string" }, "date_from": { "format": "date", "title": "Date From", "type": "string" }, "date_to": { "format": "date", "title": "Date To", "type": "string" }, "external_flow_rub": { "description": "decimal as string", "title": "External Flow Rub", "type": "string" }, "period": { "title": "Period", "type": "string" }, "twr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Twr" }, "twr_annualized": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Twr Annualized" }, "twr_days_skipped": { "title": "Twr Days Skipped", "type": "integer" }, "value_end_rub": { "description": "decimal as string", "title": "Value End Rub", "type": "string" }, "value_start_rub": { "description": "decimal as string", "title": "Value Start Rub", "type": "string" }, "xirr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Xirr" } }, "required": [ "period", "date_from", "date_to", "value_start_rub", "value_end_rub", "external_flow_rub", "abs_pnl_rub", "xirr", "twr", "twr_annualized", "twr_days_skipped" ], "title": "ReturnsOut", "type": "object" }, "RuleCreate": { "additionalProperties": false, "properties": { "enabled": { "default": true, "title": "Enabled", "type": "boolean" }, "kind": { "$ref": "#/components/schemas/RuleKind" }, "match_type": { "$ref": "#/components/schemas/RuleMatchType" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "pattern": { "maxLength": 512, "minLength": 1, "title": "Pattern", "type": "string" }, "priority": { "default": 100, "title": "Priority", "type": "integer" }, "value": { "anyOf": [ { "maxLength": 512, "type": "string" }, { "type": "null" } ], "title": "Value" } }, "required": [ "kind", "match_type", "pattern" ], "title": "RuleCreate", "type": "object" }, "RuleKind": { "enum": [ "savings", "one_off", "category", "payee", "broker_target", "ignore" ], "title": "RuleKind", "type": "string" }, "RuleMatchType": { "enum": [ "id", "payee", "comment", "category", "mcc", "account" ], "title": "RuleMatchType", "type": "string" }, "RuleOut": { "properties": { "enabled": { "title": "Enabled", "type": "boolean" }, "id": { "title": "Id", "type": "integer" }, "kind": { "$ref": "#/components/schemas/RuleKind" }, "last_matched_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Last Matched At" }, "match_count": { "title": "Match Count", "type": "integer" }, "match_type": { "$ref": "#/components/schemas/RuleMatchType" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "pattern": { "title": "Pattern", "type": "string" }, "priority": { "title": "Priority", "type": "integer" }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Value" } }, "required": [ "id", "kind", "match_type", "pattern", "value", "note", "enabled", "priority", "last_matched_at", "match_count" ], "title": "RuleOut", "type": "object" }, "RulePatch": { "additionalProperties": false, "properties": { "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled" }, "kind": { "anyOf": [ { "$ref": "#/components/schemas/RuleKind" }, { "type": "null" } ] }, "match_type": { "anyOf": [ { "$ref": "#/components/schemas/RuleMatchType" }, { "type": "null" } ] }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "pattern": { "anyOf": [ { "maxLength": 512, "minLength": 1, "type": "string" }, { "type": "null" } ], "title": "Pattern" }, "priority": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Priority" }, "value": { "anyOf": [ { "maxLength": 512, "type": "string" }, { "type": "null" } ], "title": "Value" } }, "title": "RulePatch", "type": "object" }, "RunStatus": { "enum": [ "running", "ok", "error" ], "title": "RunStatus", "type": "string" }, "RunwayOut": { "properties": { "as_of": { "format": "date", "title": "As Of", "type": "string" }, "avg_baseline_3m_rub": { "description": "decimal as string", "title": "Avg Baseline 3M Rub", "type": "string" }, "liquid_reserve_rub": { "description": "decimal as string", "title": "Liquid Reserve Rub", "type": "string" }, "runway_months": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Runway Months" } }, "required": [ "as_of", "liquid_reserve_rub", "avg_baseline_3m_rub", "runway_months" ], "title": "RunwayOut", "type": "object" }, "SampleEventOut": { "properties": { "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "dedupe_key": { "title": "Dedupe Key", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "fee": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Fee" }, "instrument_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" }, "instrument_key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Instrument Key" }, "instrument_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Instrument Name" }, "is_duplicate": { "title": "Is Duplicate", "type": "boolean" }, "kind": { "title": "Kind", "type": "string" }, "line_no": { "title": "Line No", "type": "integer" }, "price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Price" }, "quantity": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Quantity" }, "settle_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Settle Date" }, "trade_date": { "format": "date", "title": "Trade Date", "type": "string" }, "trade_no": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Trade No" } }, "required": [ "line_no", "kind", "trade_date", "amount", "currency", "dedupe_key", "is_duplicate" ], "title": "SampleEventOut", "type": "object" }, "ScopeCardOut": { "description": "One tile of the home screen: a scope with what a glance needs, from the metric tables.", "properties": { "as_of": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "As Of" }, "day_change_pct": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Day Change Pct" }, "day_change_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Day Change Rub" }, "income_year_pct": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Income Year Pct" }, "income_year_rub": { "description": "decimal as string", "title": "Income Year Rub", "type": "string" }, "invested_rub": { "description": "decimal as string", "title": "Invested Rub", "type": "string" }, "kind": { "title": "Kind", "type": "string" }, "name": { "title": "Name", "type": "string" }, "pnl_pct": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Pnl Pct" }, "pnl_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Pnl Rub" }, "scope": { "title": "Scope", "type": "string" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" }, "xirr": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Xirr" } }, "required": [ "scope", "name", "kind", "as_of", "total_rub", "invested_rub", "pnl_rub", "pnl_pct", "day_change_rub", "day_change_pct", "xirr", "income_year_rub", "income_year_pct" ], "title": "ScopeCardOut", "type": "object" }, "ScopeOut": { "description": "One reportable set of accounts: `all`, `account:` or `portfolio:`.", "properties": { "account_ids": { "items": { "type": "integer" }, "title": "Account Ids", "type": "array" }, "name": { "title": "Name", "type": "string" }, "scope": { "title": "Scope", "type": "string" } }, "required": [ "scope", "name", "account_ids" ], "title": "ScopeOut", "type": "object" }, "SourceStatus": { "properties": { "cursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor" }, "last_run_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Last Run At" }, "last_run_status": { "anyOf": [ { "$ref": "#/components/schemas/RunStatus" }, { "type": "null" } ] }, "last_success_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Last Success At" }, "queued": { "title": "Queued", "type": "boolean" }, "source": { "title": "Source", "type": "string" } }, "required": [ "source", "cursor", "last_run_at", "last_success_at", "last_run_status", "queued" ], "title": "SourceStatus", "type": "object" }, "SpendingRow": { "properties": { "amount_rub": { "description": "decimal as string", "title": "Amount Rub", "type": "string" }, "category_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Category Id" }, "category_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category Name" }, "month": { "format": "date", "title": "Month", "type": "string" }, "root_category_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Root Category Id" }, "root_category_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Root Category Name" }, "txn_count": { "title": "Txn Count", "type": "integer" } }, "required": [ "month", "category_id", "category_name", "root_category_id", "root_category_name", "amount_rub", "txn_count" ], "title": "SpendingRow", "type": "object" }, "SummaryOut": { "description": "The dashboard's one-screen answer for a scope.", "properties": { "as_of": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "As Of" }, "cash_rub": { "description": "decimal as string", "title": "Cash Rub", "type": "string" }, "computed_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Computed At" }, "holding_count": { "title": "Holding Count", "type": "integer" }, "income_rub": { "description": "decimal as string", "title": "Income Rub", "type": "string" }, "invested_net_rub": { "description": "decimal as string", "title": "Invested Net Rub", "type": "string" }, "market_value_rub": { "description": "decimal as string", "title": "Market Value Rub", "type": "string" }, "pnl_total_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Pnl Total Rub" }, "realized_pnl_rub": { "description": "decimal as string", "title": "Realized Pnl Rub", "type": "string" }, "returns": { "items": { "$ref": "#/components/schemas/ReturnsOut" }, "title": "Returns", "type": "array" }, "scope": { "title": "Scope", "type": "string" }, "stale_count": { "title": "Stale Count", "type": "integer" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" }, "unpriced_count": { "title": "Unpriced Count", "type": "integer" } }, "required": [ "scope", "as_of", "computed_at", "market_value_rub", "cash_rub", "total_rub", "invested_net_rub", "pnl_total_rub", "realized_pnl_rub", "income_rub", "holding_count", "unpriced_count", "stale_count", "returns" ], "title": "SummaryOut", "type": "object" }, "SyncJobOut": { "properties": { "id": { "format": "uuid", "title": "Id", "type": "string" }, "requested_at": { "format": "date-time", "title": "Requested At", "type": "string" }, "source": { "title": "Source", "type": "string" }, "status": { "$ref": "#/components/schemas/JobStatus" } }, "required": [ "id", "source", "status", "requested_at" ], "title": "SyncJobOut", "type": "object" }, "SyncRunOut": { "properties": { "counts": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Counts" }, "cursor_after": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor After" }, "cursor_before": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Cursor Before" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" }, "finished_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Finished At" }, "id": { "format": "uuid", "title": "Id", "type": "string" }, "source": { "title": "Source", "type": "string" }, "started_at": { "format": "date-time", "title": "Started At", "type": "string" }, "status": { "$ref": "#/components/schemas/RunStatus" }, "triggered_by": { "title": "Triggered By", "type": "string" }, "warnings": { "anyOf": [ { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Warnings" } }, "required": [ "id", "source", "status", "triggered_by", "started_at", "finished_at", "cursor_before", "cursor_after", "counts", "warnings", "error" ], "title": "SyncRunOut", "type": "object" }, "TargetIn": { "additionalProperties": false, "properties": { "band": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Band" }, "bucket": { "maxLength": 64, "minLength": 1, "title": "Bucket", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "target_weight": { "description": "decimal as string", "title": "Target Weight", "type": "string" } }, "required": [ "bucket", "target_weight" ], "title": "TargetIn", "type": "object" }, "TargetOut": { "properties": { "band": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Band" }, "bucket": { "title": "Bucket", "type": "string" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "target_weight": { "description": "decimal as string", "title": "Target Weight", "type": "string" } }, "required": [ "bucket", "target_weight", "band", "note" ], "title": "TargetOut", "type": "object" }, "TargetsIn": { "additionalProperties": false, "description": "A complete set for one dimension. Partial updates are not supported: weights only\nmean anything together, and a half-written set could not be checked against 1.", "properties": { "dimension": { "description": "asset_class | sector | country | currency", "title": "Dimension", "type": "string" }, "targets": { "items": { "$ref": "#/components/schemas/TargetIn" }, "title": "Targets", "type": "array" } }, "required": [ "dimension", "targets" ], "title": "TargetsIn", "type": "object" }, "TargetsOut": { "properties": { "dimension": { "title": "Dimension", "type": "string" }, "portfolio_id": { "title": "Portfolio Id", "type": "integer" }, "targets": { "items": { "$ref": "#/components/schemas/TargetOut" }, "title": "Targets", "type": "array" }, "weights_sum": { "description": "decimal as string", "title": "Weights Sum", "type": "string" } }, "required": [ "portfolio_id", "dimension", "targets", "weights_sum" ], "title": "TargetsOut", "type": "object" }, "TaxAccountOut": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "account_name": { "title": "Account Name", "type": "string" }, "coupons_gross_rub": { "description": "decimal as string", "title": "Coupons Gross Rub", "type": "string" }, "dividends_gross_rub": { "description": "decimal as string", "title": "Dividends Gross Rub", "type": "string" }, "estimated_tax_rub": { "description": "decimal as string", "title": "Estimated Tax Rub", "type": "string" }, "ldv_exempt_rub": { "description": "decimal as string", "title": "Ldv Exempt Rub", "type": "string" }, "realized_gain_rub": { "description": "decimal as string", "title": "Realized Gain Rub", "type": "string" }, "realized_loss_rub": { "description": "decimal as string", "title": "Realized Loss Rub", "type": "string" }, "tax_withheld_rub": { "description": "decimal as string", "title": "Tax Withheld Rub", "type": "string" }, "taxable_base_rub": { "description": "decimal as string", "title": "Taxable Base Rub", "type": "string" } }, "required": [ "dividends_gross_rub", "coupons_gross_rub", "tax_withheld_rub", "realized_gain_rub", "realized_loss_rub", "ldv_exempt_rub", "taxable_base_rub", "estimated_tax_rub", "account_id", "account_name" ], "title": "TaxAccountOut", "type": "object" }, "TaxLotOut": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "account_name": { "title": "Account Name", "type": "string" }, "cost_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Cost Rub" }, "days_to_ldv": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Days To Ldv" }, "instrument_id": { "title": "Instrument Id", "type": "integer" }, "ldv_date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Ldv Date" }, "ldv_eligible": { "title": "Ldv Eligible", "type": "boolean" }, "lot_id": { "title": "Lot Id", "type": "integer" }, "market_value_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Market Value Rub" }, "name": { "title": "Name", "type": "string" }, "open_date": { "format": "date", "title": "Open Date", "type": "string" }, "qty_remaining": { "description": "decimal as string", "title": "Qty Remaining", "type": "string" }, "tax_if_sold_now_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Tax If Sold Now Rub" }, "ticker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Ticker" }, "unrealized_gain_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Unrealized Gain Rub" } }, "required": [ "lot_id", "instrument_id", "ticker", "name", "account_id", "account_name", "open_date", "qty_remaining", "cost_rub", "market_value_rub", "unrealized_gain_rub", "ldv_eligible", "ldv_date", "days_to_ldv", "tax_if_sold_now_rub" ], "title": "TaxLotOut", "type": "object" }, "TaxLotsOut": { "properties": { "as_of": { "format": "date", "title": "As Of", "type": "string" }, "disclaimer": { "title": "Disclaimer", "type": "string" }, "estimated": { "default": true, "title": "Estimated", "type": "boolean" }, "lots": { "items": { "$ref": "#/components/schemas/TaxLotOut" }, "title": "Lots", "type": "array" }, "tax_rate": { "description": "decimal as string", "title": "Tax Rate", "type": "string" }, "year": { "title": "Year", "type": "integer" } }, "required": [ "year", "as_of", "tax_rate", "lots", "disclaimer" ], "title": "TaxLotsOut", "type": "object" }, "TaxTotals": { "properties": { "coupons_gross_rub": { "description": "decimal as string", "title": "Coupons Gross Rub", "type": "string" }, "dividends_gross_rub": { "description": "decimal as string", "title": "Dividends Gross Rub", "type": "string" }, "estimated_tax_rub": { "description": "decimal as string", "title": "Estimated Tax Rub", "type": "string" }, "ldv_exempt_rub": { "description": "decimal as string", "title": "Ldv Exempt Rub", "type": "string" }, "realized_gain_rub": { "description": "decimal as string", "title": "Realized Gain Rub", "type": "string" }, "realized_loss_rub": { "description": "decimal as string", "title": "Realized Loss Rub", "type": "string" }, "tax_withheld_rub": { "description": "decimal as string", "title": "Tax Withheld Rub", "type": "string" }, "taxable_base_rub": { "description": "decimal as string", "title": "Taxable Base Rub", "type": "string" } }, "required": [ "dividends_gross_rub", "coupons_gross_rub", "tax_withheld_rub", "realized_gain_rub", "realized_loss_rub", "ldv_exempt_rub", "taxable_base_rub", "estimated_tax_rub" ], "title": "TaxTotals", "type": "object" }, "TaxYearOut": { "properties": { "accounts": { "items": { "$ref": "#/components/schemas/TaxAccountOut" }, "title": "Accounts", "type": "array" }, "disclaimer": { "title": "Disclaimer", "type": "string" }, "estimated": { "default": true, "title": "Estimated", "type": "boolean" }, "tax_rate": { "description": "decimal as string", "title": "Tax Rate", "type": "string" }, "totals": { "$ref": "#/components/schemas/TaxTotals" }, "year": { "title": "Year", "type": "integer" } }, "required": [ "year", "tax_rate", "accounts", "totals", "disclaimer" ], "title": "TaxYearOut", "type": "object" }, "TokenPair": { "properties": { "access_token": { "title": "Access Token", "type": "string" }, "expires_in": { "title": "Expires In", "type": "integer" }, "refresh_token": { "title": "Refresh Token", "type": "string" }, "token_type": { "default": "bearer", "title": "Token Type", "type": "string" } }, "required": [ "access_token", "refresh_token", "expires_in" ], "title": "TokenPair", "type": "object" }, "TradeOut": { "properties": { "action": { "title": "Action", "type": "string" }, "amount_rub": { "description": "decimal as string", "title": "Amount Rub", "type": "string" }, "blocked_by_cash": { "title": "Blocked By Cash", "type": "boolean" }, "instrument_id": { "title": "Instrument Id", "type": "integer" }, "lot": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Lot" }, "name": { "title": "Name", "type": "string" }, "price": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Price" }, "price_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Price Currency" }, "suggested_qty": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Suggested Qty" }, "ticker": { "title": "Ticker", "type": "string" } }, "required": [ "instrument_id", "ticker", "name", "action", "suggested_qty", "lot", "price", "price_currency", "amount_rub", "blocked_by_cash" ], "title": "TradeOut", "type": "object" }, "TransactionOut": { "properties": { "category_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Category Id" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comment" }, "date": { "format": "date", "title": "Date", "type": "string" }, "deleted": { "title": "Deleted", "type": "boolean" }, "flow_type": { "$ref": "#/components/schemas/FlowType" }, "hold": { "title": "Hold", "type": "boolean" }, "id": { "title": "Id", "type": "integer" }, "income": { "description": "decimal as string", "title": "Income", "type": "string" }, "income_account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Income Account Id" }, "income_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Income Currency" }, "income_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Income Rub" }, "is_one_off": { "title": "Is One Off", "type": "boolean" }, "mcc": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mcc" }, "outcome": { "description": "decimal as string", "title": "Outcome", "type": "string" }, "outcome_account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Outcome Account Id" }, "outcome_currency": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Outcome Currency" }, "outcome_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Outcome Rub" }, "payee": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Payee" }, "payee_canonical": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Payee Canonical" }, "source_id": { "title": "Source Id", "type": "string" }, "tags": { "items": { "type": "integer" }, "title": "Tags", "type": "array" }, "trip_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Trip Id" }, "ts": { "format": "date-time", "title": "Ts", "type": "string" } }, "required": [ "id", "source_id", "ts", "date", "income", "income_currency", "income_account_id", "income_rub", "outcome", "outcome_currency", "outcome_account_id", "outcome_rub", "payee", "payee_canonical", "comment", "mcc", "hold", "deleted", "flow_type", "category_id", "is_one_off", "trip_id", "tags" ], "title": "TransactionOut", "type": "object" }, "TransactionPage": { "properties": { "items": { "items": { "$ref": "#/components/schemas/TransactionOut" }, "title": "Items", "type": "array" }, "page": { "title": "Page", "type": "integer" }, "page_size": { "title": "Page Size", "type": "integer" }, "total": { "title": "Total", "type": "integer" } }, "required": [ "items", "total", "page", "page_size" ], "title": "TransactionPage", "type": "object" }, "UnmatchedBrokerOut": { "properties": { "account_id": { "title": "Account Id", "type": "integer" }, "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "currency": { "title": "Currency", "type": "string" }, "date": { "format": "date", "title": "Date", "type": "string" }, "direction": { "title": "Direction", "type": "string" }, "event_id": { "title": "Event Id", "type": "integer" } }, "required": [ "event_id", "account_id", "date", "amount", "currency", "direction" ], "title": "UnmatchedBrokerOut", "type": "object" }, "UnmatchedOut": { "properties": { "broker": { "items": { "$ref": "#/components/schemas/UnmatchedBrokerOut" }, "title": "Broker", "type": "array" }, "zm": { "items": { "$ref": "#/components/schemas/UnmatchedZmOut" }, "title": "Zm", "type": "array" } }, "required": [ "zm", "broker" ], "title": "UnmatchedOut", "type": "object" }, "UnmatchedZmOut": { "properties": { "amount": { "description": "decimal as string", "title": "Amount", "type": "string" }, "broker_account_id": { "title": "Broker Account Id", "type": "integer" }, "cash_txn_id": { "title": "Cash Txn Id", "type": "integer" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comment" }, "currency": { "title": "Currency", "type": "string" }, "date": { "format": "date", "title": "Date", "type": "string" }, "direction": { "title": "Direction", "type": "string" }, "payee": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Payee" }, "route": { "title": "Route", "type": "string" } }, "required": [ "cash_txn_id", "date", "amount", "currency", "direction", "broker_account_id", "route", "payee", "comment" ], "title": "UnmatchedZmOut", "type": "object" }, "UserOut": { "properties": { "email": { "title": "Email", "type": "string" }, "id": { "title": "Id", "type": "integer" } }, "required": [ "id", "email" ], "title": "UserOut", "type": "object" }, "ValueDay": { "properties": { "accrued_interest_rub": { "description": "decimal as string", "title": "Accrued Interest Rub", "type": "string" }, "cash_rub": { "description": "decimal as string", "title": "Cash Rub", "type": "string" }, "d": { "format": "date", "title": "D", "type": "string" }, "external_flow_rub": { "description": "decimal as string", "title": "External Flow Rub", "type": "string" }, "invested_net_rub": { "description": "decimal as string", "title": "Invested Net Rub", "type": "string" }, "market_value_rub": { "description": "decimal as string", "title": "Market Value Rub", "type": "string" }, "missing_fx_count": { "title": "Missing Fx Count", "type": "integer" }, "missing_price_count": { "title": "Missing Price Count", "type": "integer" }, "pnl_total_rub": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Pnl Total Rub" }, "stale_price_count": { "title": "Stale Price Count", "type": "integer" }, "total_rub": { "description": "decimal as string", "title": "Total Rub", "type": "string" } }, "required": [ "d", "market_value_rub", "accrued_interest_rub", "cash_rub", "total_rub", "external_flow_rub", "invested_net_rub", "pnl_total_rub", "stale_price_count", "missing_price_count", "missing_fx_count" ], "title": "ValueDay", "type": "object" } }, "securitySchemes": { "HTTPBearer": { "scheme": "bearer", "type": "http" } } }, "info": { "title": "fin-tracker", "version": "0.1.0" }, "openapi": "3.1.0", "paths": { "/api/v1/accounts": { "get": { "description": "Every account, archived ones included — the client decides what to show.", "operationId": "accounts_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/AccountOut" }, "title": "Response Accounts List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "accounts" ] }, "post": { "description": "Create the broker account a report import will write into.\n\n`source_id` is the agreement number the report prints: it is how the import finds the\naccount on its own the next time.", "operationId": "accounts_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "accounts" ] } }, "/api/v1/accounts/{account_id}": { "patch": { "description": "Update the user-owned fields. Everything else is overwritten by the next sync.", "operationId": "accounts_patch", "parameters": [ { "in": "path", "name": "account_id", "required": true, "schema": { "title": "Account Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountPatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "accounts" ] } }, "/api/v1/analytics/allocation": { "get": { "description": "Buckets of one dimension (or all four), largest first.", "operationId": "analytics_allocation", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "in": "query", "name": "dimension", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/AllocationDimension" }, { "type": "null" } ], "title": "Dimension" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/AllocationBucket" }, "title": "Response Analytics Allocation", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Allocation", "tags": [ "analytics" ] } }, "/api/v1/analytics/benchmarks": { "get": { "description": "The portfolio's TWR beside each benchmark's, on the same grid of days.\n\n`days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either\nmeans the two chains did not cover the same days, and the difference is then an\napproximation of an excess return rather than one.", "operationId": "benchmarks_benchmarks", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "description": "repeatable: 1m 3m 6m ytd 1y 3y all", "in": "query", "name": "period", "required": false, "schema": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "description": "repeatable: 1m 3m 6m ytd 1y 3y all", "title": "Period" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BenchmarkComparison" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Benchmarks", "tags": [ "benchmarks" ] } }, "/api/v1/analytics/cashflow-broker": { "get": { "description": "Money moved across the brokerage boundary, by month: the other half of cash flow\nthat `metric_cash_flow_monthly` (ZenMoney spending) does not cover.", "operationId": "analytics_cashflow_broker", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CashFlowBrokerMonth" }, "title": "Response Analytics Cashflow Broker", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Cashflow Broker", "tags": [ "analytics" ] } }, "/api/v1/analytics/holdings": { "get": { "description": "Open positions, most valuable first; unpriced ones last with null values.", "operationId": "analytics_holdings", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/HoldingOut" }, "title": "Response Analytics Holdings", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Holdings", "tags": [ "analytics" ] } }, "/api/v1/analytics/overview": { "get": { "description": "One card per scope for the home screen, in a single round trip.\n\n`all` first, then the portfolios, then the accounts by value. A scope holding nothing at\nall is left out: a card of zeros is noise, not an answer.", "operationId": "analytics_overview", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ScopeCardOut" }, "title": "Response Analytics Overview", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Overview", "tags": [ "analytics" ] } }, "/api/v1/analytics/returns": { "get": { "description": "XIRR and TWR per period, shortest first.", "operationId": "analytics_returns", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ReturnsOut" }, "title": "Response Analytics Returns", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Returns", "tags": [ "analytics" ] } }, "/api/v1/analytics/scopes": { "get": { "description": "Every set of accounts the metrics were built for.", "operationId": "analytics_scopes", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ScopeOut" }, "title": "Response Analytics Scopes", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Scopes", "tags": [ "analytics" ] } }, "/api/v1/analytics/summary": { "get": { "description": "One screen's worth: the latest day, the totals it adds up to, and the returns.", "operationId": "analytics_summary", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummaryOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Summary", "tags": [ "analytics" ] } }, "/api/v1/analytics/value-series": { "get": { "description": "Daily portfolio value; defaults to the last 365 days.", "operationId": "analytics_value_series", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "in": "query", "name": "from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "From" } }, { "in": "query", "name": "to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ValueDay" }, "title": "Response Analytics Value Series", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Value Series", "tags": [ "analytics" ] } }, "/api/v1/auth/login": { "post": { "operationId": "auth_login", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenPair" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "summary": "Login", "tags": [ "auth" ] } }, "/api/v1/auth/logout": { "post": { "operationId": "auth_logout", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } }, "required": true }, "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "summary": "Logout", "tags": [ "auth" ] } }, "/api/v1/auth/me": { "get": { "operationId": "auth_me", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Me", "tags": [ "auth" ] } }, "/api/v1/auth/refresh": { "post": { "operationId": "auth_refresh", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenPair" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "summary": "Refresh", "tags": [ "auth" ] } }, "/api/v1/benchmarks": { "get": { "description": "Every benchmark, defaults first — the order the comparison block shows them in.", "operationId": "benchmarks_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/BenchmarkOut" }, "title": "Response Benchmarks List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "benchmarks" ] }, "post": { "operationId": "benchmarks_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BenchmarkCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BenchmarkOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "benchmarks" ] } }, "/api/v1/benchmarks/{benchmark_id}": { "delete": { "operationId": "benchmarks_delete", "parameters": [ { "in": "path", "name": "benchmark_id", "required": true, "schema": { "title": "Benchmark Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "benchmarks" ] }, "patch": { "operationId": "benchmarks_patch", "parameters": [ { "in": "path", "name": "benchmark_id", "required": true, "schema": { "title": "Benchmark Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BenchmarkPatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BenchmarkOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "benchmarks" ] } }, "/api/v1/cashflow/monthly": { "get": { "description": "The last `months` months, oldest first.", "operationId": "cashflow_monthly", "parameters": [ { "in": "query", "name": "months", "required": false, "schema": { "default": 12, "maximum": 120, "minimum": 1, "title": "Months", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CashFlowMonth" }, "title": "Response Cashflow Monthly", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Monthly", "tags": [ "cashflow" ] } }, "/api/v1/categories": { "get": { "description": "Flat list of the ZenMoney tag tree; the client nests it by `parent_id`.", "operationId": "categories_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CategoryOut" }, "title": "Response Categories List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "categories" ] } }, "/api/v1/data-quality": { "get": { "description": "Findings of the latest refresh, most serious first.", "operationId": "metrics_data_quality", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/DataQualityRow" }, "title": "Response Metrics Data Quality", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Data Quality", "tags": [ "metrics" ] } }, "/api/v1/events": { "get": { "description": "One page of ledger events, newest first, with RUB amounts at each own date's rate.", "operationId": "events_list", "parameters": [ { "in": "query", "name": "from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "From" } }, { "in": "query", "name": "to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "To" } }, { "in": "query", "name": "account_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" } }, { "in": "query", "name": "instrument_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Instrument Id" } }, { "in": "query", "name": "kind", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventKind" }, { "type": "null" } ], "title": "Kind" } }, { "in": "query", "name": "status", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventStatus" }, { "type": "null" } ], "title": "Status" } }, { "description": "only the events XIRR reads as boundary flows", "in": "query", "name": "external_flow", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "description": "only the events XIRR reads as boundary flows", "title": "External Flow" } }, { "description": "substring of description or ticker", "in": "query", "name": "q", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "substring of description or ticker", "title": "Q" } }, { "in": "query", "name": "page", "required": false, "schema": { "default": 1, "minimum": 1, "title": "Page", "type": "integer" } }, { "in": "query", "name": "page_size", "required": false, "schema": { "default": 50, "maximum": 500, "minimum": 1, "title": "Page Size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventPage" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "events" ] }, "post": { "description": "Enter an event by hand. It is `confirmed` at once: it is the user's own statement, so\nit is never shadowed by the account's primary feed.", "operationId": "events_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualEventCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "events" ] } }, "/api/v1/events/{event_id}": { "delete": { "description": "Delete an event that was entered by hand. Broker events are evidence, not ours to erase:\nthe next sync or import would bring them straight back.", "operationId": "events_delete", "parameters": [ { "in": "path", "name": "event_id", "required": true, "schema": { "title": "Event Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "events" ] } }, "/api/v1/goals": { "get": { "operationId": "goals_list", "parameters": [ { "in": "query", "name": "include_archived", "required": false, "schema": { "default": false, "title": "Include Archived", "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/GoalOut" }, "title": "Response Goals List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "goals" ] }, "post": { "operationId": "goals_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoalCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoalOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "goals" ] } }, "/api/v1/goals/{goal_id}": { "delete": { "operationId": "goals_delete", "parameters": [ { "in": "path", "name": "goal_id", "required": true, "schema": { "title": "Goal Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "goals" ] }, "patch": { "operationId": "goals_patch", "parameters": [ { "in": "path", "name": "goal_id", "required": true, "schema": { "title": "Goal Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoalPatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoalOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "goals" ] } }, "/api/v1/goals/{goal_id}/progress": { "get": { "operationId": "goals_progress", "parameters": [ { "in": "path", "name": "goal_id", "required": true, "schema": { "title": "Goal Id", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoalProgressOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Progress", "tags": [ "goals" ] } }, "/api/v1/health": { "get": { "description": "503 when the database cannot be reached, so a container healthcheck can trust the code.", "operationId": "health_check", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Health" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "summary": "Check", "tags": [ "health" ] } }, "/api/v1/imports": { "get": { "description": "Newest imports first, with the counters each was committed with.", "operationId": "imports_list", "parameters": [ { "description": "uploaded | parsed | committed | failed", "in": "query", "name": "status", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "uploaded | parsed | committed | failed", "title": "Status" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 50, "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer" } }, { "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "minimum": 0, "title": "Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/ImportSummary" }, "title": "Response Imports List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "imports" ] }, "post": { "description": "Upload a report, parse it and show what committing it would do. Writes no event.", "operationId": "imports_create", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_imports_create" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportPreview" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "imports" ] } }, "/api/v1/imports/{import_id}": { "delete": { "description": "Drop an uncommitted import. A committed one stays: `raw_*` is append-only.", "operationId": "imports_delete", "parameters": [ { "in": "path", "name": "import_id", "required": true, "schema": { "title": "Import Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "imports" ] }, "get": { "description": "The preview again — recomputed for an uncommitted import, replayed for a committed one.", "operationId": "imports_get", "parameters": [ { "in": "path", "name": "import_id", "required": true, "schema": { "title": "Import Id", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportPreview" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Get", "tags": [ "imports" ] } }, "/api/v1/imports/{import_id}/commit": { "post": { "description": "Write the file's events into the ledger and rebuild every metric.", "operationId": "imports_commit", "parameters": [ { "in": "path", "name": "import_id", "required": true, "schema": { "title": "Import Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CommitRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportResult" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Commit", "tags": [ "imports" ] } }, "/api/v1/income/calendar": { "get": { "description": "Payments in a window, one row each; defaults to the next 12 months, forecast only.", "operationId": "income_calendar", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "in": "query", "name": "date_from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Date From" } }, { "in": "query", "name": "date_to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Date To" } }, { "in": "query", "name": "include_paid", "required": false, "schema": { "default": false, "title": "Include Paid", "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Calendar", "tags": [ "income" ] } }, "/api/v1/income/forecast": { "get": { "description": "Expected income per month, split by basis, plus the yield it implies.", "operationId": "income_forecast", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "in": "query", "name": "months", "required": false, "schema": { "default": 12, "maximum": 36, "minimum": 1, "title": "Months", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForecastOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Forecast", "tags": [ "income" ] } }, "/api/v1/income/history": { "get": { "description": "Income actually received, grouped by month, kind and currency.\n\n`group` exists for the contract's sake and accepts only `month`: the table is stored\nmonthly, and a finer grouping would have to re-read the ledger, which is what the\ncalendar's `paid` rows already do per payment.", "operationId": "income_history", "parameters": [ { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "description": "month", "in": "query", "name": "group", "required": false, "schema": { "default": "month", "description": "month", "title": "Group", "type": "string" } }, { "in": "query", "name": "date_from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Date From" } }, { "in": "query", "name": "date_to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Date To" } }, { "description": "dividend | coupon | …", "in": "query", "name": "kind", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "dividend | coupon | …", "title": "Kind" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HistoryOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "History", "tags": [ "income" ] } }, "/api/v1/instruments": { "get": { "operationId": "instruments_list", "parameters": [ { "description": "substring of ticker, name or ISIN", "in": "query", "name": "q", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "substring of ticker, name or ISIN", "title": "Q" } }, { "description": "share | bond | etf | fund | currency | index | …", "in": "query", "name": "asset_class", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "share | bond | etf | fund | currency | index | …", "title": "Asset Class" } }, { "description": "only instruments with an open lot", "in": "query", "name": "held_only", "required": false, "schema": { "default": false, "description": "only instruments with an open lot", "title": "Held Only", "type": "boolean" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "maximum": 500, "minimum": 1, "title": "Limit", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/InstrumentOut" }, "title": "Response Instruments List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "instruments" ] } }, "/api/v1/instruments/pending": { "get": { "description": "Instruments a report named that nothing in the master resolves to.", "operationId": "instruments_pending", "parameters": [ { "description": "pending | resolved | ignored | all", "in": "query", "name": "status", "required": false, "schema": { "default": "pending", "description": "pending | resolved | ignored | all", "title": "Status", "type": "string" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "maximum": 500, "minimum": 1, "title": "Limit", "type": "integer" } }, { "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "minimum": 0, "title": "Offset", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/PendingInstrumentOut" }, "title": "Response Instruments Pending", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Pending", "tags": [ "instruments" ] } }, "/api/v1/instruments/pending/{pending_id}/resolve": { "post": { "description": "Link, create or ignore — then bind the events that were waiting and rebuild the lots.", "operationId": "instruments_pending_resolve", "parameters": [ { "in": "path", "name": "pending_id", "required": true, "schema": { "title": "Pending Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PendingResolveRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PendingResolveResult" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Pending Resolve", "tags": [ "instruments" ] } }, "/api/v1/instruments/{instrument_id}": { "get": { "description": "One instrument with its position, open lots, events and price history.", "operationId": "instruments_get", "parameters": [ { "in": "path", "name": "instrument_id", "required": true, "schema": { "title": "Instrument Id", "type": "integer" } }, { "description": "all | account: | portfolio:", "in": "query", "name": "scope", "required": false, "schema": { "default": "all", "description": "all | account: | portfolio:", "title": "Scope", "type": "string" } }, { "in": "query", "name": "prices_from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "Prices From" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InstrumentDetail" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Get", "tags": [ "instruments" ] }, "patch": { "description": "Correct an instrument by hand: name, board, lot, asset class, sector.\n\nThe lot only rounds the quantities the rebalancing suggests; the asset class decides the\nbucket it lands in. Neither is refreshed here — call `POST /metrics/refresh` after, same\nas `/rules/apply`.", "operationId": "instruments_patch", "parameters": [ { "in": "path", "name": "instrument_id", "required": true, "schema": { "title": "Instrument Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InstrumentPatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InstrumentOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "instruments" ] } }, "/api/v1/instruments/{instrument_id}/prices": { "post": { "description": "Set (or replace) the manual price of `instrument_id` on `body.d`.\n\nFor what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody\nlists. One row per (instrument, day) — a second call for the same day replaces it rather\nthan piling up duplicates the price series would then have to pick between. Does not\nitself refresh `metric_*`; call `POST /metrics/refresh` after, same as `/rules/apply`.", "operationId": "instruments_set_manual_price", "parameters": [ { "in": "path", "name": "instrument_id", "required": true, "schema": { "title": "Instrument Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceManualIn" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceManualOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Set Manual Price", "tags": [ "instruments" ] } }, "/api/v1/links": { "post": { "description": "Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards.", "operationId": "links_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "links" ] } }, "/api/v1/links/unmatched": { "get": { "description": "Every candidate that survives matching without a link, on either side.", "operationId": "links_unmatched", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnmatchedOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Unmatched", "tags": [ "links" ] } }, "/api/v1/links/{link_id}": { "delete": { "description": "Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`,\nwhen `classify` rebuilds it from the rules and `matching` no longer overwrites it.", "operationId": "links_delete", "parameters": [ { "in": "path", "name": "link_id", "required": true, "schema": { "title": "Link Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "links" ] } }, "/api/v1/metrics/refresh": { "post": { "description": "Queue a rebuild of every metric_* table; the worker runs it. Poll `/metrics/status`\nuntil `refreshing` is false.\n\nA request while one is already waiting shares it. One that arrives while a rebuild is\nRUNNING queues another, because the running one may have read the data before the change\nthat prompted this call.", "operationId": "metrics_refresh", "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncJobOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Refresh", "tags": [ "metrics" ] } }, "/api/v1/metrics/status": { "get": { "description": "When the metric tables were last rebuilt, whether they are one consistent snapshot,\nand whether another rebuild is on its way.", "operationId": "metrics_status", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricsStatusOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Status", "tags": [ "metrics" ] } }, "/api/v1/networth/breakdown": { "get": { "description": "The latest day's buckets, plus every account's current balance native and in RUB.", "operationId": "networth_breakdown", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NetWorthBreakdown" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Breakdown", "tags": [ "networth" ] } }, "/api/v1/networth/series": { "get": { "description": "Daily net worth; defaults to the last 365 days.", "operationId": "networth_series", "parameters": [ { "in": "query", "name": "from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "From" } }, { "in": "query", "name": "to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/NetWorthDay" }, "title": "Response Networth Series", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Series", "tags": [ "networth" ] } }, "/api/v1/portfolios": { "get": { "operationId": "portfolios_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/PortfolioOut" }, "title": "Response Portfolios List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "portfolios" ] }, "post": { "operationId": "portfolios_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "portfolios" ] } }, "/api/v1/portfolios/{portfolio_id}": { "delete": { "operationId": "portfolios_delete", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "portfolios" ] }, "patch": { "operationId": "portfolios_patch", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioPatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "portfolios" ] } }, "/api/v1/portfolios/{portfolio_id}/accounts": { "put": { "operationId": "portfolios_set_accounts", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioAccountsIn" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Set Accounts", "tags": [ "portfolios" ] } }, "/api/v1/portfolios/{portfolio_id}/rebalance": { "get": { "operationId": "rebalance_rebalance", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } }, { "description": "asset_class | sector | country | currency", "in": "query", "name": "dimension", "required": false, "schema": { "default": "asset_class", "description": "asset_class | sector | country | currency", "title": "Dimension", "type": "string" } }, { "description": "переопределяет остаток на счетах для what-if", "in": "query", "name": "cash_available", "required": false, "schema": { "anyOf": [ { "description": "decimal as string", "type": "string" }, { "type": "null" } ], "title": "Cash Available" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RebalanceOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Rebalance", "tags": [ "rebalance" ] } }, "/api/v1/portfolios/{portfolio_id}/targets": { "get": { "operationId": "rebalance_targets", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } }, { "description": "asset_class | sector | country | currency", "in": "query", "name": "dimension", "required": false, "schema": { "default": "asset_class", "description": "asset_class | sector | country | currency", "title": "Dimension", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TargetsOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Targets", "tags": [ "rebalance" ] }, "put": { "description": "Replace the whole set for one dimension.\n\nThe weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is\nrefused with the actual sum in the message, so the user can see by how much the plan\nmisses rather than being handed a silently rescaled one.", "operationId": "rebalance_set_targets", "parameters": [ { "in": "path", "name": "portfolio_id", "required": true, "schema": { "title": "Portfolio Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TargetsIn" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TargetsOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Set Targets", "tags": [ "rebalance" ] } }, "/api/v1/rules": { "get": { "operationId": "rules_list", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/RuleOut" }, "title": "Response Rules List", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "rules" ] }, "post": { "operationId": "rules_create", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleCreate" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Create", "tags": [ "rules" ] } }, "/api/v1/rules/apply": { "post": { "description": "Re-run the whole metric refresh so edited rules take effect everywhere at once.", "operationId": "rules_apply", "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshLogOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Apply", "tags": [ "rules" ] } }, "/api/v1/rules/stale": { "get": { "description": "Enabled rules that matched nothing in the latest refresh: the payee was renamed,\nor the transaction was re-categorised in ZenMoney.", "operationId": "rules_stale", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/RuleOut" }, "title": "Response Rules Stale", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Stale", "tags": [ "rules" ] } }, "/api/v1/rules/{rule_id}": { "delete": { "operationId": "rules_delete", "parameters": [ { "in": "path", "name": "rule_id", "required": true, "schema": { "title": "Rule Id", "type": "integer" } } ], "responses": { "204": { "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Delete", "tags": [ "rules" ] }, "patch": { "operationId": "rules_patch", "parameters": [ { "in": "path", "name": "rule_id", "required": true, "schema": { "title": "Rule Id", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RulePatch" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RuleOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Patch", "tags": [ "rules" ] } }, "/api/v1/runway": { "get": { "description": "How many months the liquid reserve covers; null before the first refresh.", "operationId": "cashflow_runway", "responses": { "200": { "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/RunwayOut" }, { "type": "null" } ], "title": "Response Cashflow Runway" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Runway", "tags": [ "cashflow" ] } }, "/api/v1/spending/categories": { "get": { "description": "Expenses of one month by category, largest first.", "operationId": "cashflow_spending", "parameters": [ { "description": "YYYY-MM; defaults to the latest month", "in": "query", "name": "month", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "YYYY-MM; defaults to the latest month", "title": "Month" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SpendingRow" }, "title": "Response Cashflow Spending", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Spending", "tags": [ "cashflow" ] } }, "/api/v1/sync/runs": { "get": { "operationId": "sync_runs", "parameters": [ { "in": "query", "name": "source", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Source" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 20, "maximum": 200, "minimum": 1, "title": "Limit", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SyncRunOut" }, "title": "Response Sync Runs", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Runs", "tags": [ "sync" ] } }, "/api/v1/sync/status": { "get": { "operationId": "sync_status", "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SourceStatus" }, "title": "Response Sync Status", "type": "array" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Status", "tags": [ "sync" ] } }, "/api/v1/sync/{source}": { "post": { "operationId": "sync_trigger", "parameters": [ { "in": "path", "name": "source", "required": true, "schema": { "title": "Source", "type": "string" } } ], "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncJobOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Trigger", "tags": [ "sync" ] } }, "/api/v1/tax": { "get": { "description": "The year's estimated tax position, per account and in total.", "operationId": "tax_summary", "parameters": [ { "in": "query", "name": "year", "required": false, "schema": { "anyOf": [ { "maximum": 2200, "minimum": 1990, "type": "integer" }, { "type": "null" } ], "title": "Year" } }, { "in": "query", "name": "account_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxYearOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Summary", "tags": [ "tax" ] } }, "/api/v1/tax/lots": { "get": { "description": "Open lots with the date after which a sale falls under the long-term exemption.\n\n`year` selects the rate the \"what if I sold today\" figure is computed at; the lots\nthemselves are always the ones open right now. `lot` is rebuilt from the ledger on every\nrefresh and holds today's state only, so there is no honest way to answer \"which lots\nwere open on 31 December two years ago\" — and inventing one would be worse than the\nlimitation.", "operationId": "tax_lots", "parameters": [ { "in": "query", "name": "year", "required": false, "schema": { "anyOf": [ { "maximum": 2200, "minimum": 1990, "type": "integer" }, { "type": "null" } ], "title": "Year" } }, { "in": "query", "name": "account_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxLotsOut" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "Lots", "tags": [ "tax" ] } }, "/api/v1/transactions": { "get": { "description": "One page of transactions, newest first, with RUB amounts at each own date's rate.", "operationId": "transactions_list", "parameters": [ { "in": "query", "name": "from", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "From" } }, { "in": "query", "name": "to", "required": false, "schema": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "title": "To" } }, { "in": "query", "name": "account_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Account Id" } }, { "in": "query", "name": "category_id", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Category Id" } }, { "in": "query", "name": "flow_type", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/FlowType" }, { "type": "null" } ], "title": "Flow Type" } }, { "description": "substring of payee or comment", "in": "query", "name": "q", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "substring of payee or comment", "title": "Q" } }, { "in": "query", "name": "include_deleted", "required": false, "schema": { "default": false, "title": "Include Deleted", "type": "boolean" } }, { "in": "query", "name": "page", "required": false, "schema": { "default": 1, "minimum": 1, "title": "Page", "type": "integer" } }, { "in": "query", "name": "page_size", "required": false, "schema": { "default": 50, "maximum": 500, "minimum": 1, "title": "Page Size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransactionPage" } } }, "description": "Successful Response" }, "default": { "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }, "description": "Error" } }, "security": [ { "HTTPBearer": [] } ], "summary": "List", "tags": [ "transactions" ] } } }, "servers": [ { "url": "/" } ] }