{"openapi":"3.1.0","info":{"title":"Motif API","description":"Motif API provides programmatic access to the Motif platform.\n\n## Authentication\n\n### API Key Authentication (for SDK/M2M)\nInclude your API key in the `x-api-key` header:\n```\nx-api-key: your_api_key_here\n```\n\n**Important:** API keys MUST be created via the Admin Panel to work with SDK endpoints.\nKeys created outside the admin panel will not be associated with an organization and will fail authentication.\n\nThe API key system uses a two-table architecture:\n- **Apikey** (Better Auth) - stores the key hash and rate limits\n- **OrganizationApiKey** (linking table) - associates keys with organizations\n\nOnly keys with both records will work with SDK endpoints (`/api/v1/sdk/*`).\n\n## Rate Limits\n\nAPI requests are rate limited per organization. Contact support for higher limits.","version":"1.0.0"},"servers":[{"url":"https://staging.backend.motifapp.ai/api"}],"tags":[{"name":"sdk"},{"name":"admin"},{"name":"app"}],"externalDocs":{"url":"https://staging.backend.motifapp.ai/api/docs"},"paths":{"/user":{"get":{"operationId":"user-getUser","summary":"Get user profile","description":"Retrieve the authenticated user profile","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"type":["string","null"]},"userType":{"default":"REGULAR","type":"string","enum":["REGULAR","INSTITUTIONAL_CLIENT_NO_LOGIN"]},"twoFactorEnabled":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastLogin":{"type":"string"},"softDeletedAt":{"type":["string","null"]},"publicId":{"type":["string","null"]},"picture":{"type":["string","null"]},"isVerified":{"type":"boolean"},"isAmlApproved":{"type":"boolean"},"currentRewardPoints":{"type":"number"},"currentOnboardingStep":{"type":"number"},"walletSetId":{"type":["string","null"]},"pushToken":{"type":["string","null"]},"allowPushNotifications":{"type":"boolean"},"allowAppTracking":{"type":"boolean"},"isInternalUser":{"type":"boolean"}},"required":["id","name","email","emailVerified","image","userType","twoFactorEnabled","createdAt","updatedAt","lastLogin","softDeletedAt","publicId","picture","isVerified","isAmlApproved","currentRewardPoints","currentOnboardingStep","walletSetId","pushToken","allowPushNotifications","allowAppTracking"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"user-updateUser","summary":"Update user profile","description":"Update user profile information","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/user/profile":{"get":{"operationId":"userProfile-getUserProfile","summary":"Get user profile","description":"Retrieve complete user profile with profiling data","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"profileTitle":{"type":["string","null"]},"profileDescription":{"type":["string","null"]},"profilingAnswers":{"anyOf":[{"anyOf":[{},{"type":"null"}]},{"type":"null"}]},"basicProfile":{"anyOf":[{"anyOf":[{},{"type":"null"}]},{"type":"null"}]},"advancedProfile":{"anyOf":[{"anyOf":[{},{"type":"null"}]},{"type":"null"}]},"profileObservations":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"source":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage","KYC"]}},"required":["description","source"],"additionalProperties":false}},{"type":"null"}]},"investorProfileSpider":{"anyOf":[{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false},{"type":"null"}]},"profileStrengthLevel":{"type":["string","null"]},"investorSummary":{"type":["string","null"]},"investorProfileLastComputed":{"type":["string","null"]},"enabledInstrumentClasses":{"type":"array","items":{"type":"string","enum":["TOKEN","EQUITY"]}},"marketPositions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"questionId":{"type":"string"},"userProbabilityBps":{"type":"number"},"marketProbabilityBpsAtEntry":{"type":["number","null"]},"status":{"type":"string"}},"required":["id","questionId","userProbabilityBps","marketProbabilityBpsAtEntry","status"],"additionalProperties":{}}}},"required":["id","memberId","createdAt","updatedAt","profileTitle","profileDescription","profilingAnswers","basicProfile","advancedProfile","profileObservations","investorProfileSpider","profileStrengthLevel","investorSummary","investorProfileLastComputed","enabledInstrumentClasses","marketPositions"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/user/investor-profile/compute":{"post":{"operationId":"userProfile-computeInvestorProfile","summary":"Compute investor profile","description":"Recalculate investor profile with weighted analysis","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"profile":{"type":"object","properties":{"spiderChart":{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false},"strengthLevel":{"anyOf":[{"type":"string","enum":["Basic","Growing","Advanced","Strong","Complete"]},{"type":"null"}]},"summary":{"type":["string","null"]},"lastComputed":{"type":"string"}},"required":["spiderChart","strengthLevel","summary","lastComputed"],"additionalProperties":false}},"required":["success","profile"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/user/investor-profile":{"get":{"operationId":"userProfile-getInvestorProfile","summary":"Get investor profile","description":"Retrieve existing investor profile analysis","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"spiderChart":{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false},"strengthLevel":{"anyOf":[{"type":"string","enum":["Basic","Growing","Advanced","Strong","Complete"]},{"type":"null"}]},"summary":{"type":["string","null"]},"lastComputed":{"type":"string"}},"required":["spiderChart","strengthLevel","summary","lastComputed"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/wallet/wallets":{"get":{"operationId":"wallet-getWallets","summary":"Get user wallets","description":"Retrieve all wallets for the authenticated user","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"address":{"type":"string"},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","networkType","blockchain","address","memberId","createdAt","updatedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/wallet/balance/{walletId}":{"get":{"operationId":"wallet-getBalanceByWalletId","summary":"Get wallet balance by ID","description":"Retrieve the aggregated USD balance for a specific wallet","tags":["app"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"walletId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"walletId":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"totalUsdValue":{"type":"string"}},"required":["totalUsdValue"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/market-data/historical":{"get":{"operationId":"marketData-getHistoricalMarketData","summary":"Get historical market data","description":"Retrieve historical market data for a token with specified resolution","tags":["app"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"tokenId","schema":{"type":"number"},"required":true},{"in":"query","name":"resolution","schema":{"type":"string"},"required":true},{"in":"query","name":"from","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},{"in":"query","name":"to","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"priceRaw":{"type":"string"},"timestamp":{"type":"string"}},"required":["priceRaw","timestamp"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/market-data/latest":{"get":{"operationId":"marketData-getLatestMarketData","summary":"Get latest market data","description":"Retrieve the latest market data for a token","tags":["app"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"tokenId","schema":{"type":"number"},"required":true},{"in":"query","name":"resolution","schema":{"type":"string","enum":["AD_HOC","FIVE_MIN","FIFTEEN_MIN","ONE_HOUR","ONE_DAY","SEVEN_DAYS"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","const":"COINMARKETCAP"},"tokenId":{"type":"number"},"equityId":{"type":"null"},"resolution":{"type":"string","enum":["AD_HOC","FIVE_MIN","FIFTEEN_MIN","ONE_HOUR","ONE_DAY","SEVEN_DAYS"]},"timestamp":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"},"marketCap":{"type":"string"},"latest":{"type":"boolean"}},"required":["provider","tokenId","equityId","resolution","timestamp","close","volume","marketCap","latest"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/transfer":{"post":{"operationId":"tx-createTransferOrder","summary":"Create transfer order","description":"Create a wallet-to-wallet transfer order","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"toolId":{"type":"string"},"tokenId":{"type":"number"},"amount":{"type":"string"},"recipientAddress":{"type":"string"},"recipientEmail":{"type":"string"},"originalOrderId":{"type":"string"}},"required":["tokenId","amount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"metadata":{"anyOf":[{"type":"object","properties":{"originalOrderId":{"type":"string"},"token":{"type":"object","properties":{"fromToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}},"toToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}}},"additionalProperties":{}},"amount":{"type":"object","properties":{"fromTokenAmount":{"type":"string"},"fromUsdAmount":{"type":"string"},"toTokenAmount":{"type":"string"},"toUsdAmount":{"type":"string"}},"additionalProperties":{}},"senderAddress":{"type":"string"},"recipientAddress":{"type":"string"},"routeId":{"type":"number"},"blockchain":{"type":"string"},"strategyExecutionId":{"type":"string"},"allocationId":{"type":"string"},"quoteId":{"type":"string"},"paymentMethod":{"type":"string"},"isLiquidation":{"type":"boolean"},"isPartialSell":{"type":"boolean"},"sourceTokenId":{"type":"number"},"sourceAmount":{"type":"string"},"tokenId":{"type":"number"},"circleId":{"type":["string","null"]},"expectedAmount":{"type":"string"},"expectedOutput":{"type":"string"},"fromAmount":{"type":"string"},"percentage":{"type":"number"}},"additionalProperties":{}},{"type":"null"}]},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"retryExpiresAt":{"type":["string","null"]},"retryCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retryReason":{"type":["string","null"]},"isRetry":{"type":"boolean"},"originalOrderId":{"type":["string","null"]},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","type","metadata","networkFeeInUSD","motifFeeInUsd","retryExpiresAt","retryCount","retryReason","isRetry","originalOrderId","memberId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/deposit":{"post":{"operationId":"tx-createDepositOrder","summary":"Create deposit order","description":"Create a deposit order","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"toolId":{"type":"string"}},"required":["toolId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"metadata":{"anyOf":[{"type":"object","properties":{"originalOrderId":{"type":"string"},"token":{"type":"object","properties":{"fromToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}},"toToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}}},"additionalProperties":{}},"amount":{"type":"object","properties":{"fromTokenAmount":{"type":"string"},"fromUsdAmount":{"type":"string"},"toTokenAmount":{"type":"string"},"toUsdAmount":{"type":"string"}},"additionalProperties":{}},"senderAddress":{"type":"string"},"recipientAddress":{"type":"string"},"routeId":{"type":"number"},"blockchain":{"type":"string"},"strategyExecutionId":{"type":"string"},"allocationId":{"type":"string"},"quoteId":{"type":"string"},"paymentMethod":{"type":"string"},"isLiquidation":{"type":"boolean"},"isPartialSell":{"type":"boolean"},"sourceTokenId":{"type":"number"},"sourceAmount":{"type":"string"},"tokenId":{"type":"number"},"circleId":{"type":["string","null"]},"expectedAmount":{"type":"string"},"expectedOutput":{"type":"string"},"fromAmount":{"type":"string"},"percentage":{"type":"number"}},"additionalProperties":{}},{"type":"null"}]},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"retryExpiresAt":{"type":["string","null"]},"retryCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retryReason":{"type":["string","null"]},"isRetry":{"type":"boolean"},"originalOrderId":{"type":["string","null"]},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","type","metadata","networkFeeInUSD","motifFeeInUsd","retryExpiresAt","retryCount","retryReason","isRetry","originalOrderId","memberId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/swap-route":{"get":{"operationId":"tx-getRecommendedSwapRoute","summary":"Get recommended swap route","description":"Get the optimal swap route for a token swap","tags":["app"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"fromTokenId","schema":{"type":"number"},"required":true},{"in":"query","name":"fromAmount","schema":{"type":"string"},"required":true},{"in":"query","name":"toTokenId","schema":{"type":"number"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"object","properties":{"id":{"type":"number"},"provider":{"type":"string","enum":["COINMARKETCAP","LIFI","TIINGO","JUPITER"]},"fromBlockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"fromChainId":{"type":"number"},"fromTokenAddress":{"type":"string"},"fromAmount":{"type":"string"},"fromAmountHumanReadable":{"type":"string"},"fromAmountUSD":{"type":"string"},"fromTokenSymbol":{"type":"string"},"toBlockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"toChainId":{"type":"number"},"toTokenAddress":{"type":"string"},"toAmount":{"type":"string"},"toAmountHumanReadable":{"type":"string"},"toAmountUSD":{"type":"string"},"toTokenSymbol":{"type":"string"},"message":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","provider","fromBlockchain","fromChainId","fromTokenAddress","fromAmount","fromAmountHumanReadable","fromAmountUSD","fromTokenSymbol","toBlockchain","toChainId","toTokenAddress","toAmount","toAmountHumanReadable","toAmountUSD","toTokenSymbol","message","tags"],"additionalProperties":{}},"estimate":{}},"required":["quote","estimate"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/swap":{"post":{"operationId":"tx-createSwapOrder","summary":"Create swap order","description":"Create a token swap order","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"toolId":{"type":"string"},"routeId":{"type":"number"},"originalOrderId":{"type":"string"}},"required":["routeId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"metadata":{"anyOf":[{"type":"object","properties":{"originalOrderId":{"type":"string"},"token":{"type":"object","properties":{"fromToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}},"toToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}}},"additionalProperties":{}},"amount":{"type":"object","properties":{"fromTokenAmount":{"type":"string"},"fromUsdAmount":{"type":"string"},"toTokenAmount":{"type":"string"},"toUsdAmount":{"type":"string"}},"additionalProperties":{}},"senderAddress":{"type":"string"},"recipientAddress":{"type":"string"},"routeId":{"type":"number"},"blockchain":{"type":"string"},"strategyExecutionId":{"type":"string"},"allocationId":{"type":"string"},"quoteId":{"type":"string"},"paymentMethod":{"type":"string"},"isLiquidation":{"type":"boolean"},"isPartialSell":{"type":"boolean"},"sourceTokenId":{"type":"number"},"sourceAmount":{"type":"string"},"tokenId":{"type":"number"},"circleId":{"type":["string","null"]},"expectedAmount":{"type":"string"},"expectedOutput":{"type":"string"},"fromAmount":{"type":"string"},"percentage":{"type":"number"}},"additionalProperties":{}},{"type":"null"}]},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"retryExpiresAt":{"type":["string","null"]},"retryCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retryReason":{"type":["string","null"]},"isRetry":{"type":"boolean"},"originalOrderId":{"type":["string","null"]},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","type","metadata","networkFeeInUSD","motifFeeInUsd","retryExpiresAt","retryCount","retryReason","isRetry","originalOrderId","memberId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/orders/{orderId}":{"get":{"operationId":"tx-getOrder","summary":"Get order","description":"Retrieve details of a specific order","tags":["app"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"orderId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"metadata":{"anyOf":[{"type":"object","properties":{"originalOrderId":{"type":"string"},"token":{"type":"object","properties":{"fromToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}},"toToken":{"type":"object","properties":{"address":{"type":"string"},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]},"chainId":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"symbol":{"type":"string"},"name":{"type":"string"},"logo":{"type":["string","null"]},"circleId":{"type":["string","null"]},"coinmarketCapId":{"type":["string","null"]},"isBuyable":{"default":true,"type":"boolean"},"description":{"type":"string"},"networkType":{"type":"string","enum":["OTHER","EVM","SOL","BTC","NEAR"]}},"required":["address","blockchain","chainId","decimals","id","symbol"],"additionalProperties":{}}},"additionalProperties":{}},"amount":{"type":"object","properties":{"fromTokenAmount":{"type":"string"},"fromUsdAmount":{"type":"string"},"toTokenAmount":{"type":"string"},"toUsdAmount":{"type":"string"}},"additionalProperties":{}},"senderAddress":{"type":"string"},"recipientAddress":{"type":"string"},"routeId":{"type":"number"},"blockchain":{"type":"string"},"strategyExecutionId":{"type":"string"},"allocationId":{"type":"string"},"quoteId":{"type":"string"},"paymentMethod":{"type":"string"},"isLiquidation":{"type":"boolean"},"isPartialSell":{"type":"boolean"},"sourceTokenId":{"type":"number"},"sourceAmount":{"type":"string"},"tokenId":{"type":"number"},"circleId":{"type":["string","null"]},"expectedAmount":{"type":"string"},"expectedOutput":{"type":"string"},"fromAmount":{"type":"string"},"percentage":{"type":"number"}},"additionalProperties":{}},{"type":"null"}]},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"retryExpiresAt":{"type":["string","null"]},"retryCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retryReason":{"type":["string","null"]},"isRetry":{"type":"boolean"},"originalOrderId":{"type":["string","null"]},"memberId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"stepIndex":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"metadata":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tx":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["TRANSFER","DEPOSIT","TRANSFER_IN","SWAP","SWAP_DEPOSIT","STAKE_USDE","STAKE_SWAP","STAKE_SWAP_DEPOSIT","STAKE_USDE_DEPOSIT","UNSTAKE_USDE","UNSTAKE_USDE_DEPOSIT","UNSTAKE_SWAP","UNSTAKE_SWAP_DEPOSIT","BUY_INDEX","STRATEGY_EXECUTION_SWAP","STRATEGY_EXECUTION_SWAP_DEPOSIT","SELL_INDEX","STRATEGY_LIQUIDATION_SWAP","STRATEGY_LIQUIDATION_SWAP_DEPOSIT","STRATEGY_PARTIAL_SELL_SWAP"]},"status":{"default":"CREATED","type":"string","enum":["CREATED","PENDING","EXECUTING","SUCCESS","FAILED","CANCELLED"]},"stepId":{"type":["string","null"]},"idempotencyKey":{"type":["string","null"]},"circleId":{"type":["string","null"]},"refId":{"type":["string","null"]},"txHash":{"type":["string","null"]},"networkFee":{"type":["string","null"]},"networkFeeInUSD":{"type":["string","null"]},"strategyExecutionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","status","stepId","idempotencyKey","circleId","refId","txHash","networkFee","networkFeeInUSD","strategyExecutionId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["id","orderId","type","status","stepIndex","metadata","createdAt","updatedAt","tx"],"additionalProperties":false}}},"required":["id","status","type","metadata","networkFeeInUSD","motifFeeInUsd","retryExpiresAt","retryCount","retryReason","isRetry","originalOrderId","memberId","createdAt","updatedAt","steps"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/strategy/execute":{"post":{"operationId":"tx-createStrategyExecutionOrder","summary":"Create strategy execution order","description":"Create an order to execute investment strategy","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sourceTokenId":{"type":"number"},"sourceAmount":{"type":"string"}},"required":["sourceAmount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"executionId":{"type":"string"},"depositOrderId":{"type":"string"}},"required":["executionId","depositOrderId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/tx/strategy/execute-from-quote":{"post":{"operationId":"tx-executeStrategyFromQuote","summary":"Execute strategy from quote","description":"Execute investment strategy from a previously generated quote","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quoteId":{"type":"string"}},"required":["quoteId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"executionId":{"type":"string"},"swapOrderIds":{"type":"array","items":{"type":"string"}}},"required":["executionId","swapOrderIds"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/invest/strategy":{"post":{"operationId":"invest-createPersonalInvestmentStrategy","summary":"Create investment strategy","description":"Create or regenerate personal investment strategy","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"assumptions":{"type":"array","items":{"type":"string"}},"equityAllocations":{"type":"array","items":{"type":"object","properties":{"equityId":{"type":"number"},"percentage":{"type":"number"}},"required":["equityId","percentage"],"additionalProperties":false}},"highlights":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"title":{"type":"string"}},"required":["description","title"],"additionalProperties":false}},"plan":{"type":"array","items":{"type":"string"}},"reasoning":{"type":"string"},"score":{"type":"number"},"strategy":{"type":"string"},"title":{"type":"string"},"tokenAllocations":{"type":"array","items":{"type":"object","properties":{"percentage":{"type":"number"},"tokenId":{"type":"number"}},"required":["percentage","tokenId"],"additionalProperties":false}},"buckets":{"type":"null"}},"required":["assumptions","equityAllocations","highlights","plan","reasoning","score","strategy","title","tokenAllocations","buckets"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"invest-getPersonalInvestmentStrategy","summary":"Get investment strategy","description":"Retrieve current personal investment strategy","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"strategy":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}},"highlights":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"required":["title","description"],"additionalProperties":false}},"plan":{"type":"array","items":{"type":"string"}},"reasoning":{"type":["string","null"]},"score":{"type":["number","null"]},"state":{"type":"string","enum":["DRAFT","PROPOSED","APPROVED","IMPLEMENTING","ACTIVE","ARCHIVED"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"targetAllocations":{"type":"array","items":{"type":"object","properties":{"tokenId":{"type":"number"},"percentage":{"type":"number"},"token":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false}},"required":["tokenId","percentage","token"],"additionalProperties":false}},"buckets":{"type":"array","items":{"type":"object","properties":{"displayName":{"type":"string"},"description":{"type":"string"},"bucketColor":{"type":"string"},"bgColor":{"type":"string"},"totalPercentage":{"type":"number"},"tokens":{"type":"array","items":{"type":"object","properties":{"tokenId":{"type":"number"},"name":{"type":"string"},"percentage":{"type":"number"},"token":{"type":"object","properties":{"name":{"type":"string"},"symbol":{"type":"string"},"logo":{"type":["string","null"]},"blockchain":{"type":"string","enum":["ADA","ALGO","APT","ATOM","AVAX","BCH","BSC","BSV","BTC","CANTON","CRO","DASH","DOGE","DOT","ETC","FIL","FLR","GTCHAIN","HBAR","HYPE","ICP","INJ","KAS","KCC","LTC","MANTLE","MEMECORE","NEAR","PI","SEI","SUI","TAO","TON","TRON","VET","WORLDCHAIN","XDC","XLAYER","XLM","XMR","XRP","ZEC","ETH","MATIC","POLYGON","SOL","ARB","UNI","BASE","OP"]}},"required":["name","symbol","logo","blockchain"],"additionalProperties":false}},"required":["tokenId","name","percentage","token"],"additionalProperties":false}}},"required":["displayName","description","bucketColor","bgColor","totalPercentage","tokens"],"additionalProperties":false}}},"required":["id","title","strategy","assumptions","highlights","plan","reasoning","score","state","createdAt","updatedAt","targetAllocations","buckets"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/invest/strategy/recreate":{"post":{"operationId":"invest-recreatePersonalInvestmentStrategy","summary":"Recreate investment strategy","description":"Force recreate personal investment strategy","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"assumptions":{"type":"array","items":{"type":"string"}},"equityAllocations":{"type":"array","items":{"type":"object","properties":{"equityId":{"type":"number"},"percentage":{"type":"number"}},"required":["equityId","percentage"],"additionalProperties":false}},"highlights":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"title":{"type":"string"}},"required":["description","title"],"additionalProperties":false}},"plan":{"type":"array","items":{"type":"string"}},"reasoning":{"type":"string"},"score":{"type":"number"},"strategy":{"type":"string"},"title":{"type":"string"},"tokenAllocations":{"type":"array","items":{"type":"object","properties":{"percentage":{"type":"number"},"tokenId":{"type":"number"}},"required":["percentage","tokenId"],"additionalProperties":false}},"buckets":{"type":"null"}},"required":["assumptions","equityAllocations","highlights","plan","reasoning","score","strategy","title","tokenAllocations","buckets"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/rewards/history":{"get":{"operationId":"rewards-getUserRewardsHistory","summary":"Get user rewards history","description":"Retrieve historical reward transactions for the user","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reward":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"number"},"createdAt":{"type":"string"},"description":{"type":["string","null"]},"updatedAt":{"type":"string"},"points":{"type":"number"},"isRepeatable":{"type":"boolean"},"displayOrder":{"type":"number"}},"required":["name","id","createdAt","description","updatedAt","points","isRepeatable","displayOrder"],"additionalProperties":false},"id":{"type":"string"},"memberId":{"type":"string"},"points":{"type":"number"},"rewardId":{"type":"number"},"completedAt":{"type":"string"}},"required":["reward","id","memberId","points","rewardId","completedAt"],"additionalProperties":false}},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/rewards/points":{"get":{"operationId":"rewards-getUserRewardPoints","summary":"Get user reward points","description":"Retrieve current reward points balance for the user","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"number"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/rewards/leaderboard":{"get":{"operationId":"rewards-getRewardsLeaderboard","summary":"Get rewards leaderboard","description":"Retrieve the rewards leaderboard","tags":["app"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"leaderboard":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"currentRewardPoints":{"type":"number"},"picture":{"type":["string","null"]},"lastWeekPoints":{"type":"number"}},"required":["id","name","currentRewardPoints","picture","lastWeekPoints"],"additionalProperties":false}},"surroundingUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"currentRewardPoints":{"type":"number"},"picture":{"type":["string","null"]},"lastWeekPoints":{"type":"number"},"rank":{"type":"number"}},"required":["id","name","currentRewardPoints","picture","lastWeekPoints","rank"],"additionalProperties":false}},"currentUser":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"currentRewardPoints":{"type":"number"},"lastWeekPoints":{"type":"number"},"leaderboardRank":{"type":["number","null"]},"picture":{"type":["string","null"]}},"required":["id","name","currentRewardPoints","lastWeekPoints","leaderboardRank","picture"],"additionalProperties":false},"isMemberInLeaderboard":{"type":"boolean"}},"required":["leaderboard","surroundingUsers","currentUser","isMemberInLeaderboard"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/push-notifications/broadcast":{"post":{"operationId":"admin-broadcastPushNotification","summary":"Broadcast push notification","description":"Sends a push notification to all users who have enabled push notifications.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"}},"required":["title","body"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sentCount":{"type":"number"}},"required":["success","sentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations":{"get":{"operationId":"adminOrganization-list","summary":"List user organizations","description":"Returns all organizations the user is a member of.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"},"isPendingReview":{"type":"boolean"}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked","isPendingReview"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"adminOrganization-create","summary":"Create a new organization","description":"Creates a new organization. The creating user becomes the owner.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"},"sandboxOrgId":{"type":"string"}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked","sandboxOrgId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{id}":{"get":{"operationId":"adminOrganization-get","summary":"Get organization by ID","description":"Returns a single organization. API key must belong to this organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"},"UserProfileAdvancedOptions":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"],"additionalProperties":false}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked","UserProfileAdvancedOptions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminOrganization-update","summary":"Update organization","description":"Updates an organization. Requires admin access to the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"questionOptions":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"},"UserProfileAdvancedOptions":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"],"additionalProperties":false}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked","UserProfileAdvancedOptions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"adminOrganization-delete","summary":"Delete organization","description":"Deletes an organization. Requires org owner access. Cannot delete the default Motif organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/slug/{slug}":{"get":{"operationId":"adminOrganization-getBySlug","summary":"Get organization by slug","description":"Returns a single organization by slug. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"slug","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"},"UserProfileAdvancedOptions":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"],"additionalProperties":false}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked","UserProfileAdvancedOptions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/invites":{"post":{"operationId":"adminOrganization-inviteOrgAdmin","summary":"Invite org admin","description":"Invites an admin to the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emailAddress":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"default":"SAAS_ORGANIZATION_ADMIN","type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"required":["emailAddress"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"emailAddress":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"status":{"type":"string"}},"required":["id","emailAddress","roles","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/invitations":{"get":{"operationId":"adminOrganization-listInvitations","summary":"List organization invitations","description":"Returns invitations for the organization, newest first, optionally narrowed to a single status.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","accepted","expired"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"inviterId":{"type":"string"}},"required":["id","email","roles","status","expiresAt","createdAt","inviterId"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/invitations/{id}/resend":{"post":{"operationId":"adminOrganization-resendInvitation","summary":"Resend invitation","description":"Resends a pending invitation email.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/invitations/{id}":{"delete":{"operationId":"adminOrganization-cancelInvitation","summary":"Cancel invitation","description":"Cancels a pending invitation.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{id}/status":{"patch":{"operationId":"adminOrganization-updateStatus","summary":"Update organization status","description":"Updates an organization status. Requires org owner access. Triggers session/API key revocation on suspend or deactivate.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]}},"required":["status"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logo":{"type":["string","null"]},"createdAt":{"type":"string"},"metadata":{"type":["string","null"]},"status":{"default":"PENDING","type":"string","enum":["PENDING","ACTIVE","SUSPENDED","REJECTED","DEACTIVATED","OFFBOARDED"]},"suspendedAt":{"type":["string","null"]},"deactivatedAt":{"type":["string","null"]},"offboardedAt":{"type":["string","null"]},"parentOrgId":{"type":["string","null"]},"isLocked":{"type":"boolean"}},"required":["id","name","slug","logo","createdAt","metadata","status","suspendedAt","deactivatedAt","offboardedAt","parentOrgId","isLocked"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/me/membership":{"get":{"operationId":"adminUser-getMyMembership","summary":"Get my membership","description":"Returns the current user membership and roles in the active organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"organizationId","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"orgAccess":{"type":"object","properties":{"isPendingReview":{"type":"boolean"},"isSandbox":{"type":"boolean"},"rootOrganizationId":{"type":"string"},"isMotifStaff":{"type":"boolean"}},"required":["isPendingReview","isSandbox","rootOrganizationId","isMotifStaff"],"additionalProperties":false}},"required":["id","roles","orgAccess"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/users":{"get":{"operationId":"adminUser-listByOrganization","summary":"List users in organization","description":"Returns all users belonging to an organization. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","email","name","image","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["users","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/users/{id}":{"get":{"operationId":"adminUser-get","summary":"Get user by ID","description":"Returns a single user. Requires org admin access and user must be in same organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"createdAt":{"type":"string"}},"required":["id","userId","organizationId","roles","createdAt"],"additionalProperties":false}}},"required":["id","email","name","image","createdAt","updatedAt","members"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/users/assign":{"post":{"operationId":"adminUser-assign","summary":"Assign user to organization","description":"Assigns a user to an organization. Requires org owner access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"organizationId":{"type":"string"}},"required":["userId","organizationId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","email","name","image","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/members/{userId}/role":{"patch":{"operationId":"adminUser-updateMemberRole","summary":"Update member role","description":"Updates a member role in the organization. Requires org owner access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true},{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"required":["role"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"createdAt":{"type":"string"}},"required":["id","userId","organizationId","roles","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/members/{userId}":{"delete":{"operationId":"adminUser-removeMember","summary":"Remove member from organization","description":"Removes a member from the organization. Requires org owner access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true},{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/members":{"get":{"operationId":"adminUser-listMembers","summary":"List organization members","description":"Returns all members of an organization with their roles.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"roles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"image":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","email","name","image","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","userId","organizationId","roles","createdAt","user"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/me":{"get":{"operationId":"adminUser-getMyProfile","summary":"Get my profile","description":"Returns the current authenticated user profile.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"image":{"type":["string","null"]},"emailVerified":{"type":"boolean"},"twoFactorEnabled":{"type":["boolean","null"]},"createdAt":{"type":"string"},"hasPassword":{"type":"boolean"},"authenticationMethods":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"createdAt":{"type":"string"},"hasPassword":{"type":"boolean"}},"required":["providerId","createdAt","hasPassword"],"additionalProperties":false}}},"required":["id","name","email","image","emailVerified","twoFactorEnabled","createdAt","hasPassword","authenticationMethods"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminUser-updateMyProfile","summary":"Update my profile","description":"Updates the current authenticated user profile.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"image":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config":{"get":{"operationId":"adminConfig-get","summary":"Get organization configuration","description":"Returns the configuration for an organization. Creates default config if none exists.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/config/conviction-sync-defaults":{"get":{"operationId":"adminConfig-getConvictionSyncDefaults","summary":"Get default conviction sync configuration","description":"Returns the default conviction sync configuration values (keywords, sources, limits).","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvictionSyncConfigOutput"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/transaction":{"patch":{"operationId":"adminConfig-updateTransactionConfig","summary":"Update transaction configuration","description":"Sets transaction configuration for an organization. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/TransactionConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/investment":{"patch":{"operationId":"adminConfig-updateInvestmentConfig","summary":"Update investment configuration","description":"Sets investment configuration for an organization. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/InvestmentConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/profile-options":{"patch":{"operationId":"adminConfig-updateProfileOptions","summary":"Update profile options","description":"Updates user profile options (interests, include/exclude lists) for an organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"options":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"]}},"required":["options"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/profiling-formula":{"patch":{"operationId":"adminConfig-updateProfilingFormulaConfig","summary":"Update profiling formula configuration","description":"Sets the spider chart formula configuration for an organization. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ProfilingFormulaConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/profiling-summary":{"patch":{"operationId":"adminConfig-updateProfilingSummaryConfig","summary":"Update profiling summary configuration","description":"Sets the AI summary prompt configuration for an organization. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ProfilingSummaryConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/language":{"patch":{"operationId":"adminConfig-updateLanguageConfig","summary":"Update language configuration","description":"Sets the default language and supported languages for questionnaires.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"defaultLanguage":{"type":"string","minLength":2,"maxLength":5},"supportedLanguages":{"minItems":1,"type":"array","items":{"type":"string","minLength":2,"maxLength":5}}},"required":["defaultLanguage","supportedLanguages"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/conviction-sync":{"patch":{"operationId":"adminConfig-updateConvictionSyncConfig","summary":"Update conviction sync configuration","description":"Sets conviction sync configuration (sources, keywords, limits) for an organization. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/ConvictionSyncConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/config/perigon-ingestion":{"get":{"operationId":"adminConfig-getPerigonIngestionConfig","summary":"Get Perigon ingestion configuration","description":"Returns the global Perigon ingestion settings and available options. Restricted to Motif org members.","tags":["admin"],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/PerigonIngestionConfigOutput"},"availableTopics":{"type":"array","items":{"type":"string"}},"availableCategories":{"type":"array","items":{"type":"string"}}},"required":["config","availableTopics","availableCategories"],"additionalProperties":false}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminConfig-updatePerigonIngestionConfig","summary":"Update Perigon ingestion configuration","description":"Updates the global Perigon ingestion configuration. Restricted to Motif org members.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/PerigonIngestionConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerigonIngestionConfigOutput"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/reset":{"post":{"operationId":"adminConfig-resetToDefaults","summary":"Reset configuration to defaults","description":"Resets all organization configuration to default values. This cannot be undone.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resetTransaction":{"default":true,"type":"boolean"},"resetInvestment":{"default":true,"type":"boolean"},"resetProfilingFormula":{"default":false,"type":"boolean"},"resetProfilingSummary":{"default":false,"type":"boolean"},"resetConvictionSync":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationConfig"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/auto-assign":{"get":{"operationId":"adminConfig-getAutoAssignConfig","summary":"Get auto-assign configuration","description":"Returns the domain auto-assignment configuration for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"autoAssignDomain":{"type":["string","null"]},"autoAssignEnabled":{"type":"boolean"},"autoAssignRoles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}}},"required":["autoAssignDomain","autoAssignEnabled","autoAssignRoles"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminConfig-updateAutoAssignConfig","summary":"Update auto-assign configuration","description":"Sets domain auto-assignment configuration. Users with matching email domains will be auto-assigned to this organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"autoAssignDomain":{"anyOf":[{"type":"string","maxLength":253},{"type":"null"}]},"autoAssignEnabled":{"type":"boolean"},"autoAssignRoles":{"default":["SAAS_ORGANIZATION_MEMBER"],"minItems":1,"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}}},"required":["autoAssignDomain","autoAssignEnabled"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/time-zone":{"patch":{"operationId":"adminConfig-updateDefaultTimeZone","summary":"Update default time zone","description":"Sets the IANA time zone used to schedule a member's notifications when their own device has never reported one.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"defaultTimeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["defaultTimeZone"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/organizations/{organizationId}/config/questionnaire-progression":{"get":{"operationId":"adminConfig-getQuestionnaireProgression","summary":"Get questionnaire progression configuration","description":"Returns the tier progression order and KYC toggle for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnaireProgressionConfigOutput"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminConfig-updateQuestionnaireProgression","summary":"Update questionnaire progression configuration","description":"Sets the tier progression order and KYC toggle. Replaces entire config section.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"organizationId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/QuestionnaireProgressionConfig"}},"required":["config"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionnaireProgressionConfigOutput"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/profiling-questions":{"get":{"operationId":"adminProfilingQuestions-list","summary":"List profiling questions","description":"Returns all profiling questions for the authenticated user's organization. Questions can be filtered by type (Basic, Advanced, MIFID).","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]}},{"in":"query","name":"includeInactive","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"adminProfilingQuestions-create","summary":"Create profiling question","description":"Creates a new profiling question for the organization. The typeOrder must be unique within the question type.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"typeOrder":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"field":{"type":"string","minLength":1},"fieldDescription":{"type":"string"},"question":{"type":"string","minLength":1},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label","choices"]}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label"]}}},"required":["columns","rows"]},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["options"]},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"]},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"]}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"]},{"type":"null"}]},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["options"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label"]}},{"type":"null"}]}}}},{"type":"null"}]}},"required":["type","typeOrder","field","question","action"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/profiling-questions/{id}":{"get":{"operationId":"adminProfilingQuestions-get","summary":"Get profiling question by ID","description":"Returns a single profiling question. The question must belong to the authenticated organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"adminProfilingQuestions-update","summary":"Update profiling question","description":"Updates an existing profiling question. The question must belong to the authenticated organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"typeOrder":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"field":{"type":"string","minLength":1},"fieldDescription":{"type":["string","null"]},"question":{"type":"string","minLength":1},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label","choices"]}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label"]}}},"required":["columns","rows"]},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["options"]},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"]},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"]}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"]},{"type":"null"}]},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["options"]},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","label"]}},{"type":"null"}]}}}},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"adminProfilingQuestions-delete","summary":"Delete profiling question","description":"Permanently deletes a profiling question. The question must belong to the authenticated organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/profiling-questions/reorder":{"post":{"operationId":"adminProfilingQuestions-reorder","summary":"Reorder profiling questions","description":"Reorders profiling questions within a specific type (Basic, Advanced, or MIFID). Provide an array of question IDs in the desired order.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"questionIds":{"type":"array","items":{"type":"string"}}},"required":["type","questionIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/profiling-questions/reset-to-defaults":{"post":{"operationId":"adminProfilingQuestions-resetToDefaults","summary":"Reset questions to defaults","description":"Resets profiling questions to system defaults. If a type is specified, only questions of that type are reset. Otherwise, all questions are reset.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]},"isMifidRelevant":{"type":"boolean"},"isActive":{"default":true,"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"translations":{"anyOf":[{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"},"additionalProperties":{"type":"object","properties":{"question":{"type":"string"},"fieldDescription":{"type":"string"},"answers":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","properties":{"expiresAt":{"type":"string"},"externalId":{"type":"string"},"fetchedAt":{"type":"string"},"source":{"type":"string","enum":["static","polymarket","kalshi"]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","typeOrder","type","field","fieldDescription","question","action","answers","dependency","isMifidRelevant","isActive","createdAt","updatedAt","translations","metadata"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/api-keys":{"get":{"operationId":"adminApiKeys-list","summary":"List API keys","description":"Returns all API keys for the organization. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string"},"prefix":{"type":["string","null"]},"enabled":{"type":"boolean"},"lastUsed":{"type":["string","null"]},"rawKey":{"type":["string","null"]}},"required":["id","name","environment","createdAt","prefix","enabled","lastUsed","rawKey"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"adminApiKeys-create","summary":"Create API key","description":"Creates a new API key for the organization. The full key is only returned once. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"environment":{"default":"production","type":"string","enum":["production","sandbox"]},"createdAt":{"type":"string"},"prefix":{"type":["string","null"]},"enabled":{"type":"boolean"},"lastUsed":{"type":["string","null"]},"rawKey":{"type":["string","null"]},"key":{"type":"string"}},"required":["id","name","environment","createdAt","prefix","enabled","lastUsed","rawKey","key"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/api-keys/{id}":{"patch":{"operationId":"adminApiKeys-updateStatus","summary":"Update API key status","description":"Updates an API key status (enabled/disabled). Set enabled=false to revoke a key. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"enabled":{"type":"boolean"}},"required":["success","enabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"adminApiKeys-delete","summary":"Delete API key","description":"Permanently deletes an API key. This action cannot be undone. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/api-playground/send":{"post":{"operationId":"adminApiPlayground-sendRequest","summary":"Send SDK API request","description":"Proxies an SDK API request server-side to avoid CORS issues. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PATCH","PUT","DELETE"]},"path":{"type":"string","minLength":1},"body":{"type":"string"},"apiKey":{"type":"string","minLength":1},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["method","path","apiKey"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"number"},"statusText":{"type":"string"},"headers":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"body":{"type":"string"},"duration":{"type":"number"}},"required":["status","statusText","headers","body","duration"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users":{"get":{"operationId":"adminSdkUsers-list","summary":"List B2B SDK users","description":"Returns a paginated list of B2B users with profile/strategy/KYC summary.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"strengthLevel","schema":{"type":"string"}},{"in":"query","name":"strategyState","schema":{"anyOf":[{"type":"string","const":"None"},{"type":"string","enum":["DRAFT","PROPOSED","APPROVED","IMPLEMENTING","ACTIVE","ARCHIVED"]}]}},{"in":"query","name":"kycStatus","schema":{"type":"string"}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["name","createdAt","lastLogin"]}},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]},"isVerified":{"type":"boolean"},"isAmlApproved":{"type":"boolean"},"profileStrengthLevel":{"type":["string","null"]},"strategyState":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId","isVerified","isAmlApproved","profileStrengthLevel","strategyState"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":"number"}},"required":["users","nextCursor","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/profiles":{"get":{"operationId":"adminSdkUsers-listProfiles","summary":"List user profiles","description":"Returns a paginated list of user profiles with spider chart data, searchable by name/email and filterable by strength level.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"strengthLevel","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"profiles":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"profileTitle":{"type":["string","null"]},"profileStrengthLevel":{"type":["string","null"]},"investorProfileSpider":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"investorProfileLastComputed":{"type":["string","null"]}},"required":["userId","name","email","profileTitle","profileStrengthLevel","investorProfileSpider","investorProfileLastComputed"],"additionalProperties":false}},"total":{"type":"number"}},"required":["profiles","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}":{"get":{"operationId":"adminSdkUsers-get","summary":"Get B2B SDK user detail","description":"Returns user details with relation counts and summary fields.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastLogin":{"type":"string"},"picture":{"type":["string","null"]},"externalId":{"type":["string","null"]},"isVerified":{"type":"boolean"},"isAmlApproved":{"type":"boolean"},"profileStrengthLevel":{"type":["string","null"]},"strategyState":{"type":["string","null"]},"counts":{"type":"object","properties":{"orders":{"type":"number"},"verificationSessions":{"type":"number"},"questionnaireSubmissions":{"type":"number"},"strategyExecutions":{"type":"number"}},"required":["orders","verificationSessions","questionnaireSubmissions","strategyExecutions"],"additionalProperties":false}},"required":["id","email","name","emailVerified","createdAt","updatedAt","lastLogin","picture","externalId","isVerified","isAmlApproved","profileStrengthLevel","strategyState","counts"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/profile":{"get":{"operationId":"adminSdkUsers-getProfile","summary":"Get user profile","description":"Returns investor profile, spider chart, and profiling answers.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"anyOf":[{"type":"object","properties":{"profileTitle":{"type":["string","null"]},"profileDescription":{"type":["string","null"]},"profileStrengthLevel":{"type":["string","null"]},"investorSummary":{"type":["string","null"]},"investorProfileSpider":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"investorProfileLastComputed":{"type":["string","null"]},"profilingAnswers":{"anyOf":[{},{"type":"null"}]}},"required":["profileTitle","profileDescription","profileStrengthLevel","investorSummary","investorProfileSpider","investorProfileLastComputed","profilingAnswers"],"additionalProperties":false},{"type":"null"}]},"submissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"completedAt":{"type":["string","null"]},"summary":{"type":["string","null"]},"answersCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","completedAt","summary","answersCount","createdAt"],"additionalProperties":false}},"activeQuestionnaire":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","name","createdAt"],"additionalProperties":false},{"type":"null"}]},"marketPositions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"userProbabilityBps":{"type":"number"},"marketProbabilityBps":{"type":["number","null"]},"status":{"type":"string"},"answeredAt":{"type":["string","null"]}},"required":["id","question","userProbabilityBps","marketProbabilityBps","status","answeredAt"],"additionalProperties":false}}},"required":["profile","submissions","activeQuestionnaire","marketPositions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/strategy":{"get":{"operationId":"adminSdkUsers-getStrategy","summary":"Get user investment strategy","description":"Returns the user's personal investment strategy, allocations, and execution history.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"strategy":{"type":"string"},"highlights":{"anyOf":[{},{"type":"null"}]},"plan":{"type":"array","items":{"type":"string"}},"reasoning":{"type":["string","null"]},"score":{"type":["number","null"]},"assumptions":{"type":"array","items":{"type":"string"}},"state":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"allocations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tokenName":{"type":"string"},"tokenSymbol":{"type":"string"},"percentage":{"type":"number"}},"required":["id","tokenName","tokenSymbol","percentage"],"additionalProperties":false}},"executions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","status","startedAt","finishedAt","createdAt"],"additionalProperties":false}}},"required":["id","title","strategy","highlights","plan","reasoning","score","assumptions","state","createdAt","updatedAt","allocations","executions"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/orders":{"get":{"operationId":"adminSdkUsers-getOrders","summary":"Get user orders","description":"Returns paginated orders for the user.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":20,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"stepsCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","type","status","networkFeeInUSD","motifFeeInUsd","stepsCount","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":"number"}},"required":["orders","nextCursor","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/kyc":{"get":{"operationId":"adminSdkUsers-getKyc","summary":"Get user KYC data","description":"Returns identity verification fields and verification session history.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"isVerified":{"type":"boolean"},"isAmlApproved":{"type":"boolean"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"fullName":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nationality":{"type":["string","null"]},"gender":{"type":["string","null"]},"placeOfBirth":{"type":["string","null"]},"documentType":{"type":["string","null"]},"documentNumber":{"type":["string","null"]},"issuingState":{"type":["string","null"]},"documentExpiresAt":{"type":["string","null"]},"verificationSessions":{"type":"array","items":{"type":"object","properties":{"diditConsoleUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"id":{"type":"string"},"sessionId":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["diditConsoleUrl","id","sessionId","status","createdAt","updatedAt"],"additionalProperties":false}}},"required":["isVerified","isAmlApproved","firstName","lastName","fullName","dateOfBirth","nationality","gender","placeOfBirth","documentType","documentNumber","issuingState","documentExpiresAt","verificationSessions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/kyc-session":{"post":{"operationId":"adminSdkUsers-createKycSession","summary":"Create KYC verification session","description":"Creates a Didit identity verification session for a client and returns the verification URL.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"required":["sessionId","status","url"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/strategies":{"get":{"operationId":"adminSdkUsers-listStrategies","summary":"List all user investment strategies","description":"Returns a paginated list of all users with investment strategies in the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"strategyState","schema":{"type":"string"}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["name","score","createdAt"]}},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"strategies":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"ref":{"type":["string","null"]},"userName":{"type":["string","null"]},"userEmail":{"type":"string"},"strategyId":{"type":"string"},"title":{"type":"string"},"state":{"type":"string"},"score":{"type":["number","null"]},"allocationCount":{"type":"number"},"topAllocations":{"type":"array","items":{"type":"object","properties":{"tokenSymbol":{"type":"string"},"percentage":{"type":"number"}},"required":["tokenSymbol","percentage"],"additionalProperties":false}},"latestExecutionStatus":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["userId","ref","userName","userEmail","strategyId","title","state","score","allocationCount","topAllocations","latestExecutionStatus","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["strategies","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/holdings":{"get":{"operationId":"adminSdkUsers-getHoldings","summary":"Get user holdings","description":"Returns user's wallets, target allocations, and latest strategy execution details.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"wallets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"address":{"type":"string"},"blockchain":{"type":"string"}},"required":["id","address","blockchain"],"additionalProperties":false}},"walletBalances":{"type":"object","properties":{"totalUsdValue":{"type":"string"},"tokens":{"type":"array","items":{"type":"object","properties":{"tokenName":{"type":"string"},"tokenSymbol":{"type":"string"},"tokenLogo":{"type":["string","null"]},"balance":{"type":"string"},"usdValue":{"type":"string"},"percentage":{"type":"number"},"updatedAt":{"type":"string"}},"required":["tokenName","tokenSymbol","tokenLogo","balance","usdValue","percentage","updatedAt"],"additionalProperties":false}}},"required":["totalUsdValue","tokens"],"additionalProperties":false},"strategyBalances":{"anyOf":[{"type":"object","properties":{"totalUsdValue":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"displayName":{"type":"string"},"totalUsdValue":{"type":"string"},"totalPercentage":{"type":"number"},"tokens":{"type":"array","items":{"type":"object","properties":{"tokenSymbol":{"type":"string"},"tokenName":{"type":"string"},"tokenLogo":{"type":["string","null"]},"balance":{"type":"string"},"usdValue":{"type":"string"},"price":{"type":"string"},"percentage":{"type":"number"}},"required":["tokenSymbol","tokenName","tokenLogo","balance","usdValue","price","percentage"],"additionalProperties":false}}},"required":["id","displayName","totalUsdValue","totalPercentage","tokens"],"additionalProperties":false}}},"required":["totalUsdValue","buckets"],"additionalProperties":false},{"type":"null"}]},"latestExecution":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"orders":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string"},"orderType":{"type":["string","null"]},"orderStatus":{"type":"string"},"tokenSymbol":{"type":["string","null"]}},"required":["orderId","orderType","orderStatus","tokenSymbol"],"additionalProperties":false}}},"required":["id","status","startedAt","finishedAt","createdAt","orders"],"additionalProperties":false},{"type":"null"}]}},"required":["wallets","walletBalances","strategyBalances","latestExecution"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/recompute-profile":{"post":{"operationId":"adminSdkUsers-recomputeProfile","summary":"Recompute user investor profile","description":"Recomputes the investor profile (spider chart, strength level, AI summary) based on current profiling answers.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/b2b-users/{userId}/regenerate-strategy":{"post":{"operationId":"adminSdkUsers-regenerateStrategy","summary":"Regenerate user investment strategy","description":"Generates a new personal investment strategy for the user using the AI strategist agent.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/questionnaires":{"get":{"operationId":"adminQuestionnaire-list","summary":"List profiling questionnaires","description":"Returns all profiling questionnaire sessions for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"memberId":{"type":["string","null"]},"tier":{"anyOf":[{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},{"type":"null"}]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","name","memberId","tier","isActive","expiresAt","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"adminQuestionnaire-create","summary":"Create profiling questionnaire","description":"Creates a new profiling questionnaire session with a unique shareable token.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"tier":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"expiresAt":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"memberId":{"type":["string","null"]},"tier":{"anyOf":[{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},{"type":"null"}]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","name","memberId","tier","isActive","expiresAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/questionnaires/for-client":{"post":{"operationId":"adminQuestionnaire-createForClient","summary":"Create or reuse a client questionnaire","description":"Creates a profiling questionnaire linked to a specific client. Returns existing active questionnaire if one exists.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"tier":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"expiresAt":{"type":"string"}},"required":["userId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"memberId":{"type":["string","null"]},"tier":{"anyOf":[{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},{"type":"null"}]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","name","memberId","tier","isActive","expiresAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/questionnaires/{id}":{"patch":{"operationId":"adminQuestionnaire-update","summary":"Update profiling questionnaire","description":"Update questionnaire name, active status, or expiry.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"memberId":{"type":["string","null"]},"tier":{"anyOf":[{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},{"type":"null"}]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","name","memberId","tier","isActive","expiresAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"adminQuestionnaire-delete","summary":"Delete profiling questionnaire","description":"Permanently deletes a profiling questionnaire session.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/questionnaires/{id}/detail":{"get":{"operationId":"adminQuestionnaire-getDetail","summary":"Get questionnaire detail with submissions","description":"Returns questionnaire metadata and a list of all submissions.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"name":{"type":["string","null"]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"},"submissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"startedAt":{"type":"string"},"completedAt":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"ipAddress":{"type":["string","null"]},"answersCount":{"type":"number"}},"required":["id","startedAt","completedAt","userAgent","ipAddress","answersCount"],"additionalProperties":false}},"totalSubmissions":{"type":"number"},"completedSubmissions":{"type":"number"}},"required":["id","token","name","isActive","expiresAt","createdAt","submissions","totalSubmissions","completedSubmissions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/questionnaires/submissions/{id}":{"get":{"operationId":"adminQuestionnaire-getSubmission","summary":"Get full submission detail","description":"Returns the full submission including answers, spider chart, and summary.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"questionnaireId":{"type":"string"},"answers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"spiderChart":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]},"summary":{"type":["string","null"]},"startedAt":{"type":"string"},"completedAt":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"referrer":{"type":["string","null"]},"ipAddress":{"type":["string","null"]}},"required":["id","questionnaireId","answers","spiderChart","summary","startedAt","completedAt","userAgent","referrer","ipAddress"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/audit-logs":{"get":{"operationId":"adminAuditLog-list","summary":"List audit logs","description":"Returns paginated audit logs for the organization with optional filters.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"resource","schema":{"type":"string"}},{"in":"query","name":"resources","schema":{"type":"array","items":{"type":"string"}}},{"in":"query","name":"actionPrefix","schema":{"type":"string"}},{"in":"query","name":"actorId","schema":{"type":"string"}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"search","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"actorId":{"type":"string"},"actorEmail":{"type":["string","null"]},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"type":["string","null"]},"metadata":{"anyOf":[{},{"type":"null"}]},"ipAddress":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","organizationId","actorId","actorEmail","action","resource","resourceId","metadata","ipAddress","createdAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["logs","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/client-logs":{"get":{"operationId":"adminClientLog-list","summary":"List client logs","description":"Returns paginated client (SDK) logs for the organization with optional filters.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"resource","schema":{"type":"string"}},{"in":"query","name":"method","schema":{"type":"string"}},{"in":"query","name":"apiKeyId","schema":{"type":"string"}},{"in":"query","name":"targetUserId","schema":{"type":"string"}},{"in":"query","name":"statusCode","schema":{"type":"number"}},{"in":"query","name":"statusCodeGroup","schema":{"type":"string","enum":["2xx","3xx","4xx","5xx"]}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"sortField","schema":{"type":"string","enum":["method","path","statusCode","durationMs","createdAt"]}},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"apiKeyId":{"type":["string","null"]},"method":{"type":"string"},"path":{"type":"string"},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"type":["string","null"]},"targetUserId":{"type":["string","null"]},"statusCode":{"type":"number"},"durationMs":{"type":["number","null"]},"metadata":{"anyOf":[{},{"type":"null"}]},"ipAddress":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","organizationId","apiKeyId","method","path","action","resource","resourceId","targetUserId","statusCode","durationMs","metadata","ipAddress","userAgent","createdAt"],"additionalProperties":false}},"total":{"type":"number"}},"required":["logs","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/client-logs/{id}":{"get":{"operationId":"adminClientLog-getLogDetail","summary":"Get client log detail","description":"Returns full details of a single client log entry including metadata, IP, and user agent.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"apiKeyId":{"type":["string","null"]},"method":{"type":"string"},"path":{"type":"string"},"action":{"type":"string"},"resource":{"type":"string"},"resourceId":{"type":["string","null"]},"targetUserId":{"type":["string","null"]},"statusCode":{"type":"number"},"durationMs":{"type":["number","null"]},"metadata":{"anyOf":[{},{"type":"null"}]},"ipAddress":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","organizationId","apiKeyId","method","path","action","resource","resourceId","targetUserId","statusCode","durationMs","metadata","ipAddress","userAgent","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/client-logs/stats":{"get":{"operationId":"adminClientLog-getLogStats","summary":"Get client log stats","description":"Returns quick stats for the current filter: total count, avg duration, error rate, unique paths.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"resource","schema":{"type":"string"}},{"in":"query","name":"method","schema":{"type":"string"}},{"in":"query","name":"apiKeyId","schema":{"type":"string"}},{"in":"query","name":"targetUserId","schema":{"type":"string"}},{"in":"query","name":"statusCode","schema":{"type":"number"}},{"in":"query","name":"statusCodeGroup","schema":{"type":"string","enum":["2xx","3xx","4xx","5xx"]}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"search","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalCount":{"type":"number"},"avgDurationMs":{"type":["number","null"]},"errorRate":{"type":"number"},"uniquePaths":{"type":"number"}},"required":["totalCount","avgDurationMs","errorRate","uniquePaths"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/client-logs/export":{"get":{"operationId":"adminClientLog-exportLogs","summary":"Export client logs","description":"Returns up to 1000 logs as CSV-ready data for the current filter set.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"action","schema":{"type":"string"}},{"in":"query","name":"resource","schema":{"type":"string"}},{"in":"query","name":"method","schema":{"type":"string"}},{"in":"query","name":"apiKeyId","schema":{"type":"string"}},{"in":"query","name":"targetUserId","schema":{"type":"string"}},{"in":"query","name":"statusCode","schema":{"type":"number"}},{"in":"query","name":"statusCodeGroup","schema":{"type":"string","enum":["2xx","3xx","4xx","5xx"]}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"search","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["headers","rows"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/transactions":{"get":{"operationId":"adminTransactions-list","summary":"List transactions","description":"Returns a paginated list of orders/transactions for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":25,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"type","schema":{"type":"string"}},{"in":"query","name":"userId","schema":{"type":"string"}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"userId":{"type":"string"},"ref":{"type":["string","null"]},"userEmail":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"txHash":{"type":["string","null"]},"stepCount":{"type":"number"},"retryCount":{"type":"number"}},"required":["id","status","type","networkFeeInUSD","motifFeeInUsd","userId","ref","userEmail","userName","createdAt","updatedAt","txHash","stepCount","retryCount"],"additionalProperties":false}},"total":{"type":"number"},"summary":{"type":"object","properties":{"totalOrders":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"}},"required":["totalOrders","completed","failed","pending"],"additionalProperties":false}},"required":["items","total","summary"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/transactions/{orderId}":{"get":{"operationId":"adminTransactions-getOrder","summary":"Get order detail","description":"Returns full order detail including steps, transactions, and retry info.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"orderId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"networkFeeInUSD":{"type":["string","null"]},"motifFeeInUsd":{"type":["string","null"]},"retryCount":{"type":"number"},"retryReason":{"type":["string","null"]},"isRetry":{"type":"boolean"},"originalOrderId":{"type":["string","null"]},"retryExpiresAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","email","name"],"additionalProperties":false},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"stepIndex":{"type":["number","null"]},"createdAt":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"txHash":{"type":["string","null"]},"networkFee":{"type":["string","null"]},"networkFeeInUSD":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","type","status","txHash","networkFee","networkFeeInUSD","createdAt"],"additionalProperties":false}}},"required":["id","type","status","stepIndex","createdAt","transactions"],"additionalProperties":false}},"strategyExecution":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","type","networkFeeInUSD","motifFeeInUsd","retryCount","retryReason","isRetry","originalOrderId","retryExpiresAt","createdAt","updatedAt","user","steps","strategyExecution"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/transactions/{orderId}/retry":{"post":{"operationId":"adminTransactions-retryOrder","summary":"Retry a failed order","description":"Resets a FAILED order to CREATED status and increments retry count.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"orderId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/usage-analytics/overview":{"get":{"operationId":"adminUsageAnalytics-getUsageOverview","summary":"Get usage analytics overview","description":"Returns aggregated API usage stats for the given date range with period-over-period comparison.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"range","schema":{"type":"string","enum":["7d","30d","90d"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalCalls":{"type":"number"},"uniqueEndpoints":{"type":"number"},"avgResponseTime":{"type":["number","null"]},"errorRate":{"type":"number"},"changes":{"type":"object","properties":{"totalCalls":{"type":["number","null"]},"avgResponseTime":{"type":["number","null"]},"errorRate":{"type":["number","null"]}},"required":["totalCalls","avgResponseTime","errorRate"],"additionalProperties":false}},"required":["totalCalls","uniqueEndpoints","avgResponseTime","errorRate","changes"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/usage-analytics/time-series":{"get":{"operationId":"adminUsageAnalytics-getUsageTimeSeries","summary":"Get usage analytics time series","description":"Returns time-bucketed API call counts grouped by success/error status.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"range","schema":{"type":"string","enum":["7d","30d","90d"]},"required":true},{"in":"query","name":"granularity","schema":{"type":"string","enum":["hourly","daily","weekly"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"totalCalls":{"type":"number"},"successCalls":{"type":"number"},"errorCalls":{"type":"number"},"avgDuration":{"type":["number","null"]}},"required":["timestamp","totalCalls","successCalls","errorCalls","avgDuration"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/usage-analytics/top-endpoints":{"get":{"operationId":"adminUsageAnalytics-getTopEndpoints","summary":"Get top endpoints by call count","description":"Returns the most-called endpoints with counts, avg duration, and error rate.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"range","schema":{"type":"string","enum":["7d","30d","90d"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"method":{"type":"string"},"callCount":{"type":"number"},"avgDuration":{"type":["number","null"]},"errorRate":{"type":"number"}},"required":["path","method","callCount","avgDuration","errorRate"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/usage-analytics/error-breakdown":{"get":{"operationId":"adminUsageAnalytics-getErrorBreakdown","summary":"Get error breakdown by status code and endpoint","description":"Returns errors grouped by HTTP status code and endpoint path.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"range","schema":{"type":"string","enum":["7d","30d","90d"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"statusCode":{"type":"number"},"path":{"type":"string"},"count":{"type":"number"}},"required":["statusCode","path","count"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/usage-analytics/by-api-key":{"get":{"operationId":"adminUsageAnalytics-getUsageByApiKey","summary":"Get usage stats grouped by API key","description":"Returns per-API-key usage statistics including call counts and error rates.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"range","schema":{"type":"string","enum":["7d","30d","90d"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"apiKeyId":{"type":"string"},"apiKeyName":{"type":["string","null"]},"callCount":{"type":"number"},"lastUsed":{"type":["string","null"]},"errorRate":{"type":"number"}},"required":["apiKeyId","apiKeyName","callCount","lastUsed","errorRate"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/agent-traces":{"get":{"operationId":"adminAgentTraces-list","summary":"List agent traces","description":"Returns paginated AI agent execution traces for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"agentType","schema":{"type":"string","enum":["knowledge-graph","profiling","strategy"]}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"search","schema":{"type":"string"}},{"in":"query","name":"spanType","schema":{"type":"string"}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string","enum":["success","error","running"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"traces":{"type":"array","items":{"type":"object","properties":{"spanId":{"type":"string"},"traceId":{"type":"string"},"name":{"type":"string"},"spanType":{"type":["string","null"]},"status":{"type":"string","enum":["success","error","running"]},"userId":{"type":["string","null"]},"userEmail":{"type":["string","null"]},"userName":{"type":["string","null"]},"memberId":{"type":["string","null"]},"entityName":{"type":["string","null"]},"durationMs":{"type":["number","null"]},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"input":{"anyOf":[{},{"type":"null"}]},"output":{"anyOf":[{},{"type":"null"}]}},"required":["spanId","traceId","name","spanType","status","userId","userEmail","userName","memberId","entityName","durationMs","startedAt","endedAt","input","output"],"additionalProperties":false}},"total":{"type":"number"}},"required":["traces","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/agent-traces/{traceId}":{"get":{"operationId":"adminAgentTraces-getTrace","summary":"Get trace detail","description":"Returns all spans for a single trace as a hierarchical tree.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"traceId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"root":{"anyOf":[{"$ref":"#/components/schemas/__schema0"},{"type":"null"}]},"spans":{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}}},"required":["root","spans"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/system-health":{"get":{"operationId":"adminSystemHealth-overview","summary":"Get system health overview","description":"Returns system health metrics including API call volume, error rate, and recent errors.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"apiCalls24h":{"type":"number"},"errorRate":{"type":"number"},"avgResponseMs":{"type":["number","null"]},"activeUsers24h":{"type":"number"},"auditEvents24h":{"type":"number"},"recentErrors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"path":{"type":"string"},"statusCode":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","action","path","statusCode","createdAt"],"additionalProperties":false}}},"required":["apiCalls24h","errorRate","avgResponseMs","activeUsers24h","auditEvents24h","recentErrors"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/support/tickets":{"post":{"operationId":"adminSupport-create","summary":"Create support ticket","description":"Creates a new support ticket with an initial message.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":5000},"priority":{"default":"medium","type":"string","enum":["low","medium","high","critical"]},"category":{"type":"string","enum":["sdk","api","agents","billing","other"]}},"required":["subject","description"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdById":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"category":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"messageCount":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"senderId":{"type":"string"},"senderRole":{"type":"string","enum":["user","support","system"]},"content":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","ticketId","senderId","senderRole","content","createdAt"],"additionalProperties":false}}},"required":["id","organizationId","createdById","subject","description","status","priority","category","createdAt","updatedAt","messageCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"adminSupport-list","summary":"List support tickets","description":"Returns paginated support tickets for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":20,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"offset","schema":{"default":0,"type":"number","minimum":0}},{"in":"query","name":"status","schema":{"type":"string"}},{"in":"query","name":"priority","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdById":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"category":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"messageCount":{"type":"number"}},"required":["id","organizationId","createdById","subject","description","status","priority","category","createdAt","updatedAt","messageCount"],"additionalProperties":false}},"total":{"type":"number"}},"required":["tickets","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/support/tickets/{id}":{"get":{"operationId":"adminSupport-get","summary":"Get support ticket","description":"Returns a support ticket with all messages.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdById":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"category":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"messageCount":{"type":"number"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"senderId":{"type":"string"},"senderRole":{"type":"string","enum":["user","support","system"]},"content":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","ticketId","senderId","senderRole","content","createdAt"],"additionalProperties":false}}},"required":["id","organizationId","createdById","subject","description","status","priority","category","createdAt","updatedAt","messageCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/support/tickets/{ticketId}/messages":{"post":{"operationId":"adminSupport-addMessage","summary":"Add message to ticket","description":"Adds a new message to an existing support ticket.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"ticketId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":5000}},"required":["content"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"ticketId":{"type":"string"},"senderId":{"type":"string"},"senderRole":{"type":"string","enum":["user","support","system"]},"content":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","ticketId","senderId","senderRole","content","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/support/tickets/{id}/status":{"patch":{"operationId":"adminSupport-updateStatus","summary":"Update ticket status","description":"Updates the status of a support ticket.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","resolved","closed"]}},"required":["status"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/help/ask":{"post":{"operationId":"adminHelp-ask","summary":"Ask help chatbot","description":"Sends a question to the admin help chatbot and gets an AI-generated response.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"conversationHistory":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"}},"required":["role","content"]}}},"required":["question"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks":{"get":{"operationId":"adminWebhook-list","summary":"List webhooks","description":"Returns all webhooks for the organization.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"adminWebhook-create","summary":"Create webhook","description":"Creates a new webhook endpoint. The signing secret is only shown once.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"description":{"type":"string","maxLength":500}},"required":["name","url","events"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"secret":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt","secret"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/{id}":{"patch":{"operationId":"adminWebhook-update","summary":"Update webhook","description":"Updates webhook configuration.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"adminWebhook-delete","summary":"Delete webhook","description":"Permanently deletes a webhook and its delivery history.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/{id}/rotate-secret":{"post":{"operationId":"adminWebhook-rotateSecret","summary":"Rotate webhook secret","description":"Generates a new signing secret. The old secret becomes invalid immediately.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"},"secretPrefix":{"type":"string"}},"required":["secret","secretPrefix"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/{id}/test":{"post":{"operationId":"adminWebhook-test","summary":"Send test webhook","description":"Sends a test ping event to the webhook URL.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":["number","null"]},"duration":{"type":["number","null"]},"error":{"type":["string","null"]}},"required":["success","statusCode","duration","error"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/{id}/deliveries":{"get":{"operationId":"adminWebhook-getDeliveries","summary":"Get webhook deliveries","description":"Returns recent delivery attempts for a webhook.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"statusCode":{"type":["number","null"]},"success":{"type":"boolean"},"duration":{"type":["number","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","event","statusCode","success","duration","error","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["deliveries","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/deliveries/{deliveryId}":{"get":{"operationId":"adminWebhook-getDeliveryDetail","summary":"Get webhook delivery detail","description":"Returns full payload and response for a delivery attempt.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"deliveryId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"statusCode":{"type":["number","null"]},"success":{"type":"boolean"},"duration":{"type":["number","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"payload":{},"response":{"type":["string","null"]}},"required":["id","event","statusCode","success","duration","error","createdAt","payload","response"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/webhooks/events":{"get":{"operationId":"adminWebhook-getAvailableEvents","summary":"Get available webhook events","description":"Returns the list of events that can be subscribed to.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"description":{"type":"string"}},"required":["event","description"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/onboarding/status":{"get":{"operationId":"adminOnboarding-getOnboardingStatus","summary":"Get onboarding status","description":"Returns the onboarding checklist with completion status for each step. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"completed":{"type":"boolean"},"link":{"type":"string"},"estimatedMinutes":{"type":"number"}},"required":["id","title","description","completed","link","estimatedMinutes"],"additionalProperties":false}},"completedCount":{"type":"number"},"totalCount":{"type":"number"},"dismissed":{"type":"boolean"}},"required":["steps","completedCount","totalCount","dismissed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/admin/onboarding/dismiss":{"post":{"operationId":"adminOnboarding-dismissOnboarding","summary":"Dismiss onboarding","description":"Marks the onboarding wizard as dismissed for the organization. Requires org admin access.","tags":["admin"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/{token}/config":{"get":{"operationId":"publicQuestionnaire-getConfig","summary":"Get questionnaire configuration","description":"Returns the profiling questions and formula config for a questionnaire session. No authentication required.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true},{"in":"query","name":"lang","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"typeOrder":{"type":"number"},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string"},"answers":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label","choices"],"additionalProperties":false}},{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["id","label"],"additionalProperties":false}}},"required":["columns","rows"],"additionalProperties":false},{"type":"object","properties":{"max":{"type":"integer","minimum":1,"maximum":9007199254740991},"maxSelected":{"type":"integer","minimum":1,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"minSelected":{"type":"integer","minimum":0,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}}},"required":["options"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"disabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"],"additionalProperties":false}},{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"step":{"type":"number"}},"required":["max","min","step"],"additionalProperties":false}},{"type":"object","properties":{"placeholder":{"type":"string"}},"required":["placeholder"],"additionalProperties":false},{"type":"null"}]},{"type":"null"}]},"dependency":{"anyOf":[{"type":"object","properties":{"dependsOnField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["eq","neq","gt","lt","gte","lte","exists","not_exists","contains","not_contains"]},"value":{"type":["string","number"]}},"required":["dependsOnField","operator"],"additionalProperties":false},{"type":"null"}]}},"required":["id","type","typeOrder","field","fieldDescription","question","action","answers","dependency"],"additionalProperties":false}},"formulaConfig":{"$ref":"#/components/schemas/ProfilingFormulaConfigOutput"},"summaryConfig":{"type":"object","properties":{"systemPrompt":{"type":"string","minLength":1},"userPromptTemplate":{"type":"string","minLength":1},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingSummaryFieldOutput"}},"maxCharacters":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"additionalProperties":false},"lang":{"type":"string"},"supportedLanguages":{"type":"array","items":{"type":"string"}}},"required":["questions","formulaConfig","summaryConfig","lang","supportedLanguages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/{token}/spider-chart":{"post":{"operationId":"publicQuestionnaire-computeSpiderChart","summary":"Compute spider chart for questionnaire session","description":"Computes the investor profile spider chart from questionnaire answers. No authentication required.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"field":{"type":"string"},"tier":{"type":"string"},"action":{"type":"string"},"value":{}},"required":["questionId","field","tier","action","value"]}},"tier":{"type":"string","enum":["Basic","Advanced"]}},"required":["answers","tier"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"spiderChart":{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false}},"required":["spiderChart"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/{token}/summary":{"post":{"operationId":"publicQuestionnaire-computeSummary","summary":"Compute AI summary for questionnaire session","description":"Generates an AI-powered investor profile summary from questionnaire answers. No authentication required.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"field":{"type":"string"},"tier":{"type":"string"},"action":{"type":"string"},"value":{}},"required":["questionId","field","tier","action","value"]}}},"required":["answers"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":["string","null"]}},"required":["summary"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/{token}/sessions":{"post":{"operationId":"publicQuestionnaire-startSession","summary":"Start a questionnaire session","description":"Creates a new submission record when a user opens a questionnaire. Returns a sessionId for subsequent answer saves.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"token","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"referrer":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"}},"required":["sessionId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/sessions/{sessionId}/answers":{"post":{"operationId":"publicQuestionnaire-saveAnswer","summary":"Save an answer for a questionnaire session","description":"Persists a single answer to the submission. Upserts by field name.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"object","properties":{"questionId":{"type":"string"},"field":{"type":"string"},"tier":{"type":"string"},"action":{"type":"string"},"value":{}},"required":["questionId","field","tier","action","value"]}},"required":["answer"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/questionnaires/sessions/{sessionId}/complete":{"post":{"operationId":"publicQuestionnaire-completeSession","summary":"Complete a questionnaire session","description":"Saves computed spider chart and AI summary, marks the session as completed.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":["string","null"]}},"required":["summary"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/sales-deck/access-code":{"post":{"operationId":"publicSalesDeck-requestAccessCode","summary":"Request a sales deck access code","description":"Records who is asking for the sales deck and emails them a one-time code. No authentication required.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deckSlug":{"type":"string","pattern":"^salesdeck-[a-z0-9-]{1,60}$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"firmType":{"type":"string","enum":["ASSET_MANAGER","WEALTH_PLATFORM","BANK","INDEPENDENT_ADVISOR","OTHER"]},"problem":{"type":"string","minLength":3,"maxLength":1000}},"required":["deckSlug","email","firmType","problem"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["sent","rate-limited"]},"requestId":{"type":["string","null"]}},"required":["status","requestId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/public/sales-deck/access-code/verify":{"post":{"operationId":"publicSalesDeck-verifyAccessCode","summary":"Verify a sales deck access code","description":"Checks the one-time code emailed for a sales deck request. No authentication required.","tags":["public"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string","minLength":1,"maxLength":64},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["requestId","code"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["verified","incorrect","expired","locked"]}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets":{"get":{"operationId":"sdk-assets-list","summary":"Browse the asset universe or find an organization asset mapping","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"query","schema":{"type":"string","maxLength":200}},{"in":"query","name":"externalId","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["EQUITY","FUND","CRYPTO_TOKEN","CUSTOM"]},"name":{"type":"string"},"symbol":{"type":["string","null"]},"externalId":{"type":["string","null"]},"currency":{"type":["string","null"]},"priceProvider":{"type":"string","enum":["MARKET","CUSTOM"]},"description":{"type":["string","null"]},"exchange":{"type":["string","null"]}},"required":["id","category","name","symbol","externalId","currency","priceProvider","description","exchange"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["assets","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"sdk-assets-create","summary":"Create a reusable custom asset with an idempotent external ID","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":200},"symbol":{"type":"string","minLength":1,"maxLength":32},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"description":{"type":"string","maxLength":20000}},"required":["externalId","name","symbol","currency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["EQUITY","FUND","CRYPTO_TOKEN","CUSTOM"]},"name":{"type":"string"},"symbol":{"type":["string","null"]},"externalId":{"type":["string","null"]},"currency":{"type":["string","null"]},"priceProvider":{"type":"string","enum":["MARKET","CUSTOM"]},"description":{"type":["string","null"]},"exchange":{"type":["string","null"]}},"required":["id","category","name","symbol","externalId","currency","priceProvider","description","exchange"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets/{assetId}":{"get":{"operationId":"sdk-assets-get","summary":"Get an asset by its Motif ID","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["EQUITY","FUND","CRYPTO_TOKEN","CUSTOM"]},"name":{"type":"string"},"symbol":{"type":["string","null"]},"externalId":{"type":["string","null"]},"currency":{"type":["string","null"]},"priceProvider":{"type":"string","enum":["MARKET","CUSTOM"]},"description":{"type":["string","null"]},"exchange":{"type":["string","null"]}},"required":["id","category","name","symbol","externalId","currency","priceProvider","description","exchange"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"sdk-assets-update","summary":"Set your asset reference, metadata or organization price provider","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":20000},"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"priceProvider":{"type":"string","enum":["MARKET","CUSTOM"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["EQUITY","FUND","CRYPTO_TOKEN","CUSTOM"]},"name":{"type":"string"},"symbol":{"type":["string","null"]},"externalId":{"type":["string","null"]},"currency":{"type":["string","null"]},"priceProvider":{"type":"string","enum":["MARKET","CUSTOM"]},"description":{"type":["string","null"]},"exchange":{"type":["string","null"]}},"required":["id","category","name","symbol","externalId","currency","priceProvider","description","exchange"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets/{assetId}/prices":{"put":{"operationId":"sdk-assets-putPrice","summary":"Write or correct a dated custom price and revalue affected accounts","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"unitPrice":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,8})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["asOf","revision","unitPrice","currency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"revision":{"type":"number"},"unitPrice":{"type":"string"},"currency":{"type":"string"}},"required":["asOf","revision","unitPrice","currency"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"sdk-assets-prices","summary":"Read custom price history with exclusive time pagination","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"before","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"prices":{"type":"array","items":{"type":"object","properties":{"asOf":{"type":"string"},"revision":{"type":"number"},"unitPrice":{"type":"string"},"currency":{"type":"string"}},"required":["asOf","revision","unitPrice","currency"],"additionalProperties":false}},"nextBefore":{"type":["string","null"]}},"required":["prices","nextBefore"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets/{assetId}/documents":{"post":{"operationId":"sdk-assets-createDocument","summary":"Create a private fact-sheet upload session","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"mimeType":{"type":"string","enum":["audio/mpeg","audio/mp4","audio/wav","audio/webm","audio/ogg","audio/flac","text/plain","text/markdown","text/csv","application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","image/jpeg","image/png","image/webp","image/gif"]},"sizeBytes":{"type":"integer","exclusiveMinimum":0,"maximum":20971520},"publishedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["fileName","mimeType","sizeBytes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string"},"uploadUrl":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["documentId","uploadUrl","headers"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets/{assetId}/documents/{documentId}/finalize":{"post":{"operationId":"sdk-assets-finalizeDocument","summary":"Seal the uploaded document and enqueue ingestion","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"documentId","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string"},"assetId":{"type":"string"},"scope":{"type":"string","const":"ORG"},"status":{"type":"string","enum":["AWAITING_UPLOAD","QUEUED","EXTRACTING","ANALYZING","ANALYZED","APPLYING","COMPLETED","FAILED"]},"error":{"type":["string","null"]},"jobId":{"type":["string","null"]}},"required":["documentId","assetId","scope","status","error","jobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/assets/{assetId}/documents/{documentId}":{"get":{"operationId":"sdk-assets-document","summary":"Read document ingestion status and asset association","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"documentId","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string"},"assetId":{"type":"string"},"scope":{"type":"string","const":"ORG"},"status":{"type":"string","enum":["AWAITING_UPLOAD","QUEUED","EXTRACTING","ANALYZING","ANALYZED","APPLYING","COMPLETED","FAILED"]},"error":{"type":["string","null"]},"jobId":{"type":["string","null"]}},"required":["documentId","assetId","scope","status","error","jobId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/mappings":{"get":{"operationId":"sdk-feeds-mappings","summary":"List the active feed mapping for each event type","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"definition":{"type":"object","properties":{"eventType":{"type":"string","enum":["ai.motif.asset.master.v1","ai.motif.asset.price.v1","ai.motif.fx.rate.v1"]},"enabled":{"type":"boolean"},"source":{"type":"string","maxLength":300,"format":"uri"},"match":{"anyOf":[{"type":"object","properties":{"pointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"equals":{"type":"string","minLength":1,"maxLength":200}},"required":["pointer","equals"],"additionalProperties":false},{"type":"null"}]},"idPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"timePointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"subjectPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"}},"constants":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["eventType","enabled","source","match","idPointer","timePointer","subjectPointer","fields","constants"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"savedAt":{"type":"string"},"savedBy":{"type":"string"}},"required":["definition","version","savedAt","savedBy"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"sdk-feeds-saveMapping","summary":"Save a new version of the feed mapping for one event type","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventType":{"type":"string","enum":["ai.motif.asset.master.v1","ai.motif.asset.price.v1","ai.motif.fx.rate.v1"]},"enabled":{"type":"boolean"},"source":{"type":"string","maxLength":300,"format":"uri"},"match":{"anyOf":[{"type":"object","properties":{"pointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"equals":{"type":"string","minLength":1,"maxLength":200}},"required":["pointer","equals"],"additionalProperties":false},{"type":"null"}]},"idPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"timePointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"subjectPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"}},"constants":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["eventType","enabled","source","match","idPointer","timePointer","subjectPointer","fields","constants"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"type":"object","properties":{"eventType":{"type":"string","enum":["ai.motif.asset.master.v1","ai.motif.asset.price.v1","ai.motif.fx.rate.v1"]},"enabled":{"type":"boolean"},"source":{"type":"string","maxLength":300,"format":"uri"},"match":{"anyOf":[{"type":"object","properties":{"pointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"equals":{"type":"string","minLength":1,"maxLength":200}},"required":["pointer","equals"],"additionalProperties":false},{"type":"null"}]},"idPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"timePointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"subjectPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"}},"constants":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["eventType","enabled","source","match","idPointer","timePointer","subjectPointer","fields","constants"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"savedAt":{"type":"string"},"savedBy":{"type":"string"}},"required":["definition","version","savedAt","savedBy"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/mappings/preview":{"post":{"operationId":"sdk-feeds-previewMapping","summary":"Map a sample message and validate the resulting event","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mapping":{"type":"object","properties":{"eventType":{"type":"string","enum":["ai.motif.asset.master.v1","ai.motif.asset.price.v1","ai.motif.fx.rate.v1"]},"enabled":{"type":"boolean"},"source":{"type":"string","maxLength":300,"format":"uri"},"match":{"anyOf":[{"type":"object","properties":{"pointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"equals":{"type":"string","minLength":1,"maxLength":200}},"required":["pointer","equals"],"additionalProperties":false},{"type":"null"}]},"idPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"timePointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"subjectPointer":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"},"fields":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"type":"string","maxLength":300,"pattern":"^(\\/[^/]*)*$"}},"constants":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["eventType","enabled","source","match","idPointer","timePointer","subjectPointer","fields","constants"],"additionalProperties":false},"sample":{}},"required":["mapping","sample"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"event":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"errors":{"type":"array","items":{"type":"string"}}},"required":["event","errors"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/connection":{"get":{"operationId":"sdk-feeds-connection","summary":"Read the feed connection settings","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"hosting":{"type":"string","enum":["MOTIF","PARTNER"]},"enabled":{"type":"boolean"},"source":{"type":"object","properties":{"host":{"type":["string","null"]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"virtualHost":{"type":["string","null"]},"queue":{"type":["string","null"]},"outputExchange":{"type":["string","null"]},"outputRoutingKey":{"type":"string"},"quarantineExchange":{"type":["string","null"]},"useTls":{"type":"boolean"},"username":{"type":["string","null"]},"hasPassword":{"type":"boolean"}},"required":["host","port","virtualHost","queue","outputExchange","outputRoutingKey","quarantineExchange","useTls","username","hasPassword"],"additionalProperties":false},"motif":{"type":"object","properties":{"virtualHost":{"type":["string","null"]},"provisionedAt":{"type":["string","null"]}},"required":["virtualHost","provisionedAt"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["hosting","enabled","source","motif","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"sdk-feeds-saveConnection","summary":"Save the feed connection settings","description":"The source password is write-only: send it to set or replace it, omit it to keep the stored value.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hosting":{"type":"string","enum":["MOTIF","PARTNER"]},"source":{"type":"object","properties":{"host":{"anyOf":[{"type":"string","minLength":1,"maxLength":253},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":1,"maximum":65535},{"type":"null"}]},"virtualHost":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"queue":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"outputExchange":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"outputRoutingKey":{"type":"string","minLength":1,"maxLength":200},"quarantineExchange":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"password":{"type":"string","minLength":1,"maxLength":500}},"required":["host","port","virtualHost","queue","outputExchange","outputRoutingKey","quarantineExchange","useTls","username"],"additionalProperties":false}},"required":["hosting","source"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"hosting":{"type":"string","enum":["MOTIF","PARTNER"]},"enabled":{"type":"boolean"},"source":{"type":"object","properties":{"host":{"type":["string","null"]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"virtualHost":{"type":["string","null"]},"queue":{"type":["string","null"]},"outputExchange":{"type":["string","null"]},"outputRoutingKey":{"type":"string"},"quarantineExchange":{"type":["string","null"]},"useTls":{"type":"boolean"},"username":{"type":["string","null"]},"hasPassword":{"type":"boolean"}},"required":["host","port","virtualHost","queue","outputExchange","outputRoutingKey","quarantineExchange","useTls","username","hasPassword"],"additionalProperties":false},"motif":{"type":"object","properties":{"virtualHost":{"type":["string","null"]},"provisionedAt":{"type":["string","null"]}},"required":["virtualHost","provisionedAt"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["hosting","enabled","source","motif","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/connection/enabled":{"put":{"operationId":"sdk-feeds-setConnectionEnabled","summary":"Enable or disable the feed connection","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"hosting":{"type":"string","enum":["MOTIF","PARTNER"]},"enabled":{"type":"boolean"},"source":{"type":"object","properties":{"host":{"type":["string","null"]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"virtualHost":{"type":["string","null"]},"queue":{"type":["string","null"]},"outputExchange":{"type":["string","null"]},"outputRoutingKey":{"type":"string"},"quarantineExchange":{"type":["string","null"]},"useTls":{"type":"boolean"},"username":{"type":["string","null"]},"hasPassword":{"type":"boolean"}},"required":["host","port","virtualHost","queue","outputExchange","outputRoutingKey","quarantineExchange","useTls","username","hasPassword"],"additionalProperties":false},"motif":{"type":"object","properties":{"virtualHost":{"type":["string","null"]},"provisionedAt":{"type":["string","null"]}},"required":["virtualHost","provisionedAt"],"additionalProperties":false},"updatedAt":{"type":["string","null"]}},"required":["hosting","enabled","source","motif","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/connection/connector-credentials":{"post":{"operationId":"sdk-feeds-issueConnectorCredentials","summary":"Rotate and return the partner-hosted connector broker URL","description":"Returns the new credentials once. Earlier connector credentials stop working.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/receipts/{eventId}":{"get":{"operationId":"sdk-feeds-receipt","summary":"Read the durable outcome of a feed event","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"eventId","schema":{"type":"string","minLength":1,"maxLength":200},"required":true},{"in":"query","name":"source","schema":{"type":"string","maxLength":300,"format":"uri"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["APPLIED","REJECTED"]},"code":{"type":["string","null"]},"resourceId":{"type":["string","null"]},"processedAt":{"type":"string"}},"required":["eventId","source","status","code","resourceId","processedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/subscription":{"get":{"operationId":"sdk-feeds-subscription","summary":"Read broker insight notification subscription","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"surfaces":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["MARKET","ASSET","PORTFOLIO"]}},"language":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"}},"required":["enabled","surfaces","language"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"sdk-feeds-configureSubscription","summary":"Configure broker insight notifications","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"surfaces":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["MARKET","ASSET","PORTFOLIO"]}},"language":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"}},"required":["enabled","surfaces"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"surfaces":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["MARKET","ASSET","PORTFOLIO"]}},"language":{"default":"en","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"}},"required":["enabled","surfaces","language"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/feeds/fx":{"get":{"operationId":"sdk-feeds-fxRate","summary":"Read the latest partner FX observation at or before a time","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"baseCurrency","schema":{"type":"string","pattern":"^[A-Z]{3}$"},"required":true},{"in":"query","name":"quoteCurrency","schema":{"type":"string","pattern":"^[A-Z]{3}$"},"required":true},{"in":"query","name":"asOf","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"quoteCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"revision":{"type":"integer","minimum":1,"maximum":2147483647},"rate":{"type":"string","pattern":"^(?!0+(?:\\.0+)?$)\\d{1,16}(\\.\\d{1,12})?$"},"rateType":{"type":"string","const":"MID"},"source":{"type":"string"}},"required":["baseCurrency","quoteCurrency","asOf","revision","rate","rateType","source"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/users":{"post":{"operationId":"sdk-users-create","summary":"Create user","description":"Creates a new end user in the organization. SDK-created users are automatically email verified.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"externalId":{"type":"string","minLength":1,"maxLength":255}},"required":["email","name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"sdk-users-list","summary":"List users","description":"Returns a paginated list of users in the organization. Use cursor for pagination.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":50,"type":"number","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":21,"maxLength":21}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]},"total":{"type":"number"}},"required":["users","nextCursor","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/users/{id}":{"get":{"operationId":"sdk-users-get","summary":"Get user by ID","description":"Returns a user by their internal Motif ID. User must belong to the organization.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"sdk-users-update","summary":"Update user","description":"Updates user details. User must belong to the organization.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"externalId":{"type":"string","minLength":1,"maxLength":255}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"sdk-users-delete","summary":"Delete user","description":"Permanently deletes a user. User must belong to the organization. This action cannot be undone.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/users/external/{externalId}":{"get":{"operationId":"sdk-users-getByExternalId","summary":"Get user by external ID","description":"Returns a user by their partner-defined external ID. User must belong to the organization.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"externalId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","email","name","emailVerified","createdAt","updatedAt","externalId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks/{id}/deliveries/{deliveryId}/replay":{"post":{"operationId":"sdk-webhooks-replay","summary":"Replay an assessment notification with current access checks","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"deliveryId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"},"status":{"type":"string","const":"QUEUED"}},"required":["eventId","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks":{"get":{"operationId":"sdk-webhooks-list","summary":"List organization webhook subscriptions","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"sdk-webhooks-create","summary":"Subscribe to organization events","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"description":{"type":"string","maxLength":500}},"required":["name","url","events"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"secret":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt","secret"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks/{id}":{"patch":{"operationId":"sdk-webhooks-update","summary":"Update a webhook subscription","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"secretPrefix":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","url","secretPrefix","events","enabled","description","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"sdk-webhooks-delete","summary":"Delete a webhook subscription","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks/{id}/rotate-secret":{"post":{"operationId":"sdk-webhooks-rotateSecret","summary":"Rotate webhook signing secret","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"},"secretPrefix":{"type":"string"}},"required":["secret","secretPrefix"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks/{id}/test":{"post":{"operationId":"sdk-webhooks-test","summary":"Send a signed test webhook","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"statusCode":{"type":["number","null"]},"duration":{"type":"number"},"error":{"type":["string","null"]}},"required":["success","statusCode","duration","error"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/webhooks/{id}/deliveries":{"get":{"operationId":"sdk-webhooks-deliveries","summary":"Inspect webhook delivery attempts","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string"},"statusCode":{"type":["number","null"]},"success":{"type":"boolean"},"duration":{"type":["number","null"]},"error":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","event","statusCode","success","duration","error","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["deliveries","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/profile/questions":{"get":{"operationId":"sdk-profile-getQuestions","summary":"Get profiling questions","description":"Returns profiling questions for the specified type (Basic, Advanced, or MIFID). Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"typeOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"field":{"type":"string"},"fieldDescription":{"type":["string","null"]},"question":{"type":"string"},"action":{"type":"string","enum":["SingleSelect","MultiSelect","Matrix","NumberInput","PercentageSlider","MultiPercentageSlider","TextInput"]},"answers":{"anyOf":[{},{"type":"null"}]}},"required":["id","type","typeOrder","field","fieldDescription","question","action","answers"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/profile/answers":{"post":{"operationId":"sdk-profile-saveAnswer","summary":"Save profiling answer","description":"Saves an answer to a profiling question for the target user. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"questionId":{"type":"string"},"answer":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":["string","number"]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}]}},"required":["questionId","answer"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"sdk-profile-getAnswers","summary":"Get profiling answers","description":"Returns all profiling answers for the target user. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"field":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":["string","number"]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}]},"tier":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]}},"required":["questionId","field","value","tier"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/profile/investor-profile":{"get":{"operationId":"sdk-profile-getInvestorProfile","summary":"Get investor profile","description":"Returns the computed investor profile (spider chart, strength level, summary). Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"spiderChart":{"anyOf":[{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false},{"type":"null"}]},"strengthLevel":{"type":["string","null"]},"summary":{"type":["string","null"]},"lastComputed":{"type":["string","null"]}},"required":["spiderChart","strengthLevel","summary","lastComputed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/profile/investor-profile/compute":{"post":{"operationId":"sdk-profile-computeInvestorProfile","summary":"Compute investor profile","description":"Computes or refreshes the investor profile based on profiling answers. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"spiderChart":{"anyOf":[{"type":"object","properties":{"experience":{"type":"number"},"riskTolerance":{"type":"number"},"engagement":{"type":"number"},"timeHorizon":{"type":"number"},"financialResilience":{"type":"number"},"investorKnowledge":{"type":"number"}},"required":["experience","riskTolerance","engagement","timeHorizon","financialResilience","investorKnowledge"],"additionalProperties":false},{"type":"null"}]},"strengthLevel":{"type":["string","null"]},"summary":{"type":["string","null"]},"lastComputed":{"type":["string","null"]}},"required":["spiderChart","strengthLevel","summary","lastComputed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/profile/completion":{"get":{"operationId":"sdk-profile-getCompletion","summary":"Get profile completion status","description":"Returns completion status for the specified profiling tier. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"tier","schema":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction","Brokerage"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"isComplete":{"type":"boolean"},"progress":{"type":"object","properties":{"current":{"type":"number"},"total":{"type":"number"}},"required":["current","total"],"additionalProperties":false}},"required":["isComplete","progress"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/strategies/recommended":{"get":{"operationId":"sdk-strategies-getRecommended","summary":"Get recommended strategy","description":"Returns the recommended investment strategy for the target user. If no strategy exists, one will be generated. Requires completed Basic profiling. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"strategy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"strategy":{"type":["string","null"]},"assumptions":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"highlights":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"required":["title","description"],"additionalProperties":false}},{"type":"null"}]},"plan":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reasoning":{"type":["string","null"]},"score":{"type":["number","null"]},"state":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"targetAllocations":{"type":"array","items":{"type":"object","properties":{"tokenId":{"type":"number"},"name":{"type":["string","null"]},"percentage":{"type":"number"}},"required":["tokenId","name","percentage"],"additionalProperties":false}}},"required":["id","title","strategy","assumptions","highlights","plan","reasoning","score","state","createdAt","updatedAt","targetAllocations"],"additionalProperties":false},{"type":"null"}]},"profileComplete":{"type":"boolean"},"message":{"type":["string","null"]}},"required":["strategy","profileComplete","message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/strategies/generate":{"post":{"operationId":"sdk-strategies-generate","summary":"Generate investment strategy","description":"Generates a new personalized investment strategy using AI. Requires completed Basic profiling. This may take several seconds. Requires x-user-id header.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"strategy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"strategy":{"type":["string","null"]},"assumptions":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"highlights":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"required":["title","description"],"additionalProperties":false}},{"type":"null"}]},"plan":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reasoning":{"type":["string","null"]},"score":{"type":["number","null"]},"state":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"targetAllocations":{"type":"array","items":{"type":"object","properties":{"tokenId":{"type":"number"},"name":{"type":["string","null"]},"percentage":{"type":"number"}},"required":["tokenId","name","percentage"],"additionalProperties":false}}},"required":["id","title","strategy","assumptions","highlights","plan","reasoning","score","state","createdAt","updatedAt","targetAllocations"],"additionalProperties":false},{"type":"null"}]},"profileComplete":{"type":"boolean"},"message":{"type":["string","null"]}},"required":["strategy","profileComplete","message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/questionnaires":{"post":{"operationId":"sdk-questionnaires-create","summary":"Create profiling questionnaire","description":"Creates a new profiling questionnaire session with a unique shareable token and URL. Requires API key authentication.","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"expiresAt":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"url":{"type":"string"},"name":{"type":["string","null"]},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","token","url","name","isActive","expiresAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/partner-portfolios":{"post":{"operationId":"sdk-partnerPortfolios-create","summary":"Create a partner portfolio","description":"Persists a partner portfolio context for later reference by Clarity card/chat endpoints. externalId must be unique within the organization.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":128},"baseCurrency":{"type":"string","minLength":3,"maxLength":8},"currentHoldings":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"]}},"historicHoldings":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"]}},"trades":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"]}},"profile":{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}},"required":["externalId","currentHoldings"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"baseCurrency":{"type":"string"},"currentHoldings":{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"],"additionalProperties":false}},"historicHoldings":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"],"additionalProperties":false}},{"type":"null"}]},"trades":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"],"additionalProperties":false}},{"type":"null"}]},"profile":{"anyOf":[{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","baseCurrency","currentHoldings","historicHoldings","trades","profile","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/partner-portfolios/{id}":{"get":{"operationId":"sdk-partnerPortfolios-get","summary":"Get a partner portfolio","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"baseCurrency":{"type":"string"},"currentHoldings":{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"],"additionalProperties":false}},"historicHoldings":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"],"additionalProperties":false}},{"type":"null"}]},"trades":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"],"additionalProperties":false}},{"type":"null"}]},"profile":{"anyOf":[{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","baseCurrency","currentHoldings","historicHoldings","trades","profile","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"sdk-partnerPortfolios-update","summary":"Update a partner portfolio","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":128},"baseCurrency":{"type":"string","minLength":3,"maxLength":8},"currentHoldings":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"]}},"historicHoldings":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"]}},"trades":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"]}},"profile":{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"baseCurrency":{"type":"string"},"currentHoldings":{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"],"additionalProperties":false}},"historicHoldings":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"],"additionalProperties":false}},{"type":"null"}]},"trades":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"],"additionalProperties":false}},{"type":"null"}]},"profile":{"anyOf":[{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","baseCurrency","currentHoldings","historicHoldings","trades","profile","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"sdk-partnerPortfolios-delete","summary":"Delete a partner portfolio","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/partner-portfolios/{id}/trades":{"post":{"operationId":"sdk-partnerPortfolios-recordTrades","summary":"Record new trades on an existing partner portfolio","description":"Appends one or more new trades to the partner portfolio and replaces currentHoldings with the supplied post-trade snapshot. Server retains at most the most recent 5000 trades (oldest dropped by executedAt). To update historicHoldings (e.g. after a position closes), use PATCH /v1/sdk/partner-portfolios/{id}.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trades":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"]}},"currentHoldings":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"]}}},"required":["trades","currentHoldings"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"baseCurrency":{"type":"string"},"currentHoldings":{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"type":["string","null"]}},"required":["ticker","quantity"],"additionalProperties":false}},"historicHoldings":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"],"additionalProperties":false}},{"type":"null"}]},"trades":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"],"additionalProperties":false}},{"type":"null"}]},"profile":{"anyOf":[{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","baseCurrency","currentHoldings","historicHoldings","trades","profile","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/portfolios/by-id/{portfolioId}/archive":{"post":{"operationId":"sdk-portfolios-archive","summary":"Archive a partner account and stop its insight eligibility","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"portfolioId","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING_INVITE","ACTIVE","ARCHIVED"]},"currency":{"type":"string"}},"required":["id","externalId","status","currency"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/portfolios":{"get":{"operationId":"sdk-portfolios-list","summary":"List portfolios provisioned by this organization through the snapshot feed","tags":["sdk","portfolios"],"security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"portfolios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING_INVITE","ACTIVE","ARCHIVED"]},"currency":{"type":"string"}},"required":["id","externalId","status","currency"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["portfolios","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/portfolios/{externalId}":{"put":{"operationId":"sdk-portfolios-put","summary":"Create or replace a native portfolio snapshot","description":"Creates the portfolio and its internal client record on the first request. No separate client call or client ID is required. Atomically replaces the complete holdings and cash for this organization and external ID. Revisions must increase; identical retries are idempotent. Omitted holdings are removed. Triggers native valuation, price-history backfill and portfolio calculations. Does not execute trades.","tags":["sdk","portfolios"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"externalId","schema":{"type":"string","minLength":1,"maxLength":128},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"cash":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,8})?$"},"holdings":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"instrument":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"ASSET"},"assetId":{"type":"string","minLength":1}},"required":["type","assetId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["STOCK","ETF","FUND"]},"symbol":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[A-Z0-9._-]+$"},"exchange":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[A-Z0-9 ._-]+$"},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["type","symbol","name"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"CRYPTO"},"externalId":{"type":"string","minLength":1,"maxLength":128},"symbol":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[\\p{L}\\p{N}._-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"blockchain":{"type":"string","minLength":1,"maxLength":128},"networkType":{"type":"string","minLength":1,"maxLength":128},"address":{"type":"string","minLength":1,"maxLength":256}},"required":["type","externalId","symbol","name","blockchain","networkType"],"additionalProperties":false}]},"quantity":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,8})?$"},"costBasisPerUnit":{"anyOf":[{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,8})?$"},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"valuation":{"anyOf":[{"type":"object","properties":{"unitPrice":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,8})?$"},"asOf":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["unitPrice","asOf"],"additionalProperties":false},{"type":"null"}]}},"required":["instrument","quantity","currency"],"additionalProperties":false}}},"required":["revision","asOf","currency","cash","holdings"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"portfolioId":{"type":"string"},"externalId":{"type":"string"},"revision":{"type":"number"},"asOf":{"type":"string"},"calculation":{"type":"string","enum":["PENDING","CURRENT"]},"calculatedRevision":{"type":["number","null"]},"calculatedAt":{"type":["string","null"]}},"required":["portfolioId","externalId","revision","asOf","calculation","calculatedRevision","calculatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"sdk-portfolios-get","summary":"Read a native portfolio and its calculation status","tags":["sdk","portfolios"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"externalId","schema":{"type":"string","minLength":1,"maxLength":128},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"portfolioId":{"type":"string"},"externalId":{"type":"string"},"revision":{"type":"number"},"asOf":{"type":"string"},"calculation":{"type":"string","enum":["PENDING","CURRENT"]},"calculatedRevision":{"type":["number","null"]},"calculatedAt":{"type":["string","null"]},"status":{"type":"string"},"currency":{"type":"string"},"totalValue":{"type":"string"},"isComplete":{"type":"boolean"},"holdings":{"type":"array","items":{"type":"object","properties":{"assetId":{"type":"string"},"name":{"type":"string"},"symbol":{"type":["string","null"]},"quantity":{"type":"string"},"costBasisPerUnit":{"type":["string","null"]},"value":{"type":["string","null"]},"missingPrice":{"type":"boolean"},"unitPrice":{"type":["string","null"]},"priceSource":{"type":["string","null"]},"priceAsOf":{"type":["string","null"]}},"required":["assetId","name","symbol","quantity","costBasisPerUnit","value","missingPrice","unitPrice","priceSource","priceAsOf"],"additionalProperties":false}}},"required":["portfolioId","externalId","revision","asOf","calculation","calculatedRevision","calculatedAt","status","currency","totalValue","isComplete","holdings"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/assets/{assetId}":{"get":{"operationId":"sdk-clarity-assetById","summary":"Read the insight for an exact asset subject","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"assetId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"language","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"asOf":{"type":"string"},"headline":{"type":["string","null"]},"isFresh":{"type":"boolean"},"name":{"type":"string"},"newsUnavailable":{"type":"boolean"},"recentNews":{"type":"array","items":{"type":"object","properties":{"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"pubDate":{"type":["string","null"]},"sourceDomain":{"type":["string","null"]},"title":{"type":"string"},"url":{"type":["string","null"]}},"required":["description","imageUrl","pubDate","sourceDomain","title","url"],"additionalProperties":false}},"sourceCount":{"type":"number"},"symbol":{"type":["string","null"]},"text":{"type":["string","null"]}},"required":["asOf","headline","isFresh","name","newsUnavailable","recentNews","sourceCount","symbol","text"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/portfolios/{portfolioId}":{"get":{"operationId":"sdk-clarity-portfolioById","summary":"Read the insight for an exact portfolio subject","tags":["sdk"],"security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"portfolioId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"language","schema":{"type":"string"}},{"in":"query","name":"window","schema":{"type":"string","enum":["1D","1W","1M","YTD","1Y"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"card":{"anyOf":[{"type":"object","properties":{"asOf":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"citations":{"type":"array","items":{"type":"object","properties":{"entityName":{"type":"string"},"label":{"type":"string"},"localId":{"type":"string"},"url":{"type":"string"}},"required":["entityName","label"],"additionalProperties":false}},"facts":{"type":"array","items":{"type":"object","properties":{"asOf":{"type":["string","null"]},"currency":{"type":"string"},"key":{"type":"string"},"source":{"type":"string","const":"COMPOSED"},"subjectName":{"type":"string"},"value":{"type":["number","string"]},"valueType":{"type":"string","enum":["CURRENCY","DATE","NUMBER","PERCENT","PERCENT_POINTS"]}},"required":["asOf","key","source","value","valueType"],"additionalProperties":false}},"key":{"type":"string"},"kind":{"type":"string","enum":["commentary","holding-insight"]},"label":{"type":"string"},"text":{"type":"string"}},"required":["citations","facts","key","kind","label","text"],"additionalProperties":false}},"cardHash":{"type":"string"},"deliveryMode":{"type":"string","const":"TEMPLATED"},"facts":{"type":"array","items":{"type":"object","properties":{"asOf":{"type":["string","null"]},"currency":{"type":"string"},"key":{"type":"string"},"source":{"type":"string","const":"COMPOSED"},"subjectName":{"type":"string"},"value":{"type":["number","string"]},"valueType":{"type":"string","enum":["CURRENCY","DATE","NUMBER","PERCENT","PERCENT_POINTS"]}},"required":["asOf","key","source","value","valueType"],"additionalProperties":false}},"headline":{"type":"string"},"kind":{"type":"string","enum":["ASSET","MARKET","PORTFOLIO"]},"language":{"type":"string"},"periodKey":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"artifactId":{"type":"string"},"asOf":{"type":["string","null"]},"kind":{"type":"string","enum":["MARKET_UPDATE","PORTFOLIO_ANALYSIS","STOCK_UPDATE"]},"subjectKey":{"type":"string"}},"required":["artifactId","asOf","kind","subjectKey"],"additionalProperties":false}},"stale":{"type":"boolean"},"subjectKey":{"type":"string"},"version":{"type":"string"},"window":{"type":"string","enum":["1D","1W","1M","YTD","1Y"]}},"required":["asOf","blocks","cardHash","deliveryMode","facts","headline","kind","language","periodKey","sources","stale","subjectKey","version","window"],"additionalProperties":false},{"type":"null"}]},"read":{"anyOf":[{"type":"object","properties":{"artifactId":{"type":"string"},"asOf":{"type":"string"},"datedTests":{"type":"array","items":{"type":"object","properties":{"dueBy":{"type":["string","null"]},"effect":{"type":"string","enum":["improves","weakens","either"]},"test":{"type":"string"}},"required":["dueBy","effect","test"],"additionalProperties":false}},"headline":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"publisher":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id"],"additionalProperties":false}},"text":{"type":"string"}},"required":["artifactId","asOf","datedTests","headline","sources","text"],"additionalProperties":false},{"type":"null"}]}},"required":["card","read"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/embeds":{"post":{"operationId":"sdk-clarity-createEmbed","summary":"Create a Clarity iframe embed","description":"Mints a ready-to-use iframe URL for the Clarity card + chat surface. The URL embeds a short-lived signed token that scopes the iframe to one portfolio (by id or inline payload) and the listed parent origins. Drop the returned `url` into an iframe; the `token` is exposed for advanced use (e.g. SSR or non-iframe contexts).","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"portfolioId":{"type":"string"},"portfolio":{"type":"object","properties":{"baseCurrency":{"type":"string","minLength":3,"maxLength":8},"currentHoldings":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"costBasis":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"asOf":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["ticker","quantity"]}},"historicHoldings":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"quantity":{"type":["number","string"]},"openedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"realisedPnl":{"type":["number","string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","quantity"]}},"trades":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"maxLength":32},"side":{"type":"string","enum":["BUY","SELL"]},"quantity":{"type":["number","string"]},"price":{"type":["number","string"]},"executedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]}},"required":["ticker","side","quantity","price","executedAt"]}},"profile":{"type":"object","properties":{"riskTolerance":{"type":"string","maxLength":64},"horizonYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"goals":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","maxLength":256}},{"type":"null"}]},"baseCurrency":{"anyOf":[{"type":"string","minLength":3,"maxLength":8},{"type":"null"}]},"annualIncome":{"type":["number","string","null"]},"netWorth":{"type":["number","string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}},"externalId":{"type":"string","minLength":1,"maxLength":128}},"required":["currentHoldings"]},"allowedOrigins":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"uri"}},"ttlSeconds":{"type":"integer","minimum":30,"maximum":3600},"scope":{"type":"array","items":{"type":"string","enum":["card","chat"]}}},"required":["allowedOrigins"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"token":{"type":"string"},"expiresAt":{"type":"string"},"jti":{"type":"string"}},"required":["url","token","expiresAt","jti"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/market-update":{"post":{"operationId":"sdk-clarity-marketUpdate","summary":"Get the shared market update card","description":"Returns the organization's shared \"what is happening in the world\" Clarity card — the same market briefing shown across every portfolio, with inline citations and their source claims. The status field reports whether the latest successful content is fresh or stale. The deprecated isRefreshing field remains false for cached content. Portfolio-agnostic; no user context required. Returns null when no card has been generated yet.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"asOf":{"type":"string"},"citations":{"type":"array","items":{"type":"object","properties":{"claimId":{"type":"string"},"edgeId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"},"label":{"type":"string"},"quotedSpan":{"type":"string"}},"required":["entityName","label"],"additionalProperties":false}},"claims":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"kgClaimId":{"type":"string"},"localId":{"type":"string"},"provenance":{"type":"string","enum":["KNOWLEDGE_GRAPH","MARKET_DATA","PRIVATE_EVIDENCE","WEB_RESEARCH"]},"sourceDocumentId":{"type":"string"},"sourcePublisher":{"type":"string"},"sourceTitle":{"type":"string"},"sourceUrl":{"type":"string"},"text":{"type":"string"},"validFrom":{"type":"string"}},"required":["localId","text"],"additionalProperties":false}},"fullText":{"type":["string","null"]},"headline":{"type":"string"},"isRefreshing":{"type":"boolean","deprecated":true,"description":"Deprecated compatibility field. Cached market updates always return false; use status for content freshness."},"relationships":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"fromName":{"type":"string"},"kgRelationshipId":{"type":"string"},"kind":{"type":"string"},"localId":{"type":"string"},"sourceDocumentId":{"type":"string"},"toName":{"type":"string"},"validFrom":{"type":"string"},"validTo":{"type":"string"}},"required":["kind","localId"],"additionalProperties":false}},"sourceCount":{"type":"number"},"status":{"type":"string","enum":["fresh","stale"]},"text":{"type":"string"}},"required":["asOf","citations","claims","fullText","headline","isRefreshing","relationships","sourceCount","status","text"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/asset-update":{"post":{"operationId":"sdk-clarity-assetUpdate","summary":"Get the generic stock/crypto Clarity read","description":"Returns the holder-agnostic Clarity read for one asset — the same 'what is happening with this stock' content shared by everyone holding it. Identify the asset by ticker `symbol` and `name`. Returns null when no read has been generated yet.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["EQUITY","CRYPTO_TOKEN","FUND"]},"language":{"type":"string"},"name":{"type":"string","minLength":1},"symbol":{"type":["string","null"]}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"asOf":{"type":"string"},"headline":{"type":["string","null"]},"isFresh":{"type":"boolean"},"name":{"type":"string"},"newsUnavailable":{"type":"boolean"},"recentNews":{"type":"array","items":{"type":"object","properties":{"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"pubDate":{"type":["string","null"]},"sourceDomain":{"type":["string","null"]},"title":{"type":"string"},"url":{"type":["string","null"]}},"required":["description","imageUrl","pubDate","sourceDomain","title","url"],"additionalProperties":false}},"sourceCount":{"type":"number"},"symbol":{"type":["string","null"]},"text":{"type":["string","null"]}},"required":["asOf","headline","isFresh","name","newsUnavailable","recentNews","sourceCount","symbol","text"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/portfolio":{"post":{"operationId":"sdk-clarity-portfolioCard","summary":"Get the portfolio Clarity card","description":"Returns the user's composed portfolio card for the requested window (1D, 1W, 1M, YTD or 1Y; default 1D) — the book's figures and events with the published market update and the latest authored portfolio read spliced in — together with that read (its headline, text, dated tests and sources). Both are null until the nightly composer and the weekly read have run. Requires the x-user-id header; no model is invoked per request.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string"},"window":{"type":"string","enum":["1D","1W","1M","YTD","1Y"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"card":{"anyOf":[{"type":"object","properties":{"asOf":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"citations":{"type":"array","items":{"type":"object","properties":{"entityName":{"type":"string"},"label":{"type":"string"},"localId":{"type":"string"},"url":{"type":"string"}},"required":["entityName","label"],"additionalProperties":false}},"facts":{"type":"array","items":{"type":"object","properties":{"asOf":{"type":["string","null"]},"currency":{"type":"string"},"key":{"type":"string"},"source":{"type":"string","const":"COMPOSED"},"subjectName":{"type":"string"},"value":{"type":["number","string"]},"valueType":{"type":"string","enum":["CURRENCY","DATE","NUMBER","PERCENT","PERCENT_POINTS"]}},"required":["asOf","key","source","value","valueType"],"additionalProperties":false}},"key":{"type":"string"},"kind":{"type":"string","enum":["commentary","holding-insight"]},"label":{"type":"string"},"text":{"type":"string"}},"required":["citations","facts","key","kind","label","text"],"additionalProperties":false}},"cardHash":{"type":"string"},"deliveryMode":{"type":"string","const":"TEMPLATED"},"facts":{"type":"array","items":{"type":"object","properties":{"asOf":{"type":["string","null"]},"currency":{"type":"string"},"key":{"type":"string"},"source":{"type":"string","const":"COMPOSED"},"subjectName":{"type":"string"},"value":{"type":["number","string"]},"valueType":{"type":"string","enum":["CURRENCY","DATE","NUMBER","PERCENT","PERCENT_POINTS"]}},"required":["asOf","key","source","value","valueType"],"additionalProperties":false}},"headline":{"type":"string"},"kind":{"type":"string","enum":["ASSET","MARKET","PORTFOLIO"]},"language":{"type":"string"},"periodKey":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"artifactId":{"type":"string"},"asOf":{"type":["string","null"]},"kind":{"type":"string","enum":["MARKET_UPDATE","PORTFOLIO_ANALYSIS","STOCK_UPDATE"]},"subjectKey":{"type":"string"}},"required":["artifactId","asOf","kind","subjectKey"],"additionalProperties":false}},"stale":{"type":"boolean"},"subjectKey":{"type":"string"},"version":{"type":"string"},"window":{"type":"string","enum":["1D","1W","1M","YTD","1Y"]}},"required":["asOf","blocks","cardHash","deliveryMode","facts","headline","kind","language","periodKey","sources","stale","subjectKey","version","window"],"additionalProperties":false},{"type":"null"}]},"read":{"anyOf":[{"type":"object","properties":{"artifactId":{"type":"string"},"asOf":{"type":"string"},"datedTests":{"type":"array","items":{"type":"object","properties":{"dueBy":{"type":["string","null"]},"effect":{"type":"string","enum":["improves","weakens","either"]},"test":{"type":"string"}},"required":["dueBy","effect","test"],"additionalProperties":false}},"headline":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"publisher":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id"],"additionalProperties":false}},"text":{"type":"string"}},"required":["artifactId","asOf","datedTests","headline","sources","text"],"additionalProperties":false},{"type":"null"}]}},"required":["card","read"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/holding":{"post":{"operationId":"sdk-clarity-holdingAnalysis","summary":"Get the personalized holding analysis","description":"Returns the user's personalized analysis for one holding — how the day's developments connect to that specific position — with its cited sources. Identify the holding by `assetId`. Requires the x-user-id header. Returns empty fields when no analysis has been generated yet.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assetId":{"type":"string","minLength":1},"language":{"type":"string"}},"required":["assetId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"analysis":{"type":["string","null"]},"asOf":{"type":["string","null"]},"baseAnalysis":{"type":["string","null"]},"computedAt":{"type":["string","null"]},"reviewStatus":{"type":["string","null"]},"sources":{"anyOf":[{"type":"object","properties":{"citations":{"type":"array","items":{"type":"object","properties":{"claimId":{"type":"string"},"edgeId":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"},"label":{"type":"string"},"quotedSpan":{"type":"string"}},"required":["entityName","label"],"additionalProperties":false}},"claims":{"type":"array","items":{"type":"object","properties":{"confidence":{"type":"number"},"kgClaimId":{"type":"string"},"localId":{"type":"string"},"provenance":{"type":"string","enum":["KNOWLEDGE_GRAPH","MARKET_DATA","PRIVATE_EVIDENCE","WEB_RESEARCH"]},"sourceDocumentId":{"type":"string"},"sourcePublisher":{"type":"string"},"sourceTitle":{"type":"string"},"sourceUrl":{"type":"string"},"text":{"type":"string"},"validFrom":{"type":"string"}},"required":["localId","text"],"additionalProperties":false}}},"required":["citations","claims"],"additionalProperties":false},{"type":"null"}]}},"required":["analysis","asOf","baseAnalysis","computedAt","reviewStatus","sources"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/v1/sdk/clarity/source-documents":{"post":{"operationId":"sdk-clarity-resolveSourceDocuments","summary":"Resolve cited Clarity source documents","description":"Returns the full source articles behind Clarity citations, including the article body text. Pass the `sourceDocumentId` values carried on a card or chat answer's claims. Only documents within your organization scope (or global) are returned.","tags":["sdk","clarity"],"security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}}},"required":["documentIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"sourceUrl":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"articleTitle":{"type":["string","null"]},"articleContent":{"type":["string","null"]},"authors":{"type":"array","items":{"type":"string"}},"publisher":{"type":["string","null"]},"publisherType":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","fileName","sourceUrl","sourceName","publishedAt","articleTitle","articleContent","authors","publisher","publisherType","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}}},"components":{"schemas":{"TransactionConfig":{"type":"object","properties":{"retry":{"type":"object","properties":{"expiryWindow":{"type":"number","exclusiveMinimum":0},"maxAttempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"route":{"type":"object","properties":{"selectionHierarchy":{"type":"array","items":{"type":"string","enum":["RECOMMENDED","CHEAPEST","FASTEST"]}}}},"fees":{"type":"object","properties":{"maxIncludedPercentage":{"type":"number","minimum":0,"maximum":1},"maxIncludedUSD":{"type":"number","exclusiveMinimum":0}}}}},"InvestmentConfig":{"type":"object","properties":{"minInvestmentUSD":{"type":"number"},"maxInvestmentUSD":{"type":"number"},"blockchain":{"$ref":"#/components/schemas/InvestmentBlockchainConfig"},"dex":{"$ref":"#/components/schemas/InvestmentDexConfig"},"fees":{"$ref":"#/components/schemas/InvestmentFeesConfig"},"minimumDeposit":{"$ref":"#/components/schemas/MinDepositConfig"},"sourceToken":{"$ref":"#/components/schemas/InvestmentSourceTokenConfig"},"timeouts":{"$ref":"#/components/schemas/TimeoutsConfig"},"tolerance":{"$ref":"#/components/schemas/ToleranceConfig"},"portfolioConstruction":{"$ref":"#/components/schemas/PortfolioConstructionConfig"}}},"InvestmentBlockchainConfig":{"type":"object","properties":{"required":{"type":"string"},"chainId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allowCrossChain":{"type":"boolean"}}},"InvestmentDexConfig":{"type":"object","properties":{"maxSlippage":{"type":"number","minimum":0,"maximum":1},"maxPriceImpact":{"type":"number","minimum":0,"maximum":1},"routeOrder":{"type":"string","enum":["CHEAPEST","FASTEST","SAFEST","RECOMMENDED"]},"routeSelectionHierarchy":{"type":"array","items":{"type":"string","enum":["RECOMMENDED","CHEAPEST","FASTEST"]}}}},"InvestmentFeesConfig":{"type":"object","properties":{"maxIncludedPercentage":{"type":"number","minimum":0,"maximum":1},"maxIncludedUSD":{"type":"number","exclusiveMinimum":0}}},"MinDepositConfig":{"type":"object","properties":{"perTokenUSD":{"type":"number","exclusiveMinimum":0},"searchBounds":{"type":"object","properties":{"floor":{"type":"number","exclusiveMinimum":0},"ceiling":{"type":"number","exclusiveMinimum":0}}},"verification":{"type":"object","properties":{"attempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"retryAttempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"stepIncrease":{"type":"number","exclusiveMinimum":0}}}}},"InvestmentSourceTokenConfig":{"type":"object","properties":{"symbol":{"type":"string"},"blockchain":{"type":"string"}}},"TimeoutsConfig":{"type":"object","properties":{"quoteValidity":{"type":"number","exclusiveMinimum":0},"orderRetryExpiry":{"type":"number","exclusiveMinimum":0},"userSyncInterval":{"type":"number","exclusiveMinimum":0}}},"ToleranceConfig":{"type":"object","properties":{"depositDrift":{"type":"number","minimum":0,"maximum":1},"webhookValidation":{"type":"number","minimum":0,"maximum":1}}},"PortfolioConstructionConfig":{"type":"object","properties":{"portfolioSizes":{"type":"object","properties":{"beginner":{"$ref":"#/components/schemas/PortfolioSize"},"intermediate":{"$ref":"#/components/schemas/PortfolioSize"},"advanced":{"$ref":"#/components/schemas/PortfolioSize"}}},"allocationFramework":{"type":"object","properties":{"coreAssets":{"$ref":"#/components/schemas/AllocationRange"},"majorEcosystems":{"$ref":"#/components/schemas/AllocationRange"},"innovationSectors":{"$ref":"#/components/schemas/AllocationRange"},"speculative":{"$ref":"#/components/schemas/AllocationRange"}}},"btcAllocation":{"type":"object","properties":{"low":{"$ref":"#/components/schemas/AllocationRange"},"medium":{"$ref":"#/components/schemas/AllocationRange"},"high":{"$ref":"#/components/schemas/AllocationRange"},"veryHigh":{"$ref":"#/components/schemas/AllocationRange"}}},"speculativeExposure":{"type":"object","properties":{"low":{"$ref":"#/components/schemas/SpeculativeExposureEntry"},"medium":{"$ref":"#/components/schemas/SpeculativeExposureEntry"},"high":{"$ref":"#/components/schemas/SpeculativeExposureEntry"},"veryHigh":{"$ref":"#/components/schemas/SpeculativeExposureEntry"}}},"percentageRules":{"type":"object","properties":{"minTotal":{"type":"number","minimum":0,"maximum":1},"minPerToken":{"type":"number","minimum":0,"maximum":1},"maxSingleTokenDefault":{"type":"number","minimum":0,"maximum":1},"maxSingleTokenHighRisk":{"type":"number","minimum":0,"maximum":1}}},"stablecoinRules":{"type":"object","properties":{"excludeFromAllocations":{"type":"boolean"},"examples":{"type":"array","items":{"type":"string"}}}}}},"PortfolioSize":{"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["min","max"]},"AllocationRange":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":1},"max":{"type":"number","minimum":0,"maximum":1}},"required":["min","max"]},"SpeculativeExposureEntry":{"type":"object","properties":{"total":{"anyOf":[{"type":"number"},{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}]},"maxPerToken":{"type":"number"}},"required":["total","maxPerToken"]},"ProfilingFormulaConfig":{"type":"object","properties":{"axes":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingAxisConfig"}}},"required":["axes"]},"ProfilingAxisConfig":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"description":{"type":"string"},"range":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]},"tiers":{"type":"object","properties":{"Basic":{"$ref":"#/components/schemas/ProfilingTierFormula"},"Advanced":{"$ref":"#/components/schemas/ProfilingTierFormula"}}}},"required":["id","label","range","tiers"]},"ProfilingTierFormula":{"type":"object","properties":{"steps":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingFormulaStep"}},"combiner":{"$ref":"#/components/schemas/ProfilingCombiner"},"outputCap":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},"required":["steps","combiner","outputCap"]},"ProfilingFormulaStep":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string"},"source":{"$ref":"#/components/schemas/ProfilingStepSource"},"type":{"type":"string","enum":["valueMapping","weightedMatrixSum","scaledValue","exposureCount","percentageScale","riskWeightedDistribution","ageBenchmark"]},"config":{"$ref":"#/components/schemas/ProfilingStepConfig"}},"required":["id","source","type","config"]},"ProfilingStepSource":{"oneOf":[{"$ref":"#/components/schemas/ProfilingQuestionSource"},{"$ref":"#/components/schemas/ProfilingMetricSource"}],"type":"object","discriminator":{"propertyName":"type","mapping":{"question":"#/components/schemas/ProfilingQuestionSource","metric":"#/components/schemas/ProfilingMetricSource"}}},"ProfilingQuestionSource":{"type":"object","properties":{"type":{"type":"string","const":"question"},"field":{"type":"string","minLength":1}},"required":["type","field"]},"ProfilingMetricSource":{"type":"object","properties":{"type":{"type":"string","const":"metric"},"metric":{"type":"string","enum":["tradeCount","activeDays","promptCount","accountAgeDays","userAge"]}},"required":["type","metric"]},"ProfilingStepConfig":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"weights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"divisor":{"type":"number"},"offset":{"type":"number"},"scale":{"type":"number"},"cap":{"type":"number"},"assetWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}}},"ProfilingCombiner":{"type":"object","properties":{"type":{"type":"string","enum":["sum","average","weightedAverage"]},"weights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["type"]},"ProfilingSummaryConfig":{"type":"object","properties":{"systemPrompt":{"type":"string","minLength":1},"userPromptTemplate":{"type":"string","minLength":1},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingSummaryField"}},"maxCharacters":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["systemPrompt","userPromptTemplate","fields"]},"ProfilingSummaryField":{"type":"object","properties":{"questionField":{"type":"string","minLength":1},"contextKey":{"type":"string","minLength":1},"labelMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["questionField","contextKey"]},"ConvictionSyncConfig":{"type":"object","properties":{"keywords":{"minItems":0,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"limitPerSource":{"type":"integer","minimum":1,"maximum":50},"sources":{"type":"object","properties":{"kalshi":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"polymarket":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"required":["kalshi","polymarket"]}},"required":["keywords","limitPerSource","sources"]},"PerigonIngestionConfig":{"type":"object","properties":{"articleLanes":{"type":"object","properties":{"asset":{"$ref":"#/components/schemas/PerigonArticleLane"},"finance":{"$ref":"#/components/schemas/PerigonArticleLane"},"geopolitics":{"$ref":"#/components/schemas/PerigonArticleLane"},"markets":{"$ref":"#/components/schemas/PerigonArticleLane"},"overallHardStop":{"type":"integer","minimum":1,"maximum":3000}},"required":["asset","finance","geopolitics","markets","overallHardStop"]},"articleKeywordExclusion":{"type":"object","properties":{"fields":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["TITLE","BODY"]}},"keywords":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["fields","keywords"]},"qualityScoring":{"type":"object","properties":{"quality":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1},"weights":{"type":"object","properties":{"factualGrounding":{"type":"number","minimum":0},"neutrality":{"type":"number","minimum":0},"substance":{"type":"number","minimum":0}},"required":["factualGrounding","neutrality","substance"]}},"required":["enabled","threshold","weights"]},"relevance":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1},"weights":{"type":"object","properties":{"marketImpact":{"type":"number","minimum":0},"geopoliticalImpact":{"type":"number","minimum":0},"urgency":{"type":"number","minimum":0},"importance":{"type":"number","minimum":0}},"required":["marketImpact","geopoliticalImpact","urgency","importance"]}},"required":["enabled","threshold","weights"]}},"required":["quality","relevance"]},"candidatePoolSize":{"type":"integer","minimum":1,"maximum":100},"categories":{"type":"array","items":{"type":"string"}},"cronEnabled":{"type":"boolean"},"minWordCount":{"type":"integer","minimum":0,"maximum":1000},"selectedArticlesPerRun":{"type":"integer","minimum":1,"maximum":50},"selectedStoriesPerRun":{"type":"integer","minimum":1,"maximum":50},"storiesEnabled":{"type":"boolean"},"topics":{"type":"array","items":{"type":"string"}}},"required":["articleLanes","articleKeywordExclusion","qualityScoring","candidatePoolSize","cronEnabled","minWordCount","selectedStoriesPerRun","storiesEnabled"]},"PerigonArticleLane":{"type":"object","properties":{"enabled":{"type":"boolean"},"hardStop":{"type":"integer","minimum":1,"maximum":1000},"query":{"$ref":"#/components/schemas/PerigonArticleQuery"},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"topics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["enabled","hardStop","query"]},"PerigonArticleQuery":{"type":"object","properties":{"areas":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"articleIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"authors":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"bylines":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"cities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"clusterIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyName":{"type":"string","maxLength":300},"companySymbols":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"content":{"type":"string","maxLength":2000},"counties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"countries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"description":{"type":"string","maxLength":2000},"excludeAuthors":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCategories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanyDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanyIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanySymbols":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeJournalistIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLabels":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLanguages":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLocationsCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludePersonNames":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludePersonWikidataIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeTopics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeWatchlists":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"journalistIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"labels":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"languages":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"latitude":{"type":"number","minimum":-90,"maximum":90},"linkTo":{"type":"string","maxLength":1000},"locations":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"locationsCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0,"maximum":20000},"media":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"negativeSentimentFrom":{"type":"number","minimum":0,"maximum":1},"negativeSentimentTo":{"type":"number","minimum":0,"maximum":1},"neutralSentimentFrom":{"type":"number","minimum":0,"maximum":1},"neutralSentimentTo":{"type":"number","minimum":0,"maximum":1},"paywall":{"type":"string","enum":["ANY","FREE","PAYWALLED"]},"personNames":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"personWikidataIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"positiveSentimentFrom":{"type":"number","minimum":0,"maximum":1},"positiveSentimentTo":{"type":"number","minimum":0,"maximum":1},"prefixTaxonomy":{"type":"string","maxLength":500},"q":{"type":"string","maxLength":2000},"reprintGroupId":{"type":"string","maxLength":300},"searchTranslation":{"type":"boolean"},"showReprints":{"type":"boolean"},"sortBy":{"type":"string","enum":["relevance","date","reverseDate","reverseAddDate","addDate","pubDate","refreshDate"]},"sourceCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceLatitude":{"type":"number","minimum":-90,"maximum":90},"sourceLongitude":{"type":"number","minimum":-180,"maximum":180},"sourceMaxDistanceKm":{"type":"number","minimum":0,"maximum":20000},"sourceStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"states":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"summary":{"type":"string","maxLength":2000},"taxonomies":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"title":{"type":"string","maxLength":2000},"topics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"url":{"type":"string","maxLength":1000},"watchlists":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["areas","articleIds","authors","bylines","categories","cities","clusterIds","companyDomains","companyIds","companyName","companySymbols","content","counties","countries","description","excludeAuthors","excludeCategories","excludeCities","excludeCompanyDomains","excludeCompanyIds","excludeCompanySymbols","excludeCounties","excludeJournalistIds","excludeLabels","excludeLanguages","excludeLocationsCountries","excludePersonNames","excludePersonWikidataIds","excludeSourceCities","excludeSourceCounties","excludeSourceCountries","excludeSourceDomains","excludeSourceGroups","excludeSourceStates","excludeStates","excludeTopics","excludeWatchlists","journalistIds","labels","languages","linkTo","locations","locationsCountries","media","paywall","personNames","personWikidataIds","prefixTaxonomy","q","reprintGroupId","searchTranslation","showReprints","sortBy","sourceCities","sourceCounties","sourceCountries","sourceDomains","sourceGroups","sourceStates","states","summary","taxonomies","title","topics","url","watchlists"]},"QuestionnaireProgressionConfig":{"type":"object","properties":{"tiers":{"minItems":1,"type":"array","items":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction"]}},"kycEnabled":{"type":"boolean"}},"required":["tiers","kycEnabled"]},"error.BAD_REQUEST":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Invalid input data"},"code":{"type":"string","description":"The error code","example":"BAD_REQUEST"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Invalid input data error (400)","description":"The error information","example":{"code":"BAD_REQUEST","message":"Invalid input data","issues":[]}},"error.UNAUTHORIZED":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Authorization not provided"},"code":{"type":"string","description":"The error code","example":"UNAUTHORIZED"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Authorization not provided error (401)","description":"The error information","example":{"code":"UNAUTHORIZED","message":"Authorization not provided","issues":[]}},"error.FORBIDDEN":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Insufficient access"},"code":{"type":"string","description":"The error code","example":"FORBIDDEN"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Insufficient access error (403)","description":"The error information","example":{"code":"FORBIDDEN","message":"Insufficient access","issues":[]}},"error.NOT_FOUND":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Not found"},"code":{"type":"string","description":"The error code","example":"NOT_FOUND"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Not found error (404)","description":"The error information","example":{"code":"NOT_FOUND","message":"Not found","issues":[]}},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Internal server error"},"code":{"type":"string","description":"The error code","example":"INTERNAL_SERVER_ERROR"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Internal server error error (500)","description":"The error information","example":{"code":"INTERNAL_SERVER_ERROR","message":"Internal server error","issues":[]}},"OrganizationConfig":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"transactionConfig":{"anyOf":[{"$ref":"#/components/schemas/TransactionConfigOutput"},{"type":"null"}]},"investmentConfig":{"anyOf":[{"$ref":"#/components/schemas/InvestmentConfigOutput"},{"type":"null"}]},"UserProfileAdvancedOptions":{"type":"object","properties":{"interestOptions":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}}},"required":["interestOptions","include","exclude"],"additionalProperties":false},"profilingFormulaConfig":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/ProfilingFormulaConfigOutput"},{"type":"object","properties":{},"additionalProperties":false}]},{"type":"null"}]},"profilingSummaryConfig":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/ProfilingSummaryConfigOutput"},{"type":"object","properties":{},"additionalProperties":false}]},{"type":"null"}]},"reportConfig":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"convictionSyncConfig":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/ConvictionSyncConfigOutput"},{"type":"object","properties":{},"additionalProperties":false}]},{"type":"null"}]},"defaultLanguage":{"type":"string"},"supportedLanguages":{"type":"array","items":{"type":"string"}},"defaultTimeZone":{"type":"string"},"autoAssignDomain":{"type":["string","null"]},"autoAssignEnabled":{"type":"boolean"},"autoAssignRoles":{"type":"array","items":{"type":"string","enum":["SAAS_ORGANIZATION_OWNER","SAAS_ORGANIZATION_ADMIN","SAAS_ORGANIZATION_MEMBER","MOTIF_APP_CLIENT","PORTFOLIO_APP_INSTITUTIONAL_CLIENT_MANAGER","PORTFOLIO_APP_INDIVIDUAL_CLIENT"]}},"onboardingDismissed":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","transactionConfig","investmentConfig","UserProfileAdvancedOptions","profilingFormulaConfig","profilingSummaryConfig","reportConfig","convictionSyncConfig","defaultLanguage","supportedLanguages","defaultTimeZone","autoAssignDomain","autoAssignEnabled","autoAssignRoles","onboardingDismissed","createdAt","updatedAt"],"additionalProperties":false},"__schema0":{"type":"object","properties":{"attributes":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"children":{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},"durationMs":{"type":["number","null"]},"endedAt":{"type":["string","null"]},"entityName":{"type":["string","null"]},"error":{"anyOf":[{},{"type":"null"}]},"input":{"anyOf":[{},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"name":{"type":"string"},"orphaned":{"type":"boolean"},"output":{"anyOf":[{},{"type":"null"}]},"parentSpanId":{"type":["string","null"]},"spanId":{"type":"string"},"spanType":{"type":["string","null"]},"startedAt":{"type":"string"},"status":{"type":"string","enum":["success","error","running"]},"traceId":{"type":"string"}},"required":["attributes","children","durationMs","endedAt","entityName","error","input","metadata","name","orphaned","output","parentSpanId","spanId","spanType","startedAt","status","traceId"],"additionalProperties":false},"TransactionConfigOutput":{"type":"object","properties":{"retry":{"type":"object","properties":{"expiryWindow":{"type":"number","exclusiveMinimum":0},"maxAttempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"additionalProperties":false},"route":{"type":"object","properties":{"selectionHierarchy":{"type":"array","items":{"type":"string","enum":["RECOMMENDED","CHEAPEST","FASTEST"]}}},"additionalProperties":false},"fees":{"type":"object","properties":{"maxIncludedPercentage":{"type":"number","minimum":0,"maximum":1},"maxIncludedUSD":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false}},"additionalProperties":false},"InvestmentConfigOutput":{"type":"object","properties":{"minInvestmentUSD":{"type":"number"},"maxInvestmentUSD":{"type":"number"},"blockchain":{"$ref":"#/components/schemas/InvestmentBlockchainConfigOutput"},"dex":{"$ref":"#/components/schemas/InvestmentDexConfigOutput"},"fees":{"$ref":"#/components/schemas/InvestmentFeesConfigOutput"},"minimumDeposit":{"$ref":"#/components/schemas/MinDepositConfigOutput"},"sourceToken":{"$ref":"#/components/schemas/InvestmentSourceTokenConfigOutput"},"timeouts":{"$ref":"#/components/schemas/TimeoutsConfigOutput"},"tolerance":{"$ref":"#/components/schemas/ToleranceConfigOutput"},"portfolioConstruction":{"$ref":"#/components/schemas/PortfolioConstructionConfigOutput"}},"additionalProperties":false},"InvestmentBlockchainConfigOutput":{"type":"object","properties":{"required":{"type":"string"},"chainId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"allowCrossChain":{"type":"boolean"}},"additionalProperties":false},"InvestmentDexConfigOutput":{"type":"object","properties":{"maxSlippage":{"type":"number","minimum":0,"maximum":1},"maxPriceImpact":{"type":"number","minimum":0,"maximum":1},"routeOrder":{"type":"string","enum":["CHEAPEST","FASTEST","SAFEST","RECOMMENDED"]},"routeSelectionHierarchy":{"type":"array","items":{"type":"string","enum":["RECOMMENDED","CHEAPEST","FASTEST"]}}},"additionalProperties":false},"InvestmentFeesConfigOutput":{"type":"object","properties":{"maxIncludedPercentage":{"type":"number","minimum":0,"maximum":1},"maxIncludedUSD":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"MinDepositConfigOutput":{"type":"object","properties":{"perTokenUSD":{"type":"number","exclusiveMinimum":0},"searchBounds":{"type":"object","properties":{"floor":{"type":"number","exclusiveMinimum":0},"ceiling":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"verification":{"type":"object","properties":{"attempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"retryAttempts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"stepIncrease":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false}},"additionalProperties":false},"InvestmentSourceTokenConfigOutput":{"type":"object","properties":{"symbol":{"type":"string"},"blockchain":{"type":"string"}},"additionalProperties":false},"TimeoutsConfigOutput":{"type":"object","properties":{"quoteValidity":{"type":"number","exclusiveMinimum":0},"orderRetryExpiry":{"type":"number","exclusiveMinimum":0},"userSyncInterval":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"ToleranceConfigOutput":{"type":"object","properties":{"depositDrift":{"type":"number","minimum":0,"maximum":1},"webhookValidation":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":false},"PortfolioConstructionConfigOutput":{"type":"object","properties":{"portfolioSizes":{"type":"object","properties":{"beginner":{"$ref":"#/components/schemas/PortfolioSizeOutput"},"intermediate":{"$ref":"#/components/schemas/PortfolioSizeOutput"},"advanced":{"$ref":"#/components/schemas/PortfolioSizeOutput"}},"additionalProperties":false},"allocationFramework":{"type":"object","properties":{"coreAssets":{"$ref":"#/components/schemas/AllocationRangeOutput"},"majorEcosystems":{"$ref":"#/components/schemas/AllocationRangeOutput"},"innovationSectors":{"$ref":"#/components/schemas/AllocationRangeOutput"},"speculative":{"$ref":"#/components/schemas/AllocationRangeOutput"}},"additionalProperties":false},"btcAllocation":{"type":"object","properties":{"low":{"$ref":"#/components/schemas/AllocationRangeOutput"},"medium":{"$ref":"#/components/schemas/AllocationRangeOutput"},"high":{"$ref":"#/components/schemas/AllocationRangeOutput"},"veryHigh":{"$ref":"#/components/schemas/AllocationRangeOutput"}},"additionalProperties":false},"speculativeExposure":{"type":"object","properties":{"low":{"$ref":"#/components/schemas/SpeculativeExposureEntryOutput"},"medium":{"$ref":"#/components/schemas/SpeculativeExposureEntryOutput"},"high":{"$ref":"#/components/schemas/SpeculativeExposureEntryOutput"},"veryHigh":{"$ref":"#/components/schemas/SpeculativeExposureEntryOutput"}},"additionalProperties":false},"percentageRules":{"type":"object","properties":{"minTotal":{"type":"number","minimum":0,"maximum":1},"minPerToken":{"type":"number","minimum":0,"maximum":1},"maxSingleTokenDefault":{"type":"number","minimum":0,"maximum":1},"maxSingleTokenHighRisk":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":false},"stablecoinRules":{"type":"object","properties":{"excludeFromAllocations":{"type":"boolean"},"examples":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false},"PortfolioSizeOutput":{"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["min","max"],"additionalProperties":false},"AllocationRangeOutput":{"type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":1},"max":{"type":"number","minimum":0,"maximum":1}},"required":["min","max"],"additionalProperties":false},"SpeculativeExposureEntryOutput":{"type":"object","properties":{"total":{"anyOf":[{"type":"number"},{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false}]},"maxPerToken":{"type":"number"}},"required":["total","maxPerToken"],"additionalProperties":false},"ProfilingFormulaConfigOutput":{"type":"object","properties":{"axes":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingAxisConfigOutput"}}},"required":["axes"],"additionalProperties":false},"ProfilingAxisConfigOutput":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"description":{"type":"string"},"range":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false},"tiers":{"type":"object","properties":{"Basic":{"$ref":"#/components/schemas/ProfilingTierFormulaOutput"},"Advanced":{"$ref":"#/components/schemas/ProfilingTierFormulaOutput"}},"additionalProperties":false}},"required":["id","label","range","tiers"],"additionalProperties":false},"ProfilingTierFormulaOutput":{"type":"object","properties":{"steps":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingFormulaStepOutput"}},"combiner":{"$ref":"#/components/schemas/ProfilingCombinerOutput"},"outputCap":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"],"additionalProperties":false}},"required":["steps","combiner","outputCap"],"additionalProperties":false},"ProfilingFormulaStepOutput":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string"},"source":{"$ref":"#/components/schemas/ProfilingStepSourceOutput"},"type":{"type":"string","enum":["valueMapping","weightedMatrixSum","scaledValue","exposureCount","percentageScale","riskWeightedDistribution","ageBenchmark"]},"config":{"$ref":"#/components/schemas/ProfilingStepConfigOutput"}},"required":["id","source","type","config"],"additionalProperties":false},"ProfilingStepSourceOutput":{"oneOf":[{"$ref":"#/components/schemas/ProfilingQuestionSourceOutput"},{"$ref":"#/components/schemas/ProfilingMetricSourceOutput"}],"type":"object","discriminator":{"propertyName":"type","mapping":{"question":"#/components/schemas/ProfilingQuestionSourceOutput","metric":"#/components/schemas/ProfilingMetricSourceOutput"}}},"ProfilingQuestionSourceOutput":{"type":"object","properties":{"type":{"type":"string","const":"question"},"field":{"type":"string","minLength":1}},"required":["type","field"],"additionalProperties":false},"ProfilingMetricSourceOutput":{"type":"object","properties":{"type":{"type":"string","const":"metric"},"metric":{"type":"string","enum":["tradeCount","activeDays","promptCount","accountAgeDays","userAge"]}},"required":["type","metric"],"additionalProperties":false},"ProfilingStepConfigOutput":{"type":"object","properties":{"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"weights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"divisor":{"type":"number"},"offset":{"type":"number"},"scale":{"type":"number"},"cap":{"type":"number"},"assetWeights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"additionalProperties":false},"ProfilingCombinerOutput":{"type":"object","properties":{"type":{"type":"string","enum":["sum","average","weightedAverage"]},"weights":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["type"],"additionalProperties":false},"ProfilingSummaryConfigOutput":{"type":"object","properties":{"systemPrompt":{"type":"string","minLength":1},"userPromptTemplate":{"type":"string","minLength":1},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ProfilingSummaryFieldOutput"}},"maxCharacters":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["systemPrompt","userPromptTemplate","fields"],"additionalProperties":false},"ProfilingSummaryFieldOutput":{"type":"object","properties":{"questionField":{"type":"string","minLength":1},"contextKey":{"type":"string","minLength":1},"labelMapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["questionField","contextKey"],"additionalProperties":false},"ConvictionSyncConfigOutput":{"type":"object","properties":{"keywords":{"minItems":0,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}},"limitPerSource":{"type":"integer","minimum":1,"maximum":50},"sources":{"type":"object","properties":{"kalshi":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false},"polymarket":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}},"required":["kalshi","polymarket"],"additionalProperties":false}},"required":["keywords","limitPerSource","sources"],"additionalProperties":false},"PerigonIngestionConfigOutput":{"type":"object","properties":{"articleLanes":{"type":"object","properties":{"asset":{"$ref":"#/components/schemas/PerigonArticleLaneOutput"},"finance":{"$ref":"#/components/schemas/PerigonArticleLaneOutput"},"geopolitics":{"$ref":"#/components/schemas/PerigonArticleLaneOutput"},"markets":{"$ref":"#/components/schemas/PerigonArticleLaneOutput"},"overallHardStop":{"type":"integer","minimum":1,"maximum":3000}},"required":["asset","finance","geopolitics","markets","overallHardStop"],"additionalProperties":false},"articleKeywordExclusion":{"type":"object","properties":{"fields":{"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["TITLE","BODY"]}},"keywords":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["fields","keywords"],"additionalProperties":false},"qualityScoring":{"type":"object","properties":{"quality":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1},"weights":{"type":"object","properties":{"factualGrounding":{"type":"number","minimum":0},"neutrality":{"type":"number","minimum":0},"substance":{"type":"number","minimum":0}},"required":["factualGrounding","neutrality","substance"],"additionalProperties":false}},"required":["enabled","threshold","weights"],"additionalProperties":false},"relevance":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1},"weights":{"type":"object","properties":{"marketImpact":{"type":"number","minimum":0},"geopoliticalImpact":{"type":"number","minimum":0},"urgency":{"type":"number","minimum":0},"importance":{"type":"number","minimum":0}},"required":["marketImpact","geopoliticalImpact","urgency","importance"],"additionalProperties":false}},"required":["enabled","threshold","weights"],"additionalProperties":false}},"required":["quality","relevance"],"additionalProperties":false},"candidatePoolSize":{"type":"integer","minimum":1,"maximum":100},"categories":{"type":"array","items":{"type":"string"}},"cronEnabled":{"type":"boolean"},"minWordCount":{"type":"integer","minimum":0,"maximum":1000},"selectedArticlesPerRun":{"type":"integer","minimum":1,"maximum":50},"selectedStoriesPerRun":{"type":"integer","minimum":1,"maximum":50},"storiesEnabled":{"type":"boolean"},"topics":{"type":"array","items":{"type":"string"}}},"required":["articleLanes","articleKeywordExclusion","qualityScoring","candidatePoolSize","cronEnabled","minWordCount","selectedStoriesPerRun","storiesEnabled"],"additionalProperties":false},"PerigonArticleLaneOutput":{"type":"object","properties":{"enabled":{"type":"boolean"},"hardStop":{"type":"integer","minimum":1,"maximum":1000},"query":{"$ref":"#/components/schemas/PerigonArticleQueryOutput"},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"topics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["enabled","hardStop","query"],"additionalProperties":false},"PerigonArticleQueryOutput":{"type":"object","properties":{"areas":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"articleIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"authors":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"bylines":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"cities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"clusterIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"companyName":{"type":"string","maxLength":300},"companySymbols":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"content":{"type":"string","maxLength":2000},"counties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"countries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"description":{"type":"string","maxLength":2000},"excludeAuthors":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCategories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanyDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanyIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCompanySymbols":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeJournalistIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLabels":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLanguages":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeLocationsCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludePersonNames":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludePersonWikidataIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeSourceStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeTopics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"excludeWatchlists":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"journalistIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"labels":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"languages":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"latitude":{"type":"number","minimum":-90,"maximum":90},"linkTo":{"type":"string","maxLength":1000},"locations":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"locationsCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"longitude":{"type":"number","minimum":-180,"maximum":180},"maxDistanceKm":{"type":"number","minimum":0,"maximum":20000},"media":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"negativeSentimentFrom":{"type":"number","minimum":0,"maximum":1},"negativeSentimentTo":{"type":"number","minimum":0,"maximum":1},"neutralSentimentFrom":{"type":"number","minimum":0,"maximum":1},"neutralSentimentTo":{"type":"number","minimum":0,"maximum":1},"paywall":{"type":"string","enum":["ANY","FREE","PAYWALLED"]},"personNames":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"personWikidataIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"positiveSentimentFrom":{"type":"number","minimum":0,"maximum":1},"positiveSentimentTo":{"type":"number","minimum":0,"maximum":1},"prefixTaxonomy":{"type":"string","maxLength":500},"q":{"type":"string","maxLength":2000},"reprintGroupId":{"type":"string","maxLength":300},"searchTranslation":{"type":"boolean"},"showReprints":{"type":"boolean"},"sortBy":{"type":"string","enum":["relevance","date","reverseDate","reverseAddDate","addDate","pubDate","refreshDate"]},"sourceCities":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceCounties":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceCountries":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceDomains":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceGroups":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"sourceLatitude":{"type":"number","minimum":-90,"maximum":90},"sourceLongitude":{"type":"number","minimum":-180,"maximum":180},"sourceMaxDistanceKm":{"type":"number","minimum":0,"maximum":20000},"sourceStates":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"states":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"summary":{"type":"string","maxLength":2000},"taxonomies":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"title":{"type":"string","maxLength":2000},"topics":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"url":{"type":"string","maxLength":1000},"watchlists":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"required":["areas","articleIds","authors","bylines","categories","cities","clusterIds","companyDomains","companyIds","companyName","companySymbols","content","counties","countries","description","excludeAuthors","excludeCategories","excludeCities","excludeCompanyDomains","excludeCompanyIds","excludeCompanySymbols","excludeCounties","excludeJournalistIds","excludeLabels","excludeLanguages","excludeLocationsCountries","excludePersonNames","excludePersonWikidataIds","excludeSourceCities","excludeSourceCounties","excludeSourceCountries","excludeSourceDomains","excludeSourceGroups","excludeSourceStates","excludeStates","excludeTopics","excludeWatchlists","journalistIds","labels","languages","linkTo","locations","locationsCountries","media","paywall","personNames","personWikidataIds","prefixTaxonomy","q","reprintGroupId","searchTranslation","showReprints","sortBy","sourceCities","sourceCounties","sourceCountries","sourceDomains","sourceGroups","sourceStates","states","summary","taxonomies","title","topics","url","watchlists"],"additionalProperties":false},"QuestionnaireProgressionConfigOutput":{"type":"object","properties":{"tiers":{"minItems":1,"type":"array","items":{"type":"string","enum":["Basic","Advanced","MIFID","Conviction"]}},"kycEnabled":{"type":"boolean"}},"required":["tiers","kycEnabled"],"additionalProperties":false}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key for SDK/M2M authentication"}}}}