{
  "openapi": "3.0.0",
  "paths": {
    "/health": {
      "get": {
        "operationId": "Health_check",
        "summary": "Liveness + database check (no /v1 prefix)",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "status": "ok",
                    "db": "up",
                    "service": "silkroute-api",
                    "ts": "2026-10-03T10:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Health"
        ]
      }
    },
    "/v1/accounts/balance/get": {
      "post": {
        "operationId": "Accounts_balanceGet",
        "summary": "Real-time balances for every account on the item",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalanceGetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts": [
                      {
                        "account_id": "acc_01J…",
                        "name": "UZCARD Salary",
                        "mask": "4415",
                        "type": "depository",
                        "subtype": "checking",
                        "balances": {
                          "current": 4120000,
                          "available": 4070000,
                          "limit": null,
                          "iso_currency_code": "UZS",
                          "last_updated_datetime": "2026-10-03T10:00:00Z"
                        }
                      }
                    ],
                    "item": {
                      "item_id": "item_01J…"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/balancing/executions/list": {
      "post": {
        "operationId": "Balancing_executions",
        "summary": "Decisions and transfers of your users",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingB2BListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "executions": [
                      {
                        "execution_id": "abx_01J…",
                        "rule_id": "abr_01J…",
                        "status": "executed",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "partial": false,
                        "decided_by": "user",
                        "attempts": 1,
                        "max_attempts": 3,
                        "payment_id": "pay_01J…",
                        "attempt_log": [
                          {
                            "attempt_no": 1,
                            "status": "settled",
                            "error": null,
                            "payment_id": "pay_01J…"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/balancing/rules/list": {
      "post": {
        "operationId": "Balancing_rules",
        "summary": "Rules of your users",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingB2BListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rules": [
                      {
                        "rule_id": "abr_01J…",
                        "name": "Keep my card topped up",
                        "status": "active",
                        "mode": "notify",
                        "user_ref": "enduser_demo_001",
                        "target_account": {
                          "account_id": "acc_01J…",
                          "label": "Bulut · Current account ••4415"
                        },
                        "source_account": {
                          "account_id": "acc_01J…",
                          "label": "Tumaris · Savings ••9012"
                        },
                        "currency": "UZS",
                        "horizon_days": 7,
                        "deadline_date": null,
                        "target_min_balance": 0,
                        "max_transfer_amount": 2000000,
                        "source_min_balance": 5000000,
                        "last_evaluation": {
                          "action": "transfer",
                          "amount": 900000,
                          "shortfall": 899877,
                          "shortfall_date": "2026-10-17",
                          "projected_min_balance": -899877
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/balancing/rules/pause": {
      "post": {
        "operationId": "Balancing_pause",
        "summary": "Pause a user’s rule (support action, audited)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingB2BRuleIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "paused",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/credit_passport/consent/get": {
      "post": {
        "operationId": "CreditPassport_consent",
        "summary": "Consent status",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportConsentIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent": {
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "status": "granted",
                      "requester_name": "Acme Microfinance",
                      "purpose": "Consumer loan application #4821",
                      "period_months": 6,
                      "access_ttl_days": 30,
                      "granted_at": "2026-10-03T10:05:00Z",
                      "access_expires_at": "2026-11-02T10:05:00Z",
                      "fetch_count": 1
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Credit Passport"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/credit_passport/consent/list": {
      "post": {
        "operationId": "CreditPassport_list",
        "summary": "List consents (with the latest score when one was generated)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportConsentListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consents": [
                      {
                        "consent_id": "pcon_01J…",
                        "user_ref": "enduser_demo_001",
                        "status": "granted",
                        "requester_name": "Acme Microfinance",
                        "purpose": "Consumer loan application #4821",
                        "period_months": 6,
                        "access_ttl_days": 30,
                        "granted_at": "2026-10-03T10:05:00Z",
                        "access_expires_at": "2026-11-02T10:05:00Z",
                        "fetch_count": 1,
                        "latest_score": 712,
                        "latest_grade": "B"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Credit Passport"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/credit_passport/consent/request": {
      "post": {
        "operationId": "CreditPassport_request",
        "summary": "Ask the user for consent to compute their Credit Passport",
        "description": "The consent_token is returned ONCE. It works only after the user grants access (consent centre or Telegram) and until access expires or is revoked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportConsentRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent_id": "pcon_01J…",
                    "consent_token": "consent-sandbox-…",
                    "status": "pending",
                    "requester_name": "Acme Microfinance",
                    "period_months": 6,
                    "access_ttl_days": 30,
                    "request_expires_at": "2026-10-10T10:00:00Z"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Credit Passport"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/credit_passport/consent/revoke": {
      "post": {
        "operationId": "CreditPassport_revoke",
        "summary": "End your own access early",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportConsentIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent": {
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "status": "revoked",
                      "requester_name": "Acme Microfinance",
                      "purpose": "Consumer loan application #4821",
                      "period_months": 6,
                      "access_ttl_days": 30,
                      "granted_at": "2026-10-03T10:05:00Z",
                      "access_expires_at": "2026-11-02T10:05:00Z",
                      "fetch_count": 1,
                      "revoked_by": "client"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Credit Passport"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/credit_passport/get": {
      "post": {
        "operationId": "CreditPassport_get",
        "summary": "Fetch the Credit Passport (score + explained factors)",
        "description": "403 CONSENT_PENDING / CONSENT_DENIED / CONSENT_REVOKED / CONSENT_EXPIRED when access is not active. Every fetch is logged and shown to the user.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportGetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "passport": {
                      "passport_id": "cp_01J…",
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "model_version": "cf-v1",
                      "score": 712,
                      "grade": "B",
                      "confidence": "high",
                      "flags": [],
                      "factors": [
                        {
                          "key": "income_stability",
                          "weight": 0.3,
                          "sub_score": 88,
                          "points": 145,
                          "max_points": 165,
                          "impact": "positive",
                          "value": {
                            "avg_monthly_income": 9500000,
                            "coefficient_of_variation": 0.07,
                            "months_with_income": 6,
                            "months_observed": 6
                          },
                          "explanation": "Average monthly income 9,500,000 UZS over 6 month(s); month-to-month variation 7%; income in 6/6 months.",
                          "explanation_key": "income_stability.positive"
                        }
                      ],
                      "metrics": {
                        "months_observed": 6,
                        "avg_monthly_income": 9500000,
                        "avg_monthly_outflow": 6100000,
                        "debt_to_income": 0,
                        "income_sources": 1
                      },
                      "period": {
                        "start": "2026-04-01",
                        "end": "2026-09-30"
                      },
                      "accounts_analyzed": 2,
                      "score_range": {
                        "min": 300,
                        "max": 850
                      },
                      "data_source": "synthetic_sandbox"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Credit Passport"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/identity/get": {
      "post": {
        "operationId": "Identity_get",
        "summary": "Account-holder identity (names, email, masked phone, city)",
        "description": "Sandbox identities are synthetic and stable per item.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityGetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts": [
                      {
                        "account_id": "acc_01J…",
                        "name": "Tumaris Salary Card",
                        "mask": "4415",
                        "owners": [
                          {
                            "names": [
                              "Dilnoza Karimova"
                            ],
                            "emails": [
                              {
                                "data": "dilnoza.karimov42@example.com",
                                "primary": true,
                                "type": "primary"
                              }
                            ],
                            "phone_numbers": [
                              {
                                "data": "+998 ** *** ** 42",
                                "primary": true,
                                "type": "mobile"
                              }
                            ],
                            "addresses": [
                              {
                                "data": {
                                  "city": "Samarkand",
                                  "region": "Samarkand Region",
                                  "country": "UZ"
                                },
                                "primary": true
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "item": {
                      "item_id": "item_01J…"
                    },
                    "data_source": "synthetic_sandbox"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Identity"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/item/get": {
      "post": {
        "operationId": "Items_get",
        "summary": "Item metadata: status, institution, consent expiry",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessTokenDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "item": {
                      "item_id": "item_01J…",
                      "institution_id": "ins_tumaris",
                      "institution_name": "Tumaris Sandbox Bank",
                      "status": "good",
                      "consent_expires_at": "2026-12-31T00:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Items"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/item/public_token/exchange": {
      "post": {
        "operationId": "Items_exchange",
        "summary": "Exchange a public_token for a permanent access_token",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExchangeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "access_token": "access-sandbox-…",
                    "item_id": "item_01J…"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Items"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/item/remove": {
      "post": {
        "operationId": "Items_remove",
        "summary": "Disconnect a bank (Item) and end everything that depends on it",
        "description": "The access_token stops working immediately. VRP mandates debiting the item are revoked, balancing rules using its accounts are deleted and its accounts leave the treasury — in one transaction.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessTokenDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "item_id": "item_01J…",
                    "removed": true,
                    "ended": {
                      "vrp_mandates_revoked": 1,
                      "balancing_rules_deleted": 0,
                      "treasury_accounts_removed": 0
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Items"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/link/branding": {
      "post": {
        "operationId": "LinkSession_branding",
        "summary": "White-label branding for this Link session (link_token-authenticated)",
        "description": "The consent screen shows the client’s name, logo and colours; \"Secured by Silkroute\" always stays visible.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkBrandingGetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "branding": {
                      "display_name": "NovaPay",
                      "logo_url": "https://cdn.novapay.uz/logo.svg",
                      "primary_color": "#7C3AED",
                      "on_primary_color": "#FFFFFF",
                      "accent_color": "#0B0F19",
                      "support_url": null,
                      "privacy_url": "https://novapay.uz/privacy",
                      "consent_headline": null,
                      "secured_by": "Silkroute",
                      "source": "organization"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Link widget session"
        ]
      }
    },
    "/v1/link/institutions": {
      "get": {
        "operationId": "LinkSession_institutions",
        "summary": "Banks shown in the Link widget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "institutions": [
                      {
                        "institution_id": "ins_tumaris",
                        "name": "Tumaris Sandbox Bank",
                        "short_name": "Tumaris",
                        "primary_color": "#0E7490",
                        "supports_payments": true,
                        "health": "healthy"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Link widget session"
        ]
      }
    },
    "/v1/link/login": {
      "post": {
        "operationId": "LinkSession_login",
        "summary": "Bank credential login (link_token-authenticated) → OTP challenge",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionLoginDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "requires_otp": true,
                    "login_session_id": "mocksess_01J…",
                    "otp_delivery": "SMS to +998 ** *** ** 42"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Link widget session"
        ]
      }
    },
    "/v1/link/otp": {
      "post": {
        "operationId": "LinkSession_otp",
        "summary": "Verify the OTP → public_token",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionOtpDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "public_token": "public-sandbox-…",
                    "metadata": {
                      "institution": {
                        "id": "ins_tumaris",
                        "name": "Tumaris Sandbox Bank"
                      },
                      "accounts": 3,
                      "item_id": "item_01J…"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Link widget session"
        ]
      }
    },
    "/v1/link/token/create": {
      "post": {
        "operationId": "Link_create",
        "summary": "Create a link_token for the Link widget",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLinkTokenDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "link_token": "link-sandbox-3f9a…",
                    "expiration": "2026-10-03T10:30:00.000Z"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Link"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/payment/initiate": {
      "post": {
        "operationId": "Payments_initiate",
        "summary": "Initiate an A2A bank-to-bank payment",
        "description": "Settles asynchronously → PAYMENT_STATUS_UPDATED webhook. idempotency_key makes retries safe. `fee` is the simulated platform fee fixed at creation: at most 0.5% (50 bps), 0.3% (30 bps) once the month’s UZS volume reaches the volume threshold, capped per payment; UZS payments only (null otherwise). Sandbox only: nothing is charged.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiatePaymentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "payment_id": "pay_01J…",
                    "status": "executing",
                    "bank_payment_id": "bankpay_01J…",
                    "amount": 150000,
                    "currency": "UZS",
                    "fee": {
                      "amount": 750,
                      "currency": "UZS",
                      "bps": 50,
                      "tier": "standard",
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/payment/status": {
      "post": {
        "operationId": "Payments_status",
        "summary": "Payment status + lifecycle timestamps",
        "description": "`fee` is null for rejected or failed payments and for non-UZS payments.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentStatusDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "payment": {
                      "payment_id": "pay_01J…",
                      "status": "settled",
                      "amount": 150000,
                      "currency": "UZS",
                      "creditor_name": "OOO Beneficiary",
                      "settled_at": "2026-10-03T10:00:04Z",
                      "fee": {
                        "amount": 750,
                        "currency": "UZS",
                        "bps": 50,
                        "tier": "standard",
                        "simulated": true
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/sandbox/item/create": {
      "post": {
        "operationId": "Sandbox_createItem",
        "summary": "Create a linked item with synthetic data (sandbox only)",
        "description": "Skips the Link widget: returns an access_token directly. Personas: salaried, self_employed, over_indebted, business, empty.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxItemCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "access_token": "access-sandbox-…",
                    "item_id": "item_01J…",
                    "institution": {
                      "institution_id": "ins_tumaris",
                      "name": "Tumaris Sandbox Bank"
                    },
                    "accounts": [
                      {
                        "account_id": "acc_01J…",
                        "name": "UZCARD Salary",
                        "mask": "4415",
                        "subtype": "checking",
                        "balances": {
                          "current": 4120000,
                          "available": 4120000,
                          "iso_currency_code": "UZS"
                        }
                      }
                    ],
                    "sandbox": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Sandbox"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/sandbox/upcoming_debit/create": {
      "post": {
        "operationId": "Sandbox_upcomingDebit",
        "summary": "Schedule a future debit on an account (sandbox only)",
        "description": "Simulates a standing order / bill so Auto-Balancing can forecast a shortfall.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxUpcomingDebitDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "upcoming_debit": {
                      "upcoming_debit_id": "udeb_01J…",
                      "account_id": "acc_01J…",
                      "amount": 1200000,
                      "currency": "UZS",
                      "due_date": "2026-10-17",
                      "description": "Rent",
                      "status": "scheduled"
                    },
                    "sandbox": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Sandbox"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/bridges/connect": {
      "post": {
        "operationId": "Silkroute_bridgesConnect",
        "summary": "Connect a sandbox connector",
        "description": "No third-party credential is involved. 423 LOCKDOWN_ACTIVE while locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BridgeRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "connector": {
                      "connector_id": "sandbox_ledger",
                      "name": "Sandbox Ledger",
                      "category": "accounting",
                      "capabilities": [
                        "entities",
                        "journal"
                      ],
                      "jurisdictions": [
                        "US",
                        "UZ",
                        "AE",
                        "SA"
                      ],
                      "status": "connected",
                      "connected_at": "2026-10-16T09:00:00.000Z",
                      "last_sync_at": "2026-10-16T09:05:00.000Z",
                      "last_result": {
                        "records": 28,
                        "summary": {
                          "entities": 4,
                          "journal_lines": 24
                        }
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/bridges/disconnect": {
      "post": {
        "operationId": "Silkroute_bridgesDisconnect",
        "summary": "Disconnect a sandbox connector",
        "description": "Allowed during a lockdown (it only restricts).",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BridgeRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "connector": {
                      "connector_id": "sandbox_ledger",
                      "name": "Sandbox Ledger",
                      "category": "accounting",
                      "capabilities": [
                        "entities",
                        "journal"
                      ],
                      "jurisdictions": [
                        "US",
                        "UZ",
                        "AE",
                        "SA"
                      ],
                      "status": "disconnected",
                      "connected_at": "2026-10-16T09:00:00.000Z",
                      "last_sync_at": "2026-10-16T09:05:00.000Z",
                      "last_result": {
                        "records": 28,
                        "summary": {
                          "entities": 4,
                          "journal_lines": 24
                        }
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/bridges/list": {
      "post": {
        "operationId": "Silkroute_bridgesList",
        "summary": "Sandbox connectors and their state, plus the planned integrations",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "connectors": [
                      {
                        "connector_id": "sandbox_ledger",
                        "name": "Sandbox Ledger",
                        "category": "accounting",
                        "capabilities": [
                          "entities",
                          "journal"
                        ],
                        "jurisdictions": [
                          "US",
                          "UZ",
                          "AE",
                          "SA"
                        ],
                        "status": "connected",
                        "connected_at": "2026-10-16T09:00:00.000Z",
                        "last_sync_at": "2026-10-16T09:05:00.000Z",
                        "last_result": {
                          "records": 28,
                          "summary": {
                            "entities": 4,
                            "journal_lines": 24
                          }
                        },
                        "simulated": true
                      }
                    ],
                    "planned": {
                      "names": [
                        "QuickBooks",
                        "Xero"
                      ],
                      "note": "Planned, not built. Named for orientation only; no affiliation with or endorsement by these companies."
                    },
                    "simulated": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/bridges/sync": {
      "post": {
        "operationId": "Silkroute_bridgesSync",
        "summary": "Run a simulated sync",
        "description": "Reads the workspace's own synthetic figures and reports what a real connector would exchange; calls no third party. 409 NOT_CONNECTED before connecting; 423 LOCKDOWN_ACTIVE while locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BridgeRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "connector": {
                      "connector_id": "sandbox_ledger",
                      "name": "Sandbox Ledger",
                      "category": "accounting",
                      "capabilities": [
                        "entities",
                        "journal"
                      ],
                      "jurisdictions": [
                        "US",
                        "UZ",
                        "AE",
                        "SA"
                      ],
                      "status": "connected",
                      "connected_at": "2026-10-16T09:00:00.000Z",
                      "last_sync_at": "2026-10-16T09:05:00.000Z",
                      "last_result": {
                        "records": 28,
                        "summary": {
                          "entities": 4,
                          "journal_lines": 24
                        }
                      },
                      "simulated": true
                    },
                    "result": {
                      "records": 28,
                      "summary": {
                        "entities": 4,
                        "journal_lines": 24
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/charge": {
      "post": {
        "operationId": "Silkroute_charge",
        "summary": "Simulate a charge (authorization) on a card",
        "description": "Checked in order: card status, currency, merchant, per charge, per day, per month. A charge that breaks the policy is declined and locks the card (the owner is notified). Converted into the card currency at the static table, rounded up. Card charges do not move entity cash in the sandbox. 423 LOCKDOWN_ACTIVE while the workspace is locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardChargeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "charge": {
                      "charge_id": "chg_01J…",
                      "card_id": "card_01J…",
                      "merchant": {
                        "merchant_id": "MCH_LLM_API",
                        "name": "Sandbox LLM API",
                        "category": "ai"
                      },
                      "amount": 150,
                      "currency": "USD",
                      "card_amount": 150,
                      "card_currency": "USD",
                      "status": "declined",
                      "decline_code": "DAILY_CAP_EXCEEDED",
                      "simulated": true
                    },
                    "replay": false,
                    "locked_now": true,
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "locked",
                      "lock_reason": "DAILY_CAP_EXCEEDED",
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/create": {
      "post": {
        "operationId": "Silkroute_createCard",
        "summary": "Issue a simulated card with its policy",
        "description": "For a person, an agent or a piece of software, issued by one entity. Caps are in the card currency (major units); a monthly cap is required. No card number or CVV is generated. 423 LOCKDOWN_ACTIVE while the workspace is locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "active",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/freeze": {
      "post": {
        "operationId": "Silkroute_freezeCard",
        "summary": "Freeze a card by hand",
        "description": "Allowed during a lockdown; a card frozen by hand stays frozen when the lockdown is released.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "frozen",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    },
                    "changed": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/get": {
      "post": {
        "operationId": "Silkroute_getCard",
        "summary": "One card with its recent charges and receipts",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "active",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    },
                    "charges": [
                      {
                        "charge_id": "chg_01J…",
                        "card_id": "card_01J…",
                        "merchant": {
                          "merchant_id": "MCH_LLM_API",
                          "name": "Sandbox LLM API",
                          "category": "ai"
                        },
                        "amount": 150,
                        "currency": "USD",
                        "card_amount": 150,
                        "card_currency": "USD",
                        "status": "declined",
                        "decline_code": "DAILY_CAP_EXCEEDED",
                        "simulated": true
                      }
                    ],
                    "receipts": [
                      {
                        "receipt_id": "rcpt_01J…",
                        "card_id": "card_01J…",
                        "merchant": {
                          "merchant_id": "MCH_LLM_API",
                          "name": "Sandbox LLM API"
                        },
                        "amount": 120,
                        "currency": "USD",
                        "date": "2026-10-15",
                        "status": "matched",
                        "confidence": 1,
                        "charge_id": "chg_01J…",
                        "locked_card": false,
                        "simulated": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/list": {
      "post": {
        "operationId": "Silkroute_listCards",
        "summary": "Cards with approved spend today and this month (Asia/Tashkent windows)",
        "description": "Also returns the fictional sandbox merchant catalog.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "cards": [
                      {
                        "card_id": "card_01J…",
                        "label": "LLM API",
                        "holder": {
                          "kind": "agent",
                          "name": "Research agent"
                        },
                        "entity": {
                          "entity_id": "ent_01J…",
                          "name": "Acme Holdings Inc."
                        },
                        "last4": "0240",
                        "currency": "USD",
                        "status": "active",
                        "lock_reason": null,
                        "frozen_by_lockdown": false,
                        "policy": {
                          "allowed_currencies": [
                            "USD"
                          ],
                          "per_txn_cap": 200,
                          "daily_cap": 500,
                          "monthly_cap": 2000,
                          "merchant_allowlist": [
                            "MCH_LLM_API",
                            "MCH_CLOUD_COMPUTE"
                          ]
                        },
                        "spent": {
                          "today": 120,
                          "this_month": 395.4
                        },
                        "simulated": true
                      }
                    ],
                    "merchants": [
                      {
                        "merchant_id": "MCH_LLM_API",
                        "name": "Sandbox LLM API",
                        "category": "ai"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/policy/update": {
      "post": {
        "operationId": "Silkroute_updatePolicy",
        "summary": "Change the policy of a card (partial update)",
        "description": "Fields left out keep their value; per_txn_cap / daily_cap = null removes that cap. Audited. 423 LOCKDOWN_ACTIVE while locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPolicyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "active",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/cards/unfreeze": {
      "post": {
        "operationId": "Silkroute_unfreezeCard",
        "summary": "Unfreeze a frozen card or unlock a locked one",
        "description": "423 LOCKDOWN_ACTIVE while the workspace is locked. Audited.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "active",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    },
                    "changed": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/command/execute": {
      "post": {
        "operationId": "Silkroute_executeCommand",
        "summary": "Run the intent the person confirmed",
        "description": "Send the intent exactly as command/parse returned it; each type is checked again. Idempotent per idempotency_key (a retry returns the first result), rate limited per workspace, audited. 423 LOCKDOWN_ACTIVE while the workspace is locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandExecuteDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "command": {
                      "command_id": "cmd_01J…",
                      "type": "transfer.create",
                      "status": "done"
                    },
                    "replay": false,
                    "result": {}
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/command/parse": {
      "post": {
        "operationId": "Silkroute_parseCommand",
        "summary": "Turn a typed command (EN / RU / UZ) into one intent and its exact effect",
        "description": "Deterministic grammar, no model: the text only selects among card.issue, card.freeze, card.unfreeze, card.limit, transfer.create, report.export, runway.show and spend.show, or returns a clarifying question (kind: clarify) with options. Nothing runs here. The kill-switch is never driven by text.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandParseDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "result": {
                      "kind": "intent",
                      "intent": {
                        "type": "transfer.create",
                        "from_entity_id": "ent_01J…",
                        "to_entity_id": "ent_01J…",
                        "amount": 5000,
                        "currency": "USD"
                      },
                      "money_affecting": true,
                      "effect": {
                        "from": {
                          "entity_id": "ent_01J…",
                          "name": "Acme Holdings Inc.",
                          "currency": "USD"
                        },
                        "to": {
                          "entity_id": "ent_01J…",
                          "name": "Acme FZ-LLC",
                          "currency": "AED"
                        },
                        "amount": 5000,
                        "currency": "USD",
                        "credited": 18362.5,
                        "credited_currency": "AED",
                        "fx_as_of": "2026-10-01"
                      }
                    },
                    "lockdown": {
                      "active": false
                    },
                    "simulated": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/compliance/checklist": {
      "post": {
        "operationId": "Silkroute_complianceChecklist",
        "summary": "Per-jurisdiction checklist for the workspace entities",
        "description": "Item codes, each a prompt to verify with local counsel; clients word them in the reader's language.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "checklist": [
                      {
                        "jurisdiction": "UZ",
                        "entity": {
                          "entity_id": "ent_01J…",
                          "name": "Acme Tech LLC",
                          "region": "Tashkent"
                        },
                        "items": [
                          "uz_written_contract",
                          "uz_acceptance_acts"
                        ]
                      }
                    ],
                    "disclaimer": "Illustrative template. Not legal advice. Not reviewed or recognized by any regulator.",
                    "verify_with_local_counsel": true,
                    "simulated": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/compliance/document": {
      "post": {
        "operationId": "Silkroute_complianceDocument",
        "summary": "Build an illustrative document: SAFE-style note, software development agreement or consulting invoice",
        "description": "Parties and default amounts come from the workspace (holding entity, intercompany flows). Documents are in English and returned as plain text sections. Every one says: \"Illustrative template. Not legal advice. Not reviewed or recognized by any regulator.\" Nothing is stored or filed.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplianceDocDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "document": {
                      "kind": "sda",
                      "title": "Software development agreement (illustrative, intercompany)",
                      "date": "2026-10-16",
                      "language": "en",
                      "parties": [
                        {
                          "role": "Client",
                          "name": "Acme Holdings Inc.",
                          "jurisdiction": "US",
                          "region": "Delaware"
                        },
                        {
                          "role": "Developer",
                          "name": "Acme Tech LLC",
                          "jurisdiction": "UZ",
                          "region": "Tashkent"
                        }
                      ],
                      "sections": [
                        {
                          "heading": "2. Fees",
                          "paragraphs": [
                            "The Client pays USD 38,000.00 a month, set as the Developer's costs plus a 8% markup and reviewed every twelve months."
                          ]
                        }
                      ],
                      "disclaimer": "Illustrative template. Not legal advice. Not reviewed or recognized by any regulator.",
                      "watermark": "Synthetic data"
                    },
                    "simulated": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/lockdown/activate": {
      "post": {
        "operationId": "Silkroute_activate",
        "summary": "Kill-switch: lock the workspace (confirm: \"LOCK\")",
        "description": "Freezes every simulated card and refuses payments from the owner’s accounts, card charges and command executions with 423 LOCKDOWN_ACTIVE. Audited; sends ORG_LOCKDOWN_UPDATED. Idempotent while locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LockdownActivateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "lockdown": {
                      "active": true,
                      "since": "2026-10-15T10:00:00.000Z",
                      "reason": "lost laptop",
                      "cooldown_seconds": 60,
                      "release_available_at": "2026-10-15T10:01:00.000Z"
                    },
                    "changed": true,
                    "effects": {
                      "cards_frozen": 3
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/lockdown/reauth": {
      "post": {
        "operationId": "Silkroute_reauth",
        "summary": "Start the mock re-auth needed to release a lockdown",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "challenge_id": "lch_01J…",
                    "expires_at": "2026-10-15T10:05:00.000Z",
                    "max_attempts": 5,
                    "lockdown": {
                      "active": true,
                      "since": "2026-10-15T10:00:00.000Z",
                      "reason": "lost laptop",
                      "cooldown_seconds": 60,
                      "release_available_at": "2026-10-15T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/lockdown/release": {
      "post": {
        "operationId": "Silkroute_release",
        "summary": "Release the lockdown (after the cooldown, with the sandbox one-time code)",
        "description": "409 COOLDOWN_ACTIVE before the cooldown ends; 401 REAUTH_FAILED on a wrong code (5 attempts per challenge).",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LockdownReleaseDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "lockdown": {
                      "active": false,
                      "since": null,
                      "reason": null,
                      "cooldown_seconds": 60,
                      "release_available_at": null
                    },
                    "effects": {
                      "cards_frozen": 3
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/lockdown/status": {
      "post": {
        "operationId": "Silkroute_status",
        "summary": "Kill-switch state",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "lockdown": {
                      "active": true,
                      "since": "2026-10-15T10:00:00.000Z",
                      "reason": "lost laptop",
                      "cooldown_seconds": 60,
                      "release_available_at": "2026-10-15T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/receipts/list": {
      "post": {
        "operationId": "Silkroute_listReceipts",
        "summary": "Receipts of the workspace or of one card",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "receipts": [
                      {
                        "receipt_id": "rcpt_01J…",
                        "card_id": "card_01J…",
                        "merchant": {
                          "merchant_id": "MCH_LLM_API",
                          "name": "Sandbox LLM API"
                        },
                        "amount": 120,
                        "currency": "USD",
                        "date": "2026-10-15",
                        "status": "matched",
                        "confidence": 1,
                        "charge_id": "chg_01J…",
                        "locked_card": false,
                        "simulated": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/receipts/submit": {
      "post": {
        "operationId": "Silkroute_submitReceipt",
        "summary": "Submit a receipt for a card; it is matched to an approved charge",
        "description": "Scored on amount (50%), merchant (30%) and date (20%, within 3 days): matched from 0.8, review from 0.5. An unmatched receipt of USD 500 or more (converted) locks the card. 423 LOCKDOWN_ACTIVE while the workspace is locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptSubmitDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "receipt": {
                      "receipt_id": "rcpt_01J…",
                      "card_id": "card_01J…",
                      "merchant": {
                        "merchant_id": "MCH_LLM_API",
                        "name": "Sandbox LLM API"
                      },
                      "amount": 120,
                      "currency": "USD",
                      "date": "2026-10-15",
                      "status": "matched",
                      "confidence": 1,
                      "charge_id": "chg_01J…",
                      "locked_card": false,
                      "simulated": true
                    },
                    "replay": false,
                    "card": {
                      "card_id": "card_01J…",
                      "label": "LLM API",
                      "holder": {
                        "kind": "agent",
                        "name": "Research agent"
                      },
                      "entity": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "last4": "0240",
                      "currency": "USD",
                      "status": "active",
                      "lock_reason": null,
                      "frozen_by_lockdown": false,
                      "policy": {
                        "allowed_currencies": [
                          "USD"
                        ],
                        "per_txn_cap": 200,
                        "daily_cap": 500,
                        "monthly_cap": 2000,
                        "merchant_allowlist": [
                          "MCH_LLM_API",
                          "MCH_CLOUD_COMPUTE"
                        ]
                      },
                      "spent": {
                        "today": 120,
                        "this_month": 395.4
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/report/export": {
      "post": {
        "operationId": "Silkroute_exportReport",
        "summary": "Investor update from the workspace figures, watermarked \"Synthetic data\"",
        "description": "Cash per entity and for the group, net burn, runway, expected funding, spend of the last 30 days, cards and security events. Every report carries the watermark and a disclaimer.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "report": {
                      "kind": "investor_update",
                      "title": "Acme Group (sandbox)",
                      "watermark": "Synthetic data",
                      "simulated": true,
                      "currency": "USD",
                      "cash": {
                        "total": 1594561.13
                      },
                      "burn": {
                        "net_monthly": 107637
                      },
                      "runway": {
                        "months": 21,
                        "beyond_horizon": false
                      },
                      "cards": {
                        "open": 4,
                        "active": 4,
                        "frozen": 0,
                        "locked": 0
                      },
                      "security": {
                        "lockdown_active": false,
                        "lockdowns_30d": 0,
                        "cards_auto_locked_30d": 0
                      },
                      "fx": {
                        "as_of": "2026-10-01",
                        "source": "synthetic"
                      },
                      "disclaimer": "Synthetic data from a sandbox. Not financial statements, not audited, not investment advice."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/runway/compute": {
      "post": {
        "operationId": "Silkroute_runwayCompute",
        "summary": "Runway per entity and for the group under a scenario",
        "description": "Deterministic: whole months survived, every conversion and percentage rounded down, intercompany flows skipped when the sender is short; the assumptions are returned with the result. Fields left out mean no change.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunwayScenarioDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "runway": {
                      "scenario": {
                        "burn_change_pct": 10,
                        "fx_shock_pct": 20,
                        "funding_delay_months": 3
                      },
                      "horizon_months": 60,
                      "entities": [
                        {
                          "entity_id": "ent_01J…",
                          "name": "Acme Tech LLC",
                          "jurisdiction": "UZ",
                          "currency": "UZS",
                          "months": 21,
                          "beyond_horizon": false,
                          "end_cash": 0
                        }
                      ],
                      "consolidated": {
                        "months": 19,
                        "beyond_horizon": false,
                        "currency": "USD",
                        "cash": 1594561.13,
                        "net_monthly_burn": 107637
                      },
                      "funding": [
                        {
                          "funding_id": "fund_01J…",
                          "entity_id": "ent_01J…",
                          "label": "Seed extension (synthetic)",
                          "amount": 1500000,
                          "currency": "USD",
                          "expected_in_months": 4
                        }
                      ],
                      "assumptions": [
                        "fx_static_table",
                        "months_rounded_down"
                      ],
                      "fx": {
                        "as_of": "2026-10-01",
                        "source": "synthetic"
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/runway/scenarios/delete": {
      "post": {
        "operationId": "Silkroute_runwayDelete",
        "summary": "Delete a saved scenario",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunwayScenarioRefDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "deleted": true,
                    "scenario_id": "scn_01J…"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/runway/scenarios/list": {
      "post": {
        "operationId": "Silkroute_runwayScenarios",
        "summary": "Saved scenarios with their group runway, recomputed on the current figures",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "scenarios": [
                      {
                        "scenario_id": "scn_01J…",
                        "name": "Late round",
                        "burn_change_pct": 10,
                        "fx_shock_pct": 20,
                        "funding_delay_months": 3,
                        "runway": {
                          "months": 19,
                          "beyond_horizon": false
                        }
                      }
                    ],
                    "simulated": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/runway/scenarios/save": {
      "post": {
        "operationId": "Silkroute_runwaySave",
        "summary": "Save a scenario (same name overwrites)",
        "description": "At most 20 per workspace. Audited.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunwayScenarioSaveDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "scenario": {
                      "scenario_id": "scn_01J…",
                      "name": "Late round",
                      "burn_change_pct": 10,
                      "fx_shock_pct": 20,
                      "funding_delay_months": 3
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/spend/summary": {
      "post": {
        "operationId": "Silkroute_spend",
        "summary": "Spend across the group in one reporting currency",
        "description": "Approved card charges over the last 30 days (or this month), by currency, category, merchant, card and entity. Each currency is summed natively and converted once at the static dated FX table, rounded down.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpendSummaryDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "spend": {
                      "period": {
                        "kind": "30d",
                        "from": "2026-09-16T10:00:00.000Z",
                        "to": "2026-10-16T10:00:00.000Z"
                      },
                      "currency": "USD",
                      "total": 5521.43,
                      "approved_count": 9,
                      "declined_count": 1,
                      "by_currency": [
                        {
                          "currency": "USD",
                          "amount": 815.4,
                          "converted": 815.4
                        },
                        {
                          "currency": "UZS",
                          "amount": 21500000,
                          "converted": 1699.6
                        }
                      ],
                      "by_category": [
                        {
                          "category": "cloud",
                          "amount": 1795,
                          "count": 2
                        }
                      ],
                      "by_merchant": [
                        {
                          "merchant_id": "MCH_CLOUD_COMPUTE",
                          "name": "Sandbox Cloud Compute",
                          "amount": 1795,
                          "count": 2,
                          "native": [
                            {
                              "currency": "UZS",
                              "amount": 21500000
                            }
                          ]
                        }
                      ],
                      "by_card": [
                        {
                          "card_id": "card_01J…",
                          "label": "Cloud",
                          "last4": "7311",
                          "holder": {
                            "kind": "software",
                            "name": "Build pipeline"
                          },
                          "amount": 2119.6,
                          "count": 2
                        }
                      ],
                      "by_entity": [
                        {
                          "entity_id": "ent_01J…",
                          "name": "Acme Tech LLC",
                          "jurisdiction": "UZ",
                          "currency": "UZS",
                          "amount": 2119.6,
                          "native": [
                            {
                              "currency": "UZS",
                              "amount": 21500000
                            }
                          ]
                        }
                      ],
                      "fx": {
                        "as_of": "2026-10-01",
                        "source": "synthetic",
                        "rounding": "down"
                      },
                      "simulated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/transfers/create": {
      "post": {
        "operationId": "Silkroute_createTransfer",
        "summary": "Simulated intercompany transfer between two entities",
        "description": "Instant and simulated; converted at the static dated FX table, rounded down. 423 LOCKDOWN_ACTIVE while the workspace is locked.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "transfer": {
                      "transfer_id": "xfer_01J…",
                      "from": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Holdings Inc."
                      },
                      "to": {
                        "entity_id": "ent_01J…",
                        "name": "Acme Tech LLC"
                      },
                      "amount": 38000,
                      "currency": "USD",
                      "credited": 480700000,
                      "credited_currency": "UZS",
                      "fx_rate": 12650,
                      "fx_as_of": "2026-10-01",
                      "purpose": "engineering_payroll",
                      "status": "settled",
                      "simulated": true
                    },
                    "replay": false
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/transfers/list": {
      "post": {
        "operationId": "Silkroute_listTransfers",
        "summary": "Recent simulated transfers",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "transfers": [
                      {
                        "transfer_id": "xfer_01J…",
                        "from": {
                          "entity_id": "ent_01J…",
                          "name": "Acme Holdings Inc."
                        },
                        "to": {
                          "entity_id": "ent_01J…",
                          "name": "Acme Tech LLC"
                        },
                        "amount": 38000,
                        "currency": "USD",
                        "credited": 480700000,
                        "credited_currency": "UZS",
                        "fx_rate": 12650,
                        "fx_as_of": "2026-10-01",
                        "purpose": "engineering_payroll",
                        "status": "settled",
                        "simulated": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/workspace/delete": {
      "post": {
        "operationId": "Silkroute_remove",
        "summary": "Delete a workspace and everything in it (sandbox reset)",
        "description": "423 LOCKDOWN_ACTIVE while the workspace is locked. Public demo sandboxes are also deleted 24 hours after they were created.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "deleted": true,
                    "workspace_id": "ws_01J…"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/workspace/ensure": {
      "post": {
        "operationId": "Silkroute_ensure",
        "summary": "Create a workspace (with a synthetic company group) or return the existing one",
        "description": "Idempotent. New workspaces start with four synthetic entities (Delaware, Tashkent, Dubai, Riyadh), intercompany flows and an expected round.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceEnsureDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "created": true,
                    "workspace": {
                      "workspace_id": "ws_01J…",
                      "workspace_ref": "acme-group",
                      "display_name": "Acme Group (sandbox)",
                      "reporting_currency": "USD",
                      "simulated": true,
                      "lockdown": {
                        "active": false,
                        "since": null,
                        "reason": null,
                        "cooldown_seconds": 60,
                        "release_available_at": null
                      },
                      "entities": [
                        {
                          "entity_id": "ent_01J…",
                          "name": "Acme Holdings Inc.",
                          "jurisdiction": "US",
                          "region": "Delaware",
                          "kind": "holding",
                          "currency": "USD",
                          "cash": 1250000,
                          "monthly_burn": 85000,
                          "monthly_revenue": 40000
                        }
                      ],
                      "fx": {
                        "as_of": "2026-10-01",
                        "source": "synthetic"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/silkroute/workspace/get": {
      "post": {
        "operationId": "Silkroute_get",
        "summary": "Workspace, its entities (cash per currency) and lockdown state",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SilkrouteScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "workspace": {
                      "workspace_id": "ws_01J…",
                      "workspace_ref": "acme-group",
                      "display_name": "Acme Group (sandbox)",
                      "reporting_currency": "USD",
                      "simulated": true,
                      "lockdown": {
                        "active": false,
                        "since": null,
                        "reason": null,
                        "cooldown_seconds": 60,
                        "release_available_at": null
                      },
                      "entities": [
                        {
                          "entity_id": "ent_01J…",
                          "name": "Acme Holdings Inc.",
                          "jurisdiction": "US",
                          "region": "Delaware",
                          "kind": "holding",
                          "currency": "USD",
                          "cash": 1250000,
                          "monthly_burn": 85000,
                          "monthly_revenue": 40000
                        }
                      ],
                      "fx": {
                        "as_of": "2026-10-01",
                        "source": "synthetic"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Silkroute (simulated)"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/transactions/get": {
      "post": {
        "operationId": "Transactions_get",
        "summary": "Paginated, enriched transactions (positive amount = money out)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionsGetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts_item_id": "item_01J…",
                    "total_transactions": 82,
                    "transactions": [
                      {
                        "transaction_id": "txn_01J…",
                        "account_id": "acc_01J…",
                        "amount": 125000,
                        "iso_currency_code": "UZS",
                        "pending": false,
                        "date": "2026-10-01",
                        "name": "Korzinka",
                        "merchant_name": "Korzinka",
                        "payment_channel": "in_store",
                        "personal_finance_category": {
                          "primary": "FOOD_AND_DRINK",
                          "detailed": "FOOD_AND_DRINK_GROCERIES"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Transactions"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/accounts/add": {
      "post": {
        "operationId": "Treasury_addAccount",
        "summary": "Add / update a treasury account (priority, reserve) — director",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryAccountAddDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts": []
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/accounts/remove": {
      "post": {
        "operationId": "Treasury_removeAccount",
        "summary": "Remove a treasury account — director",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryAccountIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts": []
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/audit/list": {
      "post": {
        "operationId": "Treasury_audit",
        "summary": "Treasury audit log — director",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryAuditDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "events": [
                      {
                        "actor_type": "client",
                        "actor_id": "member:accountant",
                        "action": "treasury.split.created",
                        "resource_id": "split_01J…"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/balances": {
      "post": {
        "operationId": "Treasury_balances",
        "summary": "Unified balances across the company’s banks",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryScopedDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "as_of": "2026-10-03T10:00:00Z",
                    "totals": [
                      {
                        "currency": "UZS",
                        "current": 245000000,
                        "available": 245000000,
                        "reserved": 15000000,
                        "spendable": 230000000
                      }
                    ],
                    "banks": [
                      {
                        "institution_id": "ins_tumaris",
                        "name": "Tumaris Sandbox Bank",
                        "available": 120000000,
                        "accounts": 1
                      }
                    ],
                    "splits_in_flight": {
                      "count": 0,
                      "amount": 0
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/members/add": {
      "post": {
        "operationId": "Treasury_addMember",
        "summary": "Add a member (director; the first director can be created by the key holder)",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryMemberAddDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "members": []
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/members/list": {
      "post": {
        "operationId": "Treasury_members",
        "summary": "Treasury members and roles",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryActorDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "members": [
                      {
                        "member_ref": "founder",
                        "display_name": "Acme Founder",
                        "role": "director",
                        "status": "active"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/members/update": {
      "post": {
        "operationId": "Treasury_updateMember",
        "summary": "Change a member’s role or disable them (director; the last director cannot be removed)",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TreasuryMemberUpdateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "members": []
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/split/create": {
      "post": {
        "operationId": "Treasury_create",
        "summary": "Pay one counterparty from several accounts",
        "description": "Each part is a separate A2A payment with its own status; on partial failure the split re-allocates (auto) or compensates settled parts. idempotency_key makes retries safe. Sandbox: sandbox_simulate {fail_part, failure, refuse_return}.",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "split": {
                      "split_id": "split_01J…",
                      "status": "completed",
                      "counterparty": {
                        "name": "OOO Paxta Trade",
                        "account_mask": "••••4321"
                      },
                      "total_amount": 50000000,
                      "currency": "UZS",
                      "allocation_mode": "auto",
                      "created_by": {
                        "member_ref": "accountant",
                        "display_name": "Bekzod (Accountant)",
                        "role": "accountant"
                      },
                      "parts": [
                        {
                          "part_no": 1,
                          "account_id": "acc_01J…",
                          "account_label": "Tumaris · Settlement account ••1111",
                          "amount": 35000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        },
                        {
                          "part_no": 2,
                          "account_id": "acc_01J…",
                          "account_label": "Lochin · Settlement account ••2222",
                          "amount": 15000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        }
                      ],
                      "progress": {
                        "settled": 50000000,
                        "in_flight": 0,
                        "failed": 0,
                        "compensated": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/split/get": {
      "post": {
        "operationId": "Treasury_get",
        "summary": "Split with per-part statuses",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "split": {
                      "split_id": "split_01J…",
                      "status": "completed",
                      "counterparty": {
                        "name": "OOO Paxta Trade",
                        "account_mask": "••••4321"
                      },
                      "total_amount": 50000000,
                      "currency": "UZS",
                      "allocation_mode": "auto",
                      "created_by": {
                        "member_ref": "accountant",
                        "display_name": "Bekzod (Accountant)",
                        "role": "accountant"
                      },
                      "parts": [
                        {
                          "part_no": 1,
                          "account_id": "acc_01J…",
                          "account_label": "Tumaris · Settlement account ••1111",
                          "amount": 35000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        },
                        {
                          "part_no": 2,
                          "account_id": "acc_01J…",
                          "account_label": "Lochin · Settlement account ••2222",
                          "amount": 15000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        }
                      ],
                      "progress": {
                        "settled": 50000000,
                        "in_flight": 0,
                        "failed": 0,
                        "compensated": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/split/list": {
      "post": {
        "operationId": "Treasury_list",
        "summary": "List splits",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "splits": [
                      {
                        "split_id": "split_01J…",
                        "status": "completed",
                        "counterparty": {
                          "name": "OOO Paxta Trade",
                          "account_mask": "••••4321"
                        },
                        "total_amount": 50000000,
                        "currency": "UZS",
                        "allocation_mode": "auto",
                        "created_by": {
                          "member_ref": "accountant",
                          "display_name": "Bekzod (Accountant)",
                          "role": "accountant"
                        },
                        "parts": [
                          {
                            "part_no": 1,
                            "account_id": "acc_01J…",
                            "account_label": "Tumaris · Settlement account ••1111",
                            "amount": 35000000,
                            "status": "settled",
                            "attempts": 1,
                            "payment_id": "pay_01J…"
                          },
                          {
                            "part_no": 2,
                            "account_id": "acc_01J…",
                            "account_label": "Lochin · Settlement account ••2222",
                            "amount": 15000000,
                            "status": "settled",
                            "attempts": 1,
                            "payment_id": "pay_01J…"
                          }
                        ],
                        "progress": {
                          "settled": 50000000,
                          "in_flight": 0,
                          "failed": 0,
                          "compensated": 0
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/split/preview": {
      "post": {
        "operationId": "Treasury_preview",
        "summary": "Preview how a payment would be split (nothing moves)",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitPreviewDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "total_amount": 50000000,
                    "currency": "UZS",
                    "allocation_mode": "auto",
                    "parts": [
                      {
                        "part_no": 1,
                        "account_id": "acc_01J…",
                        "account_label": "Tumaris · Settlement ••1111",
                        "amount": 35000000
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/treasury/split/retry_compensation": {
      "post": {
        "operationId": "Treasury_retry",
        "summary": "Retry a refused counterparty return — director",
        "parameters": [
          {
            "name": "Silkroute-Actor",
            "in": "header",
            "description": "Acting treasury member (alternative to actor_ref)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "split": {
                      "split_id": "split_01J…",
                      "status": "compensated",
                      "counterparty": {
                        "name": "OOO Paxta Trade",
                        "account_mask": "••••4321"
                      },
                      "total_amount": 50000000,
                      "currency": "UZS",
                      "allocation_mode": "auto",
                      "created_by": {
                        "member_ref": "accountant",
                        "display_name": "Bekzod (Accountant)",
                        "role": "accountant"
                      },
                      "parts": [
                        {
                          "part_no": 1,
                          "account_id": "acc_01J…",
                          "account_label": "Tumaris · Settlement account ••1111",
                          "amount": 35000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        },
                        {
                          "part_no": 2,
                          "account_id": "acc_01J…",
                          "account_label": "Lochin · Settlement account ••2222",
                          "amount": 15000000,
                          "status": "settled",
                          "attempts": 1,
                          "payment_id": "pay_01J…"
                        }
                      ],
                      "progress": {
                        "settled": 50000000,
                        "in_flight": 0,
                        "failed": 0,
                        "compensated": 0
                      }
                    },
                    "parts_retried": 1
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Treasury & split payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/user/accounts/list": {
      "post": {
        "operationId": "UsersSession_accounts",
        "summary": "My linked accounts across banks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "accounts": [
                      {
                        "account_id": "acc_01J…",
                        "name": "Current account",
                        "mask": "4415",
                        "subtype": "checking",
                        "institution": {
                          "institution_id": "ins_bulut",
                          "name": "Bulut Sandbox Bank"
                        },
                        "balances": {
                          "current": 300000,
                          "available": 300000,
                          "iso_currency_code": "UZS"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/assistant/ask": {
      "post": {
        "operationId": "Insights_ask",
        "summary": "Ask the read-only money assistant",
        "description": "Tools are fixed and read-only (cash flow, category spend, risk score) and always scoped to this user. Every figure in the answer comes from `facts`; without an LLM key the answer is a deterministic summary. Limited per user per day.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantAskDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "answer": "From 2026-07-12 to 2026-10-09 you received 28 500 000 UZS and spent 12 900 000 UZS; rent and utilities were 61% of spending.",
                    "mode": "llm",
                    "fallback_reason": null,
                    "language": "en",
                    "read_only": true,
                    "sources": [
                      {
                        "tool": "get_cashflow",
                        "period": {
                          "start": "2026-07-12",
                          "end": "2026-10-09",
                          "days": 90
                        },
                        "months": null,
                        "accounts": 2
                      }
                    ],
                    "facts": [
                      {
                        "tool": "get_cashflow",
                        "arguments": {
                          "period": "90d"
                        },
                        "result": {
                          "totals": {
                            "inflow": 28500000,
                            "outflow": 12900000,
                            "net": 15600000
                          }
                        }
                      }
                    ],
                    "usage": {
                      "questions_today": 1,
                      "daily_limit": 10
                    },
                    "data_source": "synthetic_sandbox"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Insights & assistant"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/executions/confirm": {
      "post": {
        "operationId": "BalancingUser_confirm",
        "summary": "Confirm a suggested top-up (exactly once)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingExecutionIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "execution": {
                      "execution_id": "abx_01J…",
                      "rule_id": "abr_01J…",
                      "status": "executing",
                      "amount": 900000,
                      "shortfall": 899877,
                      "shortfall_date": "2026-10-17",
                      "partial": false,
                      "decided_by": "user",
                      "attempts": 1,
                      "max_attempts": 3,
                      "payment_id": "pay_01J…",
                      "attempt_log": [
                        {
                          "attempt_no": 1,
                          "status": "settled",
                          "error": null,
                          "payment_id": "pay_01J…"
                        }
                      ]
                    },
                    "result": "transfer_confirmed"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/executions/dismiss": {
      "post": {
        "operationId": "BalancingUser_dismiss",
        "summary": "Dismiss a suggested top-up",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingExecutionIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "execution": {
                      "execution_id": "abx_01J…",
                      "rule_id": "abr_01J…",
                      "status": "dismissed",
                      "amount": 900000,
                      "shortfall": 899877,
                      "shortfall_date": "2026-10-17",
                      "partial": false,
                      "decided_by": "user",
                      "attempts": 1,
                      "max_attempts": 3,
                      "payment_id": "pay_01J…",
                      "attempt_log": [
                        {
                          "attempt_no": 1,
                          "status": "settled",
                          "error": null,
                          "payment_id": "pay_01J…"
                        }
                      ]
                    },
                    "result": "transfer_dismissed"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/executions/list": {
      "post": {
        "operationId": "BalancingUser_executions",
        "summary": "Every decision and transfer attempt (the log)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingExecutionsListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "executions": [
                      {
                        "execution_id": "abx_01J…",
                        "rule_id": "abr_01J…",
                        "status": "executed",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "partial": false,
                        "decided_by": "user",
                        "attempts": 1,
                        "max_attempts": 3,
                        "payment_id": "pay_01J…",
                        "attempt_log": [
                          {
                            "attempt_no": 1,
                            "status": "settled",
                            "error": null,
                            "payment_id": "pay_01J…"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/create": {
      "post": {
        "operationId": "BalancingUser_create",
        "summary": "Create a top-up rule (X protected, Y donor, cap N, donor floor M)",
        "description": "Evaluates immediately. mode=notify suggests a transfer to confirm; mode=auto moves the money (never above N, never leaving Y below M).",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingRuleCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "active",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    },
                    "evaluation": {
                      "evaluated": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/delete": {
      "post": {
        "operationId": "BalancingUser_remove",
        "summary": "Delete a rule",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingRuleIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "deleted",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/evaluate": {
      "post": {
        "operationId": "BalancingUser_evaluate",
        "summary": "Check now (dry_run=true only projects)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingEvaluateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "evaluated": true,
                    "evaluation": {
                      "action": "transfer",
                      "amount": 900000,
                      "shortfall_date": "2026-10-17",
                      "projected_min_balance": -899877,
                      "upcoming": [
                        {
                          "date": "2026-10-17",
                          "amount": 1200000,
                          "description": "Rent",
                          "source": "scheduled"
                        }
                      ]
                    },
                    "execution": {
                      "execution_id": "abx_01J…",
                      "rule_id": "abr_01J…",
                      "status": "suggested",
                      "amount": 900000,
                      "shortfall": 899877,
                      "shortfall_date": "2026-10-17",
                      "partial": false,
                      "decided_by": "user",
                      "attempts": 1,
                      "max_attempts": 3,
                      "payment_id": "pay_01J…",
                      "attempt_log": [
                        {
                          "attempt_no": 1,
                          "status": "settled",
                          "error": null,
                          "payment_id": "pay_01J…"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/list": {
      "post": {
        "operationId": "BalancingUser_list",
        "summary": "My rules with their latest projection",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rules": [
                      {
                        "rule_id": "abr_01J…",
                        "name": "Keep my card topped up",
                        "status": "active",
                        "mode": "notify",
                        "user_ref": "enduser_demo_001",
                        "target_account": {
                          "account_id": "acc_01J…",
                          "label": "Bulut · Current account ••4415"
                        },
                        "source_account": {
                          "account_id": "acc_01J…",
                          "label": "Tumaris · Savings ••9012"
                        },
                        "currency": "UZS",
                        "horizon_days": 7,
                        "deadline_date": null,
                        "target_min_balance": 0,
                        "max_transfer_amount": 2000000,
                        "source_min_balance": 5000000,
                        "last_evaluation": {
                          "action": "transfer",
                          "amount": 900000,
                          "shortfall": 899877,
                          "shortfall_date": "2026-10-17",
                          "projected_min_balance": -899877
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/pause": {
      "post": {
        "operationId": "BalancingUser_pause",
        "summary": "Pause a rule (open suggestions expire)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingRuleIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "paused",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/resume": {
      "post": {
        "operationId": "BalancingUser_resume",
        "summary": "Resume a paused rule",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingRuleIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "active",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/balancing/rules/update": {
      "post": {
        "operationId": "BalancingUser_update",
        "summary": "Change limits, horizon or mode",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalancingRuleUpdateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "rule": {
                      "rule_id": "abr_01J…",
                      "name": "Keep my card topped up",
                      "status": "active",
                      "mode": "notify",
                      "user_ref": "enduser_demo_001",
                      "target_account": {
                        "account_id": "acc_01J…",
                        "label": "Bulut · Current account ••4415"
                      },
                      "source_account": {
                        "account_id": "acc_01J…",
                        "label": "Tumaris · Savings ••9012"
                      },
                      "currency": "UZS",
                      "horizon_days": 7,
                      "deadline_date": null,
                      "target_min_balance": 0,
                      "max_transfer_amount": 2000000,
                      "source_min_balance": 5000000,
                      "last_evaluation": {
                        "action": "transfer",
                        "amount": 900000,
                        "shortfall": 899877,
                        "shortfall_date": "2026-10-17",
                        "projected_min_balance": -899877
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Auto-Balancing"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/insights/summary": {
      "post": {
        "operationId": "Insights_summary",
        "summary": "My cash flow per month and spending per category",
        "description": "Aggregates over the user’s connected banks inside their consent window; whole UZS; transfers between own accounts excluded.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightsSummaryDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "period": {
                      "start": "2026-07-12",
                      "end": "2026-10-09",
                      "days": 90
                    },
                    "currency": "UZS",
                    "accounts": 2,
                    "cashflow": {
                      "months": [
                        {
                          "month": "2026-09",
                          "inflow": 9500000,
                          "outflow": 4120000,
                          "net": 5380000
                        }
                      ],
                      "totals": {
                        "inflow": 28500000,
                        "outflow": 12900000,
                        "net": 15600000
                      },
                      "savings_rate_pct": 55,
                      "transactions": 61
                    },
                    "categories": [
                      {
                        "category": "RENT_AND_UTILITIES",
                        "amount": 7900000,
                        "share_pct": 61,
                        "transactions": 6
                      }
                    ],
                    "data_source": "synthetic_sandbox"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Insights & assistant"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/items/remove": {
      "post": {
        "operationId": "ItemsUser_remove",
        "summary": "Disconnect one of my banks (instant)",
        "description": "Same effect as /item/remove: data access ends now and mandates / rules on that bank end with it.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserItemRemoveDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "item_id": "item_01J…",
                    "removed": true,
                    "ended": {
                      "vrp_mandates_revoked": 1,
                      "balancing_rules_deleted": 0,
                      "treasury_accounts_removed": 0
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/me": {
      "post": {
        "operationId": "UsersSession_me",
        "summary": "Current end user + Telegram link status",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "user_ref": "enduser_demo_001",
                    "environment": "sandbox",
                    "telegram": {
                      "linked": true,
                      "lang": "uz",
                      "linked_at": "2026-10-03T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/notifications/act": {
      "post": {
        "operationId": "UserNotifications_act",
        "summary": "Take an action offered on a notification (approve, revoke, confirm…)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationActDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "ok": true,
                    "notification_id": "ntf_01J…",
                    "type": "vrp_charge",
                    "action": "revoke",
                    "result": "mandate_revoked"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/notifications/list": {
      "post": {
        "operationId": "UserNotifications_list",
        "summary": "List notifications (inbox)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "notifications": [
                      {
                        "notification_id": "ntf_01J…",
                        "type": "vrp_charge",
                        "payload": {
                          "amount": 312400,
                          "currency": "UZS",
                          "payee": "Shahar Kommunal"
                        },
                        "actions": [
                          "pause",
                          "revoke"
                        ],
                        "action_taken": null,
                        "delivery_status": "delivered",
                        "read_at": null,
                        "created_at": "2026-10-03T10:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/notifications/read": {
      "post": {
        "operationId": "UserNotifications_read",
        "summary": "Mark notifications as read",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationReadDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "marked": 2
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/passport/consent/deny": {
      "post": {
        "operationId": "CreditPassportUser_deny",
        "summary": "Deny a request",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportUserConsentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent": {
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "status": "denied",
                      "requester_name": "Acme Microfinance",
                      "purpose": "Consumer loan application #4821",
                      "period_months": 6,
                      "access_ttl_days": 30,
                      "granted_at": "2026-10-03T10:05:00Z",
                      "access_expires_at": "2026-11-02T10:05:00Z",
                      "fetch_count": 1
                    },
                    "result": "passport_denied"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/passport/consent/grant": {
      "post": {
        "operationId": "CreditPassportUser_grant",
        "summary": "Grant access (sandbox SCA: OTP 123456)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportUserGrantDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent": {
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "status": "granted",
                      "requester_name": "Acme Microfinance",
                      "purpose": "Consumer loan application #4821",
                      "period_months": 6,
                      "access_ttl_days": 30,
                      "granted_at": "2026-10-03T10:05:00Z",
                      "access_expires_at": "2026-11-02T10:05:00Z",
                      "fetch_count": 1
                    },
                    "result": "passport_granted"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/passport/consent/revoke": {
      "post": {
        "operationId": "CreditPassportUser_revoke",
        "summary": "Revoke access instantly",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportUserConsentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consent": {
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "status": "revoked",
                      "requester_name": "Acme Microfinance",
                      "purpose": "Consumer loan application #4821",
                      "period_months": 6,
                      "access_ttl_days": 30,
                      "granted_at": "2026-10-03T10:05:00Z",
                      "access_expires_at": "2026-11-02T10:05:00Z",
                      "fetch_count": 1,
                      "revoked_by": "user"
                    },
                    "result": "passport_revoked"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/passport/consents/list": {
      "post": {
        "operationId": "CreditPassportUser_list",
        "summary": "Who requested my passport, and every access",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "consents": [
                      {
                        "consent_id": "pcon_01J…",
                        "user_ref": "enduser_demo_001",
                        "status": "granted",
                        "requester_name": "Acme Microfinance",
                        "purpose": "Consumer loan application #4821",
                        "period_months": 6,
                        "access_ttl_days": 30,
                        "granted_at": "2026-10-03T10:05:00Z",
                        "access_expires_at": "2026-11-02T10:05:00Z",
                        "fetch_count": 1,
                        "access_log": [
                          {
                            "action": "fetched",
                            "actor": "client",
                            "at": "2026-10-03T10:06:00Z"
                          },
                          {
                            "action": "granted",
                            "actor": "user",
                            "at": "2026-10-03T10:05:00Z"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/passport/preview": {
      "post": {
        "operationId": "CreditPassportUser_preview",
        "summary": "My own score and its explanation (not shared with anyone)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportUserPreviewDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "passport": {
                      "passport_id": "cp_01J…",
                      "consent_id": "pcon_01J…",
                      "user_ref": "enduser_demo_001",
                      "model_version": "cf-v1",
                      "score": 712,
                      "grade": "B",
                      "confidence": "high",
                      "flags": [],
                      "factors": [
                        {
                          "key": "income_stability",
                          "weight": 0.3,
                          "sub_score": 88,
                          "points": 145,
                          "max_points": 165,
                          "impact": "positive",
                          "value": {
                            "avg_monthly_income": 9500000,
                            "coefficient_of_variation": 0.07,
                            "months_with_income": 6,
                            "months_observed": 6
                          },
                          "explanation": "Average monthly income 9,500,000 UZS over 6 month(s); month-to-month variation 7%; income in 6/6 months.",
                          "explanation_key": "income_stability.positive"
                        }
                      ],
                      "metrics": {
                        "months_observed": 6,
                        "avg_monthly_income": 9500000,
                        "avg_monthly_outflow": 6100000,
                        "debt_to_income": 0,
                        "income_sources": 1
                      },
                      "period": {
                        "start": "2026-04-01",
                        "end": "2026-09-30"
                      },
                      "accounts_analyzed": 2,
                      "score_range": {
                        "min": 300,
                        "max": 850
                      },
                      "data_source": "synthetic_sandbox"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/telegram/link": {
      "post": {
        "operationId": "UsersB2B_link",
        "summary": "Link a Telegram account from Mini App initData",
        "description": "Verifies initData (HMAC) and enables Telegram notifications with confirm/revoke buttons.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramLinkDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "linked": true,
                    "telegram_user": {
                      "id": 123456789,
                      "first_name": "Aziz",
                      "username": "aziz",
                      "lang": "uz"
                    },
                    "user_token": "user-sandbox-…",
                    "expiration": "2026-10-03T12:00:00.000Z",
                    "user_ref": "enduser_demo_001"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/user/telegram/unlink": {
      "post": {
        "operationId": "UsersSession_unlink",
        "summary": "Stop Telegram notifications",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "linked": false
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/token/create": {
      "post": {
        "operationId": "UsersB2B_create",
        "summary": "Create a user_token for the consent centre",
        "description": "Short-lived bearer token scoped to one end user. Keep it server-side; it authorises /user/* calls.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserTokenCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "user_token": "user-sandbox-4f8a…",
                    "expiration": "2026-10-03T12:00:00.000Z",
                    "user_ref": "enduser_demo_001"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/user/token/revoke": {
      "post": {
        "operationId": "UsersSession_revoke",
        "summary": "Revoke this user_token immediately",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "revoked": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/charges/list": {
      "post": {
        "operationId": "VrpUser_charges",
        "summary": "Every charge under one of my mandates",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserChargesDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate_id": "mandate_01J…",
                    "charges": [
                      {
                        "charge_id": "vrpc_01J…",
                        "mandate_id": "mandate_01J…",
                        "status": "executing",
                        "amount": 312400,
                        "currency": "UZS",
                        "rejection_code": null,
                        "payment_id": "pay_01J…",
                        "period_start": "2026-09-30T19:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandate/authorize": {
      "post": {
        "operationId": "VrpUser_authorize",
        "summary": "Approve a mandate (sandbox SCA: OTP 123456)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserAuthorizeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "active",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    },
                    "result": "mandate_approved"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandate/decline": {
      "post": {
        "operationId": "VrpUser_decline",
        "summary": "Decline a mandate request",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserMandateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "declined",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    },
                    "result": "mandate_declined"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandate/pause": {
      "post": {
        "operationId": "VrpUser_pause",
        "summary": "Pause a mandate (charges are refused until resumed)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserMandateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "paused",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    },
                    "result": "mandate_paused"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandate/resume": {
      "post": {
        "operationId": "VrpUser_resume",
        "summary": "Resume a paused mandate",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserMandateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "active",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    },
                    "result": "mandate_resumed"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandate/revoke": {
      "post": {
        "operationId": "VrpUser_revoke",
        "summary": "Revoke a mandate permanently (instant)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpUserMandateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "revoked",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z",
                      "revoked_by": "user"
                    },
                    "result": "mandate_revoked"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/user/vrp/mandates/list": {
      "post": {
        "operationId": "VrpUser_list",
        "summary": "My recurring-payment mandates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandates": [
                      {
                        "mandate_id": "mandate_01J…",
                        "status": "active",
                        "user_ref": "enduser_demo_001",
                        "account_id": "acc_01J…",
                        "payee": {
                          "name": "Shahar Kommunal",
                          "account_mask": "••••6789"
                        },
                        "currency": "UZS",
                        "limits": {
                          "max_per_payment": 500000,
                          "period": "month",
                          "period_limit": 1000000,
                          "max_payments_per_period": null
                        },
                        "usage": {
                          "period_start": "2026-09-30T19:00:00.000Z",
                          "period_end": "2026-10-31T19:00:00.000Z",
                          "used": 312400,
                          "payments": 1,
                          "remaining": 687600
                        },
                        "valid_from": "2026-10-03T10:00:00Z",
                        "expires_at": "2027-10-03T10:00:00Z",
                        "authorized_at": "2026-10-03T10:01:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "Users & consent centre"
        ],
        "security": [
          {
            "userToken": []
          }
        ]
      }
    },
    "/v1/vrp/charges/list": {
      "post": {
        "operationId": "Vrp_charges",
        "summary": "Full charge log of a mandate (including rejected attempts)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpChargeListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate_id": "mandate_01J…",
                    "charges": [
                      {
                        "charge_id": "vrpc_01J…",
                        "mandate_id": "mandate_01J…",
                        "status": "executing",
                        "amount": 312400,
                        "currency": "UZS",
                        "rejection_code": null,
                        "payment_id": "pay_01J…",
                        "period_start": "2026-09-30T19:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/vrp/mandate/create": {
      "post": {
        "operationId": "Vrp_create",
        "summary": "Request a VRP mandate (the user must approve it)",
        "description": "Creates the mandate in awaiting_authorization and notifies the user (consent centre + Telegram). Charges are refused until approved.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpMandateCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "awaiting_authorization",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/vrp/mandate/get": {
      "post": {
        "operationId": "Vrp_get",
        "summary": "Mandate status, limits and current-period usage",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpMandateIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "active",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/vrp/mandate/list": {
      "post": {
        "operationId": "Vrp_list",
        "summary": "List mandates",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpMandateListDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandates": [
                      {
                        "mandate_id": "mandate_01J…",
                        "status": "active",
                        "user_ref": "enduser_demo_001",
                        "account_id": "acc_01J…",
                        "payee": {
                          "name": "Shahar Kommunal",
                          "account_mask": "••••6789"
                        },
                        "currency": "UZS",
                        "limits": {
                          "max_per_payment": 500000,
                          "period": "month",
                          "period_limit": 1000000,
                          "max_payments_per_period": null
                        },
                        "usage": {
                          "period_start": "2026-09-30T19:00:00.000Z",
                          "period_end": "2026-10-31T19:00:00.000Z",
                          "used": 312400,
                          "payments": 1,
                          "remaining": 687600
                        },
                        "valid_from": "2026-10-03T10:00:00Z",
                        "expires_at": "2027-10-03T10:00:00Z",
                        "authorized_at": "2026-10-03T10:01:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/vrp/mandate/revoke": {
      "post": {
        "operationId": "Vrp_revoke",
        "summary": "Cancel a mandate as the payee",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpMandateIdDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "mandate": {
                      "mandate_id": "mandate_01J…",
                      "status": "revoked",
                      "user_ref": "enduser_demo_001",
                      "account_id": "acc_01J…",
                      "payee": {
                        "name": "Shahar Kommunal",
                        "account_mask": "••••6789"
                      },
                      "currency": "UZS",
                      "limits": {
                        "max_per_payment": 500000,
                        "period": "month",
                        "period_limit": 1000000,
                        "max_payments_per_period": null
                      },
                      "usage": {
                        "period_start": "2026-09-30T19:00:00.000Z",
                        "period_end": "2026-10-31T19:00:00.000Z",
                        "used": 312400,
                        "payments": 1,
                        "remaining": 687600
                      },
                      "valid_from": "2026-10-03T10:00:00Z",
                      "expires_at": "2027-10-03T10:00:00Z",
                      "authorized_at": "2026-10-03T10:01:00Z",
                      "revoked_by": "client"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    },
    "/v1/vrp/payment/create": {
      "post": {
        "operationId": "Vrp_charge",
        "summary": "Charge a variable amount under a mandate",
        "description": "Every attempt is logged. Above-limit or inactive-mandate attempts return status \"rejected\" with rejection_code (LIMIT_PER_PAYMENT_EXCEEDED, PERIOD_LIMIT_EXCEEDED, PERIOD_COUNT_EXCEEDED, MANDATE_PAUSED, MANDATE_REVOKED, MANDATE_EXPIRED…). Accepted charges settle asynchronously (VRP_PAYMENT_STATUS_UPDATED).",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VrpChargeCreateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "charge": {
                      "charge_id": "vrpc_01J…",
                      "mandate_id": "mandate_01J…",
                      "status": "executing",
                      "amount": 312400,
                      "currency": "UZS",
                      "rejection_code": null,
                      "payment_id": "pay_01J…",
                      "period_start": "2026-09-30T19:00:00.000Z"
                    },
                    "remaining_in_period": 687600
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidErrorDto"
                }
              }
            }
          }
        },
        "tags": [
          "VRP — variable recurring payments"
        ],
        "security": [
          {
            "clientId": [],
            "secret": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Silkroute API",
    "description": "Open Banking & A2A payments for Uzbekistan. B2B endpoints authenticate with Silkroute-Client-Id + Silkroute-Secret headers (or client_id/secret in the body); consent-centre endpoints use a user_token bearer. Amounts are major units (UZS). Errors share one envelope (error_type, error_code, error_message, display_message, request_id). This build runs on sandbox/mock banks only — all data is demo data.",
    "version": "1.1.0",
    "contact": {}
  },
  "tags": [],
  "servers": [
    {
      "url": "https://plaiduz-api-production.up.railway.app",
      "description": "Sandbox"
    },
    {
      "url": "http://localhost:4000",
      "description": "Local"
    }
  ],
  "components": {
    "securitySchemes": {
      "clientId": {
        "type": "apiKey",
        "in": "header",
        "name": "Silkroute-Client-Id"
      },
      "secret": {
        "type": "apiKey",
        "in": "header",
        "name": "Silkroute-Secret"
      },
      "userToken": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http",
        "description": "user_token from POST /v1/user/token/create"
      }
    },
    "schemas": {
      "PlaidErrorDto": {
        "type": "object",
        "properties": {
          "error_type": {
            "type": "string",
            "example": "INVALID_INPUT"
          },
          "error_code": {
            "type": "string",
            "example": "INVALID_FIELD"
          },
          "error_message": {
            "type": "string",
            "example": "amount must be a positive amount with at most 2 decimal places."
          },
          "display_message": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "request_id": {
            "type": "string",
            "example": "req_5f0c1d2e3a4b5c6d7e8f9a0b"
          }
        },
        "required": [
          "error_type",
          "error_code",
          "error_message",
          "display_message",
          "request_id"
        ]
      },
      "UserTokenCreateDto": {
        "type": "object",
        "properties": {
          "user_ref": {
            "type": "string",
            "description": "Your own reference for the end user (same as /link/token/create).",
            "maxLength": 128
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "user_ref"
        ]
      },
      "TelegramLinkDto": {
        "type": "object",
        "properties": {
          "user_ref": {
            "type": "string",
            "description": "Your user reference. Omit to use a stable `tg_<telegram user id>` derived after verification.",
            "maxLength": 128
          },
          "init_data": {
            "type": "string",
            "description": "Raw `Telegram.WebApp.initData` string from the Mini App.",
            "maxLength": 4096
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "init_data"
        ]
      },
      "NotificationListDto": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          },
          "unread_only": {
            "type": "boolean"
          }
        }
      },
      "NotificationActDto": {
        "type": "object",
        "properties": {
          "notification_id": {
            "type": "string",
            "maxLength": 64
          },
          "action": {
            "type": "string",
            "pattern": "/^[a-z_]{2,12}$/"
          }
        },
        "required": [
          "notification_id",
          "action"
        ]
      },
      "NotificationReadDto": {
        "type": "object",
        "properties": {
          "notification_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          }
        },
        "required": [
          "notification_ids"
        ]
      },
      "LinkBrandingDto": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "maxLength": 40
          },
          "primary_color": {
            "type": "string",
            "maxLength": 7
          },
          "accent_color": {
            "type": "string",
            "maxLength": 7
          },
          "logo_url": {
            "type": "string",
            "maxLength": 500
          },
          "support_url": {
            "type": "string",
            "maxLength": 500
          },
          "privacy_url": {
            "type": "string",
            "maxLength": 500
          },
          "consent_headline": {
            "type": "string",
            "maxLength": 120
          }
        }
      },
      "CreateLinkTokenDto": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "description": "client_id / secret may also be supplied via headers (see ApiKeyGuard).",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "maxLength": 200
          },
          "user_ref": {
            "type": "string",
            "description": "The client's own reference for the end user.",
            "maxLength": 128
          },
          "products": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 32
            }
          },
          "language": {
            "type": "string",
            "maxLength": 16
          },
          "webhook_url": {
            "type": "string",
            "maxLength": 2048
          },
          "redirect_uri": {
            "type": "string",
            "maxLength": 2048
          },
          "payment_id": {
            "type": "string",
            "description": "Present when this Link session initiates an A2A payment.",
            "maxLength": 64
          },
          "branding": {
            "description": "Sandbox only: brand THIS session differently from your saved branding\n(live previews of a white-label look). Production uses saved branding.",
            "allOf": [
              {
                "$ref": "#/components/schemas/LinkBrandingDto"
              }
            ]
          },
          "code_challenge": {
            "type": "string",
            "description": "Optional PKCE: base64url(sha256(code_verifier)). When set, the resulting\npublic_token can only be exchanged together with that code_verifier.",
            "maxLength": 128
          },
          "code_challenge_method": {
            "type": "string",
            "description": "Must be \"S256\" when code_challenge is set.",
            "maxLength": 8
          }
        },
        "required": [
          "user_ref"
        ]
      },
      "SessionLoginDto": {
        "type": "object",
        "properties": {
          "link_token": {
            "type": "string",
            "maxLength": 200
          },
          "institution_id": {
            "type": "string",
            "maxLength": 64
          },
          "username": {
            "type": "string",
            "maxLength": 64
          },
          "password": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "link_token",
          "institution_id",
          "username",
          "password"
        ]
      },
      "LinkBrandingGetDto": {
        "type": "object",
        "properties": {
          "link_token": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "link_token"
        ]
      },
      "SessionOtpDto": {
        "type": "object",
        "properties": {
          "link_token": {
            "type": "string",
            "maxLength": 200
          },
          "login_session_id": {
            "type": "string",
            "maxLength": 64
          },
          "institution_id": {
            "type": "string",
            "maxLength": 64
          },
          "otp": {
            "type": "string",
            "minLength": 4,
            "maxLength": 8
          }
        },
        "required": [
          "link_token",
          "login_session_id",
          "institution_id",
          "otp"
        ]
      },
      "ExchangeDto": {
        "type": "object",
        "properties": {
          "public_token": {
            "type": "string",
            "maxLength": 200
          },
          "code_verifier": {
            "type": "string",
            "description": "Required when the link_token was created with a code_challenge (PKCE).",
            "maxLength": 128
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "public_token"
        ]
      },
      "AccessTokenDto": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "maxLength": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "access_token"
        ]
      },
      "UserItemRemoveDto": {
        "type": "object",
        "properties": {
          "item_id": {
            "type": "string",
            "description": "item_id from /user/accounts/list.",
            "maxLength": 64
          }
        },
        "required": [
          "item_id"
        ]
      },
      "BalanceGetDto": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "maxLength": 200
          },
          "access_token": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "access_token"
        ]
      },
      "TxnOptions": {
        "type": "object",
        "properties": {
          "count": {
            "type": "object",
            "default": 100,
            "minimum": 1,
            "maximum": 500
          },
          "offset": {
            "type": "object",
            "default": 0,
            "minimum": 0
          },
          "account_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          }
        },
        "required": [
          "count",
          "offset"
        ]
      },
      "TransactionsGetDto": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "maxLength": 200
          },
          "access_token": {
            "type": "string",
            "maxLength": 200
          },
          "start_date": {
            "type": "string",
            "description": "ISO dates (YYYY-MM-DD).",
            "pattern": "YMD"
          },
          "end_date": {
            "type": "string",
            "pattern": "YMD"
          },
          "options": {
            "$ref": "#/components/schemas/TxnOptions"
          }
        },
        "required": [
          "access_token"
        ]
      },
      "IdentityGetDto": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "maxLength": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "access_token"
        ]
      },
      "CreditorDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 140
          },
          "account_number": {
            "type": "string",
            "description": "20-digit UZ account number or tokenised card (34 = the longest IBAN).",
            "maxLength": 34
          },
          "institution_id": {
            "type": "string",
            "maxLength": 64
          },
          "swift_bic": {
            "type": "string",
            "maxLength": 11
          }
        },
        "required": [
          "name",
          "account_number"
        ]
      },
      "InitiatePaymentDto": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "maxLength": 200
          },
          "access_token": {
            "type": "string",
            "description": "Debtor side — the linked account funds leave from.",
            "maxLength": 200
          },
          "account_id": {
            "type": "string",
            "maxLength": 64
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "currency": {
            "type": "string",
            "default": "UZS",
            "enum": [
              "UZS",
              "USD",
              "EUR"
            ]
          },
          "creditor": {
            "$ref": "#/components/schemas/CreditorDto"
          },
          "reference": {
            "type": "string",
            "maxLength": 140
          },
          "idempotency_key": {
            "type": "string",
            "description": "Required for safe retries — dedupes at the DB layer.",
            "maxLength": 255
          }
        },
        "required": [
          "access_token",
          "account_id",
          "amount",
          "currency",
          "creditor",
          "idempotency_key"
        ]
      },
      "PaymentStatusDto": {
        "type": "object",
        "properties": {
          "payment_id": {
            "type": "string",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "payment_id"
        ]
      },
      "SandboxItemCreateDto": {
        "type": "object",
        "properties": {
          "user_ref": {
            "type": "string",
            "maxLength": 128
          },
          "institution_id": {
            "type": "string",
            "description": "Bank, e.g. ins_tumaris, ins_lochin, ins_bulut (default ins_tumaris).",
            "maxLength": 64
          },
          "persona": {
            "type": "string",
            "description": "Synthetic customer profile for the primary account (default salaried).",
            "enum": [
              "salaried",
              "self_employed",
              "over_indebted",
              "business",
              "empty"
            ]
          },
          "starting_balance": {
            "type": "number",
            "description": "Exact opening balance of the primary account, major units.",
            "minimum": 0,
            "maximum": 100000000000
          },
          "history_days": {
            "type": "number",
            "description": "Days of history to generate (default 365 — enough for a 12-month Credit Passport).",
            "minimum": 7,
            "maximum": 400
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "user_ref"
        ]
      },
      "SandboxUpcomingDebitDto": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "maxLength": 200
          },
          "account_id": {
            "type": "string",
            "maxLength": 64
          },
          "amount": {
            "type": "number",
            "description": "Major units, money leaving the account on due_date.",
            "minimum": 1
          },
          "due_date": {
            "type": "string",
            "pattern": "DATE"
          },
          "description": {
            "type": "string",
            "maxLength": 140
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "access_token",
          "account_id",
          "amount",
          "due_date",
          "description"
        ]
      },
      "VrpPayeeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Payee shown to the user, e.g. \"Shahar Kommunal\".",
            "maxLength": 140
          },
          "account_number": {
            "type": "string",
            "description": "Payee bank account (8–34 alphanumerics). Stored encrypted; only the last 4 are ever returned.",
            "pattern": "/^[0-9A-Za-z]{8,34}$/"
          }
        },
        "required": [
          "name",
          "account_number"
        ]
      },
      "VrpLimitsDto": {
        "type": "object",
        "properties": {
          "max_per_payment": {
            "type": "number",
            "description": "Maximum amount of ONE payment (major units).",
            "minimum": 1
          },
          "period": {
            "type": "string",
            "description": "Limit window, on the Asia/Tashkent calendar.",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ]
          },
          "period_limit": {
            "type": "number",
            "description": "Maximum total per window (major units). Must be ≥ max_per_payment.",
            "minimum": 1
          },
          "max_payments_per_period": {
            "type": "number",
            "description": "Optional cap on the number of payments per window.",
            "minimum": 1,
            "maximum": 1000
          }
        },
        "required": [
          "max_per_payment",
          "period",
          "period_limit"
        ]
      },
      "VrpMandateCreateDto": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The user's linked item (debtor side).",
            "maxLength": 200
          },
          "account_id": {
            "type": "string",
            "description": "Debtor account external id on that item.",
            "maxLength": 64
          },
          "payee": {
            "$ref": "#/components/schemas/VrpPayeeDto"
          },
          "limits": {
            "$ref": "#/components/schemas/VrpLimitsDto"
          },
          "valid_from": {
            "type": "string",
            "description": "ISO-8601; defaults to now."
          },
          "expires_at": {
            "type": "string",
            "description": "ISO-8601; at most 3 years ahead."
          },
          "reference": {
            "type": "string",
            "maxLength": 140
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "access_token",
          "account_id",
          "payee",
          "limits",
          "expires_at"
        ]
      },
      "VrpMandateIdDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "mandate_id"
        ]
      },
      "VrpMandateListDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "awaiting_authorization",
              "active",
              "paused",
              "revoked",
              "expired",
              "declined"
            ]
          },
          "user_ref": {
            "type": "string",
            "maxLength": 128
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        }
      },
      "VrpChargeCreateDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          },
          "amount": {
            "type": "number",
            "description": "Variable amount for this charge (major units).",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "UZS",
              "USD",
              "EUR"
            ]
          },
          "reference": {
            "type": "string",
            "maxLength": 140
          },
          "idempotency_key": {
            "type": "string",
            "description": "Required: retries with the same key return the original charge.",
            "maxLength": 128
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "mandate_id",
          "amount",
          "idempotency_key"
        ]
      },
      "VrpChargeListDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "mandate_id"
        ]
      },
      "VrpUserAuthorizeDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          },
          "otp": {
            "type": "string",
            "description": "Sandbox SCA step-up: the mock bank OTP (123456).",
            "pattern": "/^\\d{4,8}$/"
          }
        },
        "required": [
          "mandate_id",
          "otp"
        ]
      },
      "VrpUserMandateDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "mandate_id"
        ]
      },
      "VrpUserChargesDto": {
        "type": "object",
        "properties": {
          "mandate_id": {
            "type": "string",
            "maxLength": 64
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          }
        },
        "required": [
          "mandate_id"
        ]
      },
      "PassportConsentRequestDto": {
        "type": "object",
        "properties": {
          "user_ref": {
            "type": "string",
            "description": "Your reference for the borrower (must have connected accounts).",
            "maxLength": 128
          },
          "purpose": {
            "type": "string",
            "description": "Shown to the user, e.g. \"Consumer loan application #4821\".",
            "maxLength": 200
          },
          "period_months": {
            "type": "number",
            "description": "Months of cash flow to analyse.",
            "enum": [
              3,
              6,
              12
            ]
          },
          "requester_name": {
            "type": "string",
            "description": "Lender name shown to the user (defaults to your organization's display name).",
            "maxLength": 140
          },
          "access_ttl_days": {
            "type": "number",
            "description": "How long access lasts after the user grants it (1–90 days, default 30).",
            "minimum": 1,
            "maximum": 90
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "user_ref",
          "purpose",
          "period_months"
        ]
      },
      "PassportGetDto": {
        "type": "object",
        "properties": {
          "consent_token": {
            "type": "string",
            "description": "The consent_token returned once by /credit_passport/consent/request.",
            "pattern": "/^consent-[a-z]+-[A-Za-z0-9_-]{20,}$/"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "consent_token"
        ]
      },
      "PassportConsentIdDto": {
        "type": "object",
        "properties": {
          "consent_id": {
            "type": "string",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "consent_id"
        ]
      },
      "PassportConsentListDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "granted",
              "denied",
              "revoked",
              "expired"
            ]
          },
          "user_ref": {
            "type": "string",
            "maxLength": 128
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        }
      },
      "PassportUserGrantDto": {
        "type": "object",
        "properties": {
          "consent_id": {
            "type": "string",
            "maxLength": 64
          },
          "otp": {
            "type": "string",
            "description": "Sandbox SCA step-up: the mock bank OTP (123456).",
            "pattern": "/^\\d{4,8}$/"
          }
        },
        "required": [
          "consent_id",
          "otp"
        ]
      },
      "PassportUserConsentDto": {
        "type": "object",
        "properties": {
          "consent_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "consent_id"
        ]
      },
      "PassportUserPreviewDto": {
        "type": "object",
        "properties": {
          "period_months": {
            "type": "number",
            "enum": [
              3,
              6,
              12
            ]
          }
        }
      },
      "InsightsSummaryDto": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "How far back to look (default 90d).",
            "enum": [
              "30d",
              "90d",
              "180d",
              "365d"
            ]
          }
        }
      },
      "AssistantAskDto": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "minLength": 2,
            "maxLength": 500
          },
          "language": {
            "type": "string",
            "description": "Answer language (default en).",
            "enum": [
              "uz",
              "ru",
              "en"
            ]
          }
        },
        "required": [
          "question"
        ]
      },
      "BalancingRuleCreateDto": {
        "type": "object",
        "properties": {
          "target_account_id": {
            "type": "string",
            "description": "Account to protect (X) — one of your linked accounts.",
            "maxLength": 64
          },
          "source_account_id": {
            "type": "string",
            "description": "Donor account (Y).",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "horizon_days": {
            "type": "number",
            "description": "Look-ahead window in days (default 7).",
            "minimum": 1,
            "maximum": 60
          },
          "deadline_date": {
            "type": "string",
            "description": "Optional \"before date D\" (YYYY-MM-DD, inclusive).",
            "pattern": "DATE"
          },
          "target_min_balance": {
            "type": "number",
            "description": "X counts as \"short\" below this balance (major units, default 0).",
            "minimum": 0
          },
          "max_transfer_amount": {
            "type": "number",
            "description": "Never move more than this per shortfall (N, major units).",
            "minimum": 1
          },
          "source_min_balance": {
            "type": "number",
            "description": "Never leave the donor below this (M, major units, default 0).",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "description": "notify = suggest and wait for confirmation; auto = transfer automatically.",
            "enum": [
              "notify",
              "auto"
            ]
          }
        },
        "required": [
          "target_account_id",
          "source_account_id",
          "max_transfer_amount",
          "mode"
        ]
      },
      "BalancingRuleUpdateDto": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "horizon_days": {
            "type": "number",
            "minimum": 1,
            "maximum": 60
          },
          "deadline_date": {
            "type": "string",
            "pattern": "DATE"
          },
          "clear_deadline": {
            "type": "boolean"
          },
          "target_min_balance": {
            "type": "number",
            "minimum": 0
          },
          "max_transfer_amount": {
            "type": "number",
            "minimum": 1
          },
          "source_min_balance": {
            "type": "number",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "enum": [
              "notify",
              "auto"
            ]
          }
        },
        "required": [
          "rule_id"
        ]
      },
      "BalancingRuleIdDto": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "rule_id"
        ]
      },
      "BalancingEvaluateDto": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "maxLength": 64
          },
          "dry_run": {
            "type": "boolean",
            "description": "true = only project and decide; nothing is recorded or moved."
          }
        },
        "required": [
          "rule_id"
        ]
      },
      "BalancingExecutionsListDto": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "maxLength": 64
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          }
        }
      },
      "BalancingExecutionIdDto": {
        "type": "object",
        "properties": {
          "execution_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "execution_id"
        ]
      },
      "BalancingB2BListDto": {
        "type": "object",
        "properties": {
          "user_ref": {
            "type": "string",
            "maxLength": 128
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "deleted"
            ]
          },
          "rule_id": {
            "type": "string",
            "maxLength": 64
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        }
      },
      "BalancingB2BRuleIdDto": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "rule_id"
        ]
      },
      "TreasuryScopedDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        }
      },
      "TreasuryActorDto": {
        "type": "object",
        "properties": {
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        }
      },
      "TreasuryMemberAddDto": {
        "type": "object",
        "properties": {
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "member_ref": {
            "type": "string",
            "pattern": "/^[a-z0-9._-]{2,64}$/"
          },
          "display_name": {
            "type": "string",
            "maxLength": 120
          },
          "role": {
            "type": "string",
            "enum": [
              "director",
              "accountant"
            ]
          }
        },
        "required": [
          "member_ref",
          "display_name",
          "role"
        ]
      },
      "TreasuryMemberUpdateDto": {
        "type": "object",
        "properties": {
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "member_ref": {
            "type": "string",
            "pattern": "/^[a-z0-9._-]{2,64}$/"
          },
          "role": {
            "type": "string",
            "enum": [
              "director",
              "accountant"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          }
        },
        "required": [
          "member_ref"
        ]
      },
      "TreasuryAccountAddDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "account_id": {
            "type": "string",
            "description": "A linked account of your organization (external id).",
            "maxLength": 64
          },
          "label": {
            "type": "string",
            "maxLength": 80
          },
          "priority": {
            "type": "number",
            "description": "Auto-allocation order: lower = used first (1–1000, default 100).",
            "minimum": 1,
            "maximum": 1000
          },
          "min_reserve": {
            "type": "number",
            "description": "Never spend below this balance (major units).",
            "minimum": 0
          }
        },
        "required": [
          "account_id"
        ]
      },
      "TreasuryAccountIdDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "account_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "account_id"
        ]
      },
      "SplitShareDto": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "maxLength": 64
          },
          "amount": {
            "type": "number",
            "description": "Major units — use amounts OR percents for all shares.",
            "minimum": 1
          },
          "percent": {
            "type": "number",
            "maximum": 100,
            "minimum": 1
          }
        },
        "required": [
          "account_id"
        ]
      },
      "SplitAllocationDto": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ]
          },
          "shares": {
            "description": "Required for manual mode (≤ 10 shares).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SplitShareDto"
            }
          }
        },
        "required": [
          "mode"
        ]
      },
      "SplitPreviewDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "total_amount": {
            "type": "number",
            "description": "Major units.",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "UZS",
              "USD",
              "EUR"
            ]
          },
          "allocation": {
            "$ref": "#/components/schemas/SplitAllocationDto"
          }
        },
        "required": [
          "total_amount",
          "allocation"
        ]
      },
      "SplitCounterpartyDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 140
          },
          "account_number": {
            "type": "string",
            "pattern": "/^[0-9A-Za-z]{8,34}$/"
          }
        },
        "required": [
          "name",
          "account_number"
        ]
      },
      "SplitSandboxDto": {
        "type": "object",
        "properties": {
          "fail_part": {
            "type": "number",
            "description": "Part number whose payment fails.",
            "minimum": 1,
            "maximum": 10
          },
          "failure": {
            "type": "string",
            "description": "permanent = fails every attempt; transient = fails once then succeeds.",
            "enum": [
              "permanent",
              "transient"
            ]
          },
          "refuse_return": {
            "type": "boolean",
            "description": "The counterparty refuses the first return (compensation) request."
          }
        }
      },
      "SplitCreateDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "total_amount": {
            "type": "number",
            "description": "Major units.",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "enum": [
              "UZS",
              "USD",
              "EUR"
            ]
          },
          "allocation": {
            "$ref": "#/components/schemas/SplitAllocationDto"
          },
          "counterparty": {
            "$ref": "#/components/schemas/SplitCounterpartyDto"
          },
          "reference": {
            "type": "string",
            "maxLength": 140
          },
          "idempotency_key": {
            "type": "string",
            "description": "Required: a retry with the same key returns the original split.",
            "maxLength": 128
          },
          "sandbox_simulate": {
            "$ref": "#/components/schemas/SplitSandboxDto"
          }
        },
        "required": [
          "total_amount",
          "allocation",
          "counterparty",
          "idempotency_key"
        ]
      },
      "SplitIdDto": {
        "type": "object",
        "properties": {
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "split_id": {
            "type": "string",
            "maxLength": 64
          }
        },
        "required": [
          "split_id"
        ]
      },
      "SplitListDto": {
        "type": "object",
        "properties": {
          "account_ids": {
            "description": "Optional sub-treasury: only these treasury accounts (account_id). Auto allocation and its\nre-allocation use only them, manual shares must be among them, balances and lists only\ncover splits funded from them. Omit to use the whole organisation's treasury.",
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "status": {
            "type": "string",
            "maxLength": 32
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          }
        }
      },
      "TreasuryAuditDto": {
        "type": "object",
        "properties": {
          "actor_ref": {
            "type": "string",
            "description": "Acting member (or header Silkroute-Actor). Director / accountant permissions apply.",
            "maxLength": 64
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 500
          }
        }
      },
      "WorkspaceEnsureDto": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "maxLength": 80
          },
          "user_ref": {
            "type": "string",
            "description": "Your end user who owns the workspace: receives its notifications; their own payments stop under a lockdown.",
            "maxLength": 64
          },
          "reporting_currency": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "SilkrouteScopedDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "TransferCreateDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "from_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "to_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "amount": {
            "type": "number",
            "description": "Major units of the sending entity's currency.",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "purpose": {
            "type": "string",
            "enum": [
              "engineering_payroll",
              "regional_operations",
              "management_fee",
              "services"
            ]
          },
          "idempotency_key": {
            "type": "string",
            "description": "A retry with the same key returns the original transfer.",
            "maxLength": 128
          }
        },
        "required": [
          "workspace_ref",
          "from_entity_id",
          "to_entity_id",
          "amount",
          "idempotency_key"
        ]
      },
      "TransferListDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "LockdownActivateDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "confirm": {
            "type": "string",
            "description": "Must be exactly \"LOCK\" (the word the person typed).",
            "maxLength": 16
          },
          "reason": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "workspace_ref",
          "confirm"
        ]
      },
      "LockdownReleaseDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "challenge_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "otp": {
            "type": "string",
            "description": "Sandbox one-time code (mock re-auth).",
            "pattern": "/^[0-9]{6}$/"
          }
        },
        "required": [
          "workspace_ref",
          "challenge_id",
          "otp"
        ]
      },
      "CardCreateDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "entity_id": {
            "type": "string",
            "description": "The issuing entity; the card currency defaults to its currency.",
            "pattern": "ID_RE"
          },
          "holder_kind": {
            "type": "string",
            "enum": [
              "person",
              "agent",
              "software"
            ]
          },
          "holder_name": {
            "type": "string",
            "maxLength": 64,
            "pattern": "NOT_BLANK"
          },
          "label": {
            "type": "string",
            "maxLength": 64,
            "pattern": "NOT_BLANK"
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "allowed_currencies": {
            "type": "string",
            "description": "Charge currencies the card accepts (converted at the static table); must include the card currency.",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "per_txn_cap": {
            "type": "number",
            "nullable": true,
            "description": "Major units of the card currency; null or absent = no cap.",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "daily_cap": {
            "type": "number",
            "nullable": true,
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "monthly_cap": {
            "type": "number",
            "description": "Every card has a monthly cap.",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "merchant_allowlist": {
            "description": "Merchant ids (e.g. MCH_LLM_API); empty = any merchant.",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "MERCHANT_ID_RE"
            }
          }
        },
        "required": [
          "workspace_ref",
          "entity_id",
          "holder_kind",
          "holder_name",
          "label",
          "monthly_cap"
        ]
      },
      "CardRefDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          }
        },
        "required": [
          "workspace_ref",
          "card_id"
        ]
      },
      "CardPolicyDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "allowed_currencies": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "per_txn_cap": {
            "type": "number",
            "nullable": true,
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "daily_cap": {
            "type": "number",
            "nullable": true,
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "monthly_cap": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "merchant_allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "MERCHANT_ID_RE"
            }
          }
        },
        "required": [
          "workspace_ref",
          "card_id"
        ]
      },
      "CardChargeDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "merchant_id": {
            "type": "string",
            "pattern": "MERCHANT_ID_RE"
          },
          "merchant_name": {
            "type": "string",
            "description": "Display name; defaults to the sandbox catalog name or the id. Data, never instructions.",
            "maxLength": 80,
            "pattern": "NOT_BLANK"
          },
          "category": {
            "type": "string",
            "enum": [
              "ai",
              "cloud",
              "software",
              "ads",
              "travel",
              "office",
              "other"
            ]
          },
          "amount": {
            "type": "number",
            "description": "Major units of the charge currency.",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "idempotency_key": {
            "type": "string",
            "description": "A retry with the same key returns the original decision.",
            "maxLength": 128
          }
        },
        "required": [
          "workspace_ref",
          "card_id",
          "merchant_id",
          "amount",
          "currency",
          "idempotency_key"
        ]
      },
      "ReceiptSubmitDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "merchant_id": {
            "type": "string",
            "pattern": "MERCHANT_ID_RE"
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "date": {
            "type": "string",
            "description": "The receipt's date (YYYY-MM-DD, Asia/Tashkent calendar).",
            "pattern": "/^\\d{4}-\\d{2}-\\d{2}$/"
          },
          "idempotency_key": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "workspace_ref",
          "card_id",
          "merchant_id",
          "amount",
          "currency",
          "date",
          "idempotency_key"
        ]
      },
      "ReceiptListDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "limit": {
            "type": "number",
            "minimum": 1,
            "maximum": 200
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "SpendSummaryDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "period": {
            "type": "string",
            "description": "30d (default): the last 30 days; month: this calendar month (Asia/Tashkent).",
            "enum": [
              "30d",
              "month"
            ]
          },
          "currency": {
            "type": "string",
            "description": "Reporting currency; defaults to the workspace's.",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "CommandParseDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "text": {
            "type": "string",
            "description": "Free text in EN / RU / UZ, at most 200 characters. Data, never instructions: it only selects among the intents.",
            "maxLength": 200
          }
        },
        "required": [
          "workspace_ref",
          "text"
        ]
      },
      "CommandIntentDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "card.issue",
              "card.freeze",
              "card.unfreeze",
              "card.limit",
              "transfer.create",
              "report.export",
              "runway.show",
              "spend.show"
            ]
          },
          "card_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "holder": {
            "type": "string",
            "nullable": true,
            "maxLength": 64
          },
          "label": {
            "type": "string",
            "maxLength": 64,
            "pattern": "NOT_BLANK"
          },
          "holder_kind": {
            "type": "string",
            "enum": [
              "person",
              "agent",
              "software"
            ]
          },
          "period": {
            "type": "string",
            "enum": [
              "charge",
              "day",
              "month"
            ]
          },
          "amount": {
            "type": "number",
            "description": "Major units: the monthly limit (card.issue), the new limit (card.limit) or the transfer amount.",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "UZS",
              "AED",
              "SAR"
            ]
          },
          "from_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "to_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          }
        },
        "required": [
          "type"
        ]
      },
      "CommandExecuteDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "intent": {
            "$ref": "#/components/schemas/CommandIntentDto"
          },
          "idempotency_key": {
            "type": "string",
            "description": "A retry with the same key returns the first result and runs nothing again.",
            "maxLength": 128
          }
        },
        "required": [
          "workspace_ref",
          "intent",
          "idempotency_key"
        ]
      },
      "InvoiceLineDto": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 120,
            "pattern": "NOT_BLANK"
          },
          "quantity": {
            "type": "number",
            "minimum": 1,
            "maximum": 1000
          },
          "unit_price": {
            "type": "number",
            "description": "Major units of the issuing entity's currency.",
            "minimum": 0.01,
            "maximum": 1000000000000
          }
        },
        "required": [
          "description",
          "quantity",
          "unit_price"
        ]
      },
      "ComplianceDocDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "enum": [
              "safe",
              "sda",
              "invoice"
            ]
          },
          "date": {
            "type": "string",
            "pattern": "/^\\d{4}-\\d{2}-\\d{2}$/"
          },
          "investor": {
            "type": "string",
            "maxLength": 80
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "valuation_cap": {
            "type": "number",
            "nullable": true,
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "discount_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 50
          },
          "client_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "developer_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "monthly_fee": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000000000
          },
          "markup_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 30
          },
          "payment_days": {
            "type": "number",
            "minimum": 0,
            "maximum": 120
          },
          "term_months": {
            "type": "number",
            "minimum": 1,
            "maximum": 60
          },
          "number": {
            "type": "string",
            "pattern": "/^[A-Za-z0-9-]{1,24}$/"
          },
          "issuer_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "bill_to_entity_id": {
            "type": "string",
            "pattern": "ID_RE"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceLineDto"
            }
          }
        },
        "required": [
          "workspace_ref",
          "kind"
        ]
      },
      "BridgeRefDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "connector_id": {
            "type": "string",
            "enum": [
              "sandbox_bank_uz",
              "sandbox_ledger",
              "sandbox_payroll",
              "csv_export"
            ]
          }
        },
        "required": [
          "workspace_ref",
          "connector_id"
        ]
      },
      "RunwayScenarioDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "burn_change_pct": {
            "type": "number",
            "description": "% change applied to every entity's monthly burn (revenue unchanged).",
            "minimum": -50,
            "maximum": 100
          },
          "fx_shock_pct": {
            "type": "number",
            "description": "% every non-USD currency weakens against USD (static table).",
            "minimum": -50,
            "maximum": 100
          },
          "funding_delay_months": {
            "type": "number",
            "description": "Months every expected round arrives late.",
            "minimum": 0,
            "maximum": 24
          }
        },
        "required": [
          "workspace_ref"
        ]
      },
      "RunwayScenarioSaveDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "burn_change_pct": {
            "type": "number",
            "description": "% change applied to every entity's monthly burn (revenue unchanged).",
            "minimum": -50,
            "maximum": 100
          },
          "fx_shock_pct": {
            "type": "number",
            "description": "% every non-USD currency weakens against USD (static table).",
            "minimum": -50,
            "maximum": 100
          },
          "funding_delay_months": {
            "type": "number",
            "description": "Months every expected round arrives late.",
            "minimum": 0,
            "maximum": 24
          },
          "name": {
            "type": "string",
            "maxLength": 40,
            "pattern": "NOT_BLANK"
          }
        },
        "required": [
          "workspace_ref",
          "name"
        ]
      },
      "RunwayScenarioRefDto": {
        "type": "object",
        "properties": {
          "workspace_ref": {
            "type": "string",
            "description": "Your reference for the company group (lowercase letters, digits, . _ -).",
            "pattern": "REF_RE"
          },
          "client_id": {
            "type": "string",
            "description": "Alternative to the Silkroute-Client-Id header.",
            "maxLength": 64
          },
          "secret": {
            "type": "string",
            "description": "Alternative to the Silkroute-Secret header.",
            "maxLength": 200
          },
          "scenario_id": {
            "type": "string",
            "pattern": "ID_RE"
          }
        },
        "required": [
          "workspace_ref",
          "scenario_id"
        ]
      }
    }
  }
}
