{"openapi":"3.1.0","info":{"title":"FiveSocket API","version":"0.1.0","description":"The REST API for live MetaTrader 5 account reads."},"servers":[{"url":"https://api.fivesocket.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"ApiReadiness":{"type":"object","properties":{"status":{"type":"string","enum":["ready","degraded","warming","unavailable"]},"checkedAt":{"type":"string"},"controlPlane":{"type":"object","properties":{"status":{"type":"string","enum":["ready","unavailable"]},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":"string"}},"required":["code","detail"],"additionalProperties":false}}},"required":["status"],"additionalProperties":false},"dataPlane":{"type":"object","properties":{"status":{"type":"string","enum":["ready","degraded","warming","unavailable"]},"region":{"type":["string","null"]},"readyRuntimes":{"type":"integer","minimum":0},"minimumWarmRuntimes":{"type":"integer","minimum":0},"rollout":{"type":"object","properties":{"staleRuntimes":{"type":"integer","minimum":0},"surge":{"type":"string","enum":["idle","preparing","active"]},"surgeRuntimes":{"type":"integer","minimum":0},"maxSurgeRuntimes":{"type":"integer","exclusiveMinimum":0},"stalled":{"type":"boolean"},"waiting":{"type":"boolean"},"lastSurgeFailure":{"type":["object","null"],"properties":{"class":{"type":"string","enum":["transient","terminal","ambiguous"]},"at":{"type":"string","format":"date-time"}},"required":["class","at"],"additionalProperties":false},"lastMigrationFailure":{"type":["object","null"],"properties":{"class":{"type":"string","enum":["transient","terminal","ambiguous"]},"at":{"type":"string","format":"date-time"}},"required":["class","at"],"additionalProperties":false}},"required":["staleRuntimes","surge","stalled","lastSurgeFailure","lastMigrationFailure"]},"runtimes":{"type":"array","items":{"type":"object","properties":{"runtimeId":{"type":"string","minLength":1,"description":"Response-local ordinal; does not identify a runtime across responses"},"lastSuccessfulAttachAt":{"type":["string","null"],"format":"date-time"},"lastAttachFailureAt":{"type":["string","null"],"format":"date-time"},"consecutiveAttachFailures":{"type":"integer","minimum":0},"attachDegraded":{"type":"boolean"},"durableDirectory":{"type":"string","enum":["available","unavailable","degraded"]}},"required":["runtimeId","lastSuccessfulAttachAt","lastAttachFailureAt","consecutiveAttachFailures","attachDegraded"],"additionalProperties":false}},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":"string"}},"required":["code","detail"],"additionalProperties":false}}},"required":["status","region","readyRuntimes","minimumWarmRuntimes","runtimes"],"additionalProperties":false},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"detail":{"type":"string"}},"required":["code","detail"],"additionalProperties":false}}},"required":["status","checkedAt","controlPlane","dataPlane"],"additionalProperties":false},"AccountExecutionConfiguration":{"type":"object","properties":{"accountId":{"type":"string"},"status":{"type":"string","enum":["enabled","disabled"]},"symbols":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","minLength":1,"maxLength":64},"maxVolume":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$","description":"Maximum volume for one exposure-increasing order submission."}},"required":["symbol","maxVolume"],"additionalProperties":false}},"updatedAt":{"type":"string","format":"date-time"}},"required":["accountId","status","symbols","updatedAt"],"additionalProperties":false},"ApiError":{"type":"object","properties":{"error":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","enum":["history_unsettled"]},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","properties":{"settledThrough":{"type":"string","format":"date-time"},"retryAfterSeconds":{"type":"integer","minimum":0},"nextEligibleAt":{"type":"string","format":"date-time"},"exportToken":{"type":"string"}},"required":["settledThrough","retryAfterSeconds","nextEligibleAt"],"additionalProperties":false}},"required":["code","message","requestId","details"],"additionalProperties":false},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","invalid_api_key","insufficient_scope","subscription_required","trial_required","account_link_required","account_not_found","account_disabled","account_slot_limit","trial_account_already_used","execution_disabled","execution_policy_violation","prop_program_not_set","prop_rule_would_breach","prop_guard_unavailable","order_not_found","position_not_found","commit_unknown","trade_rejected","server_not_found","broker_unreachable","credentials_rejected","read_only_credentials","account_warming","capacity_exhausted","rate_limit_exceeded","request_timeout","terminal_unhealthy","conflict","cursor_expired","history_offset_unavailable","candle_history_unavailable","symbol_not_found","insufficient_history","backtest_unsupported","control_plane_unavailable","internal_error"]},"billingUrl":{"type":"string","format":"uri"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","requestId"],"additionalProperties":false}]}},"required":["error"]},"ConfigureAccountExecutionRequest":{"type":"object","properties":{"symbols":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","minLength":1,"maxLength":64},"maxVolume":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$","description":"Maximum volume for one exposure-increasing order submission."}},"required":["symbol","maxVolume"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["symbols"],"additionalProperties":false},"ExecutionCapabilitiesObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"tradeAllowed":{"type":"boolean"},"tradeExpert":{"type":"boolean"},"tradeMode":{"type":"integer"},"marginMode":{"type":"integer"},"fifoClose":{"type":"boolean"},"limitOrders":{"type":"integer","minimum":0}},"required":["accountId","login","server","observedAt","latencyMs","tradeAllowed","tradeExpert","tradeMode","marginMode","fifoClose","limitOrders"],"additionalProperties":false},"WorkingOrdersObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string","enum":["buy","sell","buy_limit","sell_limit","buy_stop","sell_stop","buy_stop_limit","sell_stop_limit","close_by","other"]},"rawType":{"type":"integer"},"state":{"type":"string","enum":["started","placed","canceled","partial","filled","rejected","expired","request_add","request_modify","request_cancel","other"]},"rawState":{"type":"integer"},"volumeInitial":{"type":"string"},"volumeCurrent":{"type":"string"},"priceOpen":{"type":"string"},"stopLimitPrice":{"type":"string","description":"MT5 price_stoplimit: for a stop-limit order, the limit price placed when priceOpen triggers. Absent for other orders."},"stopLoss":{"type":"string"},"takeProfit":{"type":"string"},"setupAt":{"type":"string"},"doneAt":{"type":"string"},"magic":{"type":"string"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","other"]},"rawReason":{"type":"integer"},"comment":{"type":"string"}},"required":["id","positionId","symbol","type","rawType","state","rawState","volumeInitial","volumeCurrent","priceOpen","setupAt","magic","reason","rawReason"]}},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived"]}},"required":["accountId","login","server","observedAt","latencyMs","data","serverClockOffsetSeconds"],"additionalProperties":false},"OrderStatusObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"order":{"type":"object","properties":{"id":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string","enum":["buy","sell","buy_limit","sell_limit","buy_stop","sell_stop","buy_stop_limit","sell_stop_limit","close_by","other"]},"rawType":{"type":"integer"},"state":{"type":"string","enum":["started","placed","canceled","partial","filled","rejected","expired","request_add","request_modify","request_cancel","other"]},"rawState":{"type":"integer"},"volumeInitial":{"type":"string"},"volumeCurrent":{"type":"string"},"priceOpen":{"type":"string"},"stopLimitPrice":{"type":"string","description":"MT5 price_stoplimit: for a stop-limit order, the limit price placed when priceOpen triggers. Absent for other orders."},"stopLoss":{"type":"string"},"takeProfit":{"type":"string"},"setupAt":{"type":"string"},"doneAt":{"type":"string"},"magic":{"type":"string"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","other"]},"rawReason":{"type":"integer"},"comment":{"type":"string"}},"required":["id","positionId","symbol","type","rawType","state","rawState","volumeInitial","volumeCurrent","priceOpen","setupAt","magic","reason","rawReason"]},"deals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string","enum":["buy","sell","balance","credit","charge","correction","bonus","commission","commission_daily","commission_monthly","agent_daily","agent_monthly","interest","buy_canceled","sell_canceled","dividend","dividend_franked","tax","other"]},"rawType":{"type":"integer"},"entry":{"type":"string","enum":["in","out","inout","out_by","other"]},"rawEntry":{"type":"integer"},"volume":{"type":"string"},"price":{"type":"string"},"profit":{"type":"string"},"commission":{"type":"string"},"swap":{"type":"string"},"fee":{"type":"string"},"magic":{"type":"string"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","rollover","vmargin","split","other"]},"rawReason":{"type":"integer"},"comment":{"type":"string"},"time":{"type":"string"}},"required":["id","orderId","positionId","symbol","type","rawType","entry","rawEntry","volume","price","profit","commission","swap","fee","magic","reason","rawReason","time"]}},"source":{"type":"string","enum":["working","history"]},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived"]}},"required":["accountId","login","server","observedAt","latencyMs","order","deals","source","serverClockOffsetSeconds"],"additionalProperties":false},"ExecutionSymbolsObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"description":{"type":"string"},"digits":{"type":"integer"},"point":{"type":"string"},"contractSize":{"type":"string"},"tickSize":{"type":"string"},"tickValue":{"type":"string"},"currencyBase":{"type":"string"},"currencyProfit":{"type":"string"},"currencyMargin":{"type":"string"},"swapLong":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}]},"swapShort":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}]},"swapMode":{"anyOf":[{"type":"integer","minimum":0,"maximum":9},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 ENUM_SYMBOL_SWAP_MODE: 0 disabled, 1 points, 2 base currency, 3 margin currency, 4 deposit currency, 5 interest current, 6 interest open, 7 reopen current, 8 reopen bid, 9 profit currency."},"tripleRolloverDay":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 ENUM_DAY_OF_WEEK for SYMBOL_SWAP_ROLLOVER3DAYS: 0 Sunday through 6 Saturday."},"marginInitial":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 SYMBOL_MARGIN_INITIAL in margin-currency units. 0 means the broker sets no fixed initial margin."},"marginMaintenance":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 SYMBOL_MARGIN_MAINTENANCE in margin-currency units. 0 means the broker sets no fixed maintenance margin."},"marginHedged":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 SYMBOL_MARGIN_HEDGED: margin for the hedged volume, in margin-currency units."},"tradeCalcMode":{"anyOf":[{"type":"integer"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 ENUM_SYMBOL_CALC_MODE: 0 forex, 1 futures, 2 CFD, 3 CFD index, 4 CFD leverage, 5 forex no leverage, 32 exchange stocks, 33 exchange futures, 34 FORTS futures, 35 exchange bonds, 36 MOEX stocks, 37 MOEX bonds, 64 collateral."},"tickValueLoss":{"anyOf":[{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"},{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["not_reported","invalid_value","unknown_enum_value"]}},"required":["status","reason"],"additionalProperties":false}],"description":"MT5 SYMBOL_TRADE_TICK_VALUE_LOSS: the account-currency value of one tick of price movement against a position, at the current price."},"volumeMin":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"volumeMax":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"volumeStep":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"bid":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"ask":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"spreadPoints":{"type":"integer","minimum":0},"fillingMode":{"type":"integer"},"orderMode":{"type":"integer"},"tradeMode":{"type":"integer"},"tickObservedAt":{"type":"string","format":"date-time"}},"required":["symbol","digits","point","contractSize","tickSize","tickValue","currencyBase","currencyProfit","currencyMargin","swapLong","swapShort","swapMode","tripleRolloverDay","marginInitial","marginMaintenance","marginHedged","tradeCalcMode","tickValueLoss","volumeMin","volumeMax","volumeStep","bid","ask","spreadPoints","fillingMode","orderMode","tradeMode","tickObservedAt"],"additionalProperties":false}},"missing":{"type":"array","items":{"type":"string"}},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived"]}},"required":["accountId","login","server","observedAt","latencyMs","data","missing","serverClockOffsetSeconds"],"additionalProperties":false},"ExecutionCommand":{"type":"object","properties":{"commandId":{"type":"string","format":"uuid"},"operation":{"type":"string","enum":["order.submit","order.modify","order.cancel","position.modify","position.close"]},"outcome":{"type":"string","enum":["accepted","rejected","commit_unknown","unresolved"]},"status":{"type":"string","enum":["placed","filled","partially_filled","canceled","expired","modified","rejected","unknown"]},"retcode":{"type":["integer","null"]},"retcodeExternal":{"type":["integer","null"]},"retcodeDescription":{"type":"string"},"orderId":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"dealId":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"positionId":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"clientOrderId":{"type":"string","minLength":1,"maxLength":31,"pattern":"^[A-Za-z0-9._:-]+$","description":"Caller-defined execution identity, unique within a connected account."},"volume":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"price":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"bid":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"ask":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"recovered":{"type":"boolean"},"errorCode":{"type":["string","null"],"enum":["invalid_request","invalid_api_key","insufficient_scope","subscription_required","trial_required","account_link_required","account_not_found","account_disabled","account_slot_limit","trial_account_already_used","execution_disabled","execution_policy_violation","prop_program_not_set","prop_rule_would_breach","prop_guard_unavailable","order_not_found","position_not_found","commit_unknown","trade_rejected","server_not_found","broker_unreachable","credentials_rejected","read_only_credentials","account_warming","capacity_exhausted","rate_limit_exceeded","request_timeout","terminal_unhealthy","conflict","cursor_expired","history_unsettled","history_offset_unavailable","candle_history_unavailable","symbol_not_found","insufficient_history","backtest_unsupported","control_plane_unavailable","internal_error",null],"default":null,"description":"The gateway error code when the gateway refused the command before broker dispatch, otherwise null. A gateway refusal always has a null retcode."},"propRefusal":{"type":"object","properties":{"reason":{"type":"string","enum":["breached","unprotected_exposure","no_stop_loss","exceeds_room"],"description":"breached: an account sample already touched the rule's floor. unprotected_exposure: an open position or pending order on the account has no stop loss, so its risk has no limit. no_stop_loss: the order, or the change, leaves it without a stop loss. exceeds_room: the worst case at the stop loss reaches the room left once committedRisk is counted."},"rule":{"type":"string","enum":["daily_loss","max_loss"]},"roomLeft":{"type":"number","description":"Account currency left before the named rule is breached, as calculated when the order was checked, before committedRisk is subtracted."},"committedRisk":{"type":["number","null"],"description":"The combined loss if every other open position ran from its current price, and every other pending order from its entry price, to its stop loss. Null when one of them has no stop loss."},"worstCaseLoss":{"type":["number","null"],"description":"The order's estimated loss from entry to its stop loss, in account currency. A market order's entry includes its deviationPoints. Null when it has no stop loss. It excludes commission, swap, spread widening and gaps."},"currency":{"type":"string"},"breachedAt":{"type":"string","format":"date-time","description":"Present when the refusal is because an account sample already touched the rule's floor: for daily loss within the current firm day, for maximum loss while that breach still applies."},"suggestedStopLoss":{"type":"string","description":"A stop-loss price at or inside which the worst case fits the room left after committedRisk, keeping 10% of that room spare for commission and slippage. Absent when no stop fits at this volume."},"unprotected":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["position","order"]},"id":{"type":"string"}},"required":["kind","id"],"additionalProperties":false},"maxItems":10,"description":"For unprotected_exposure: up to 10 open positions and pending orders without a stop loss."},"hint":{"type":"string","description":"A short message an assistant can show the user."},"worstCaseBasis":{"type":"string","enum":["stop_loss","notional"],"description":"Legacy: present only on refusals stored before every order needed a stop loss. notional meant the order had no stop loss and was measured at its full position value."}},"required":["reason","rule","roomLeft","committedRisk","worstCaseLoss","currency","hint"],"additionalProperties":false,"description":"Present only when errorCode is prop_rule_would_breach: the prop-firm rule the order would breach, the room left, the order's estimated worst case and a hint for the user."},"observedAt":{"type":"string","format":"date-time"},"latencyMs":{"type":"number","minimum":0}},"required":["commandId","operation","outcome","status","retcode","retcodeExternal","retcodeDescription","volume","price","recovered","observedAt","latencyMs"],"additionalProperties":false},"CreateOrderRequest":{"type":"object","properties":{"clientOrderId":{"type":"string","minLength":1,"maxLength":31,"pattern":"^[A-Za-z0-9._:-]+$","description":"Caller-defined execution identity, unique within a connected account."},"symbol":{"type":"string","minLength":1,"maxLength":64},"side":{"type":"string","enum":["buy","sell"]},"type":{"type":"string","enum":["market","limit","stop","stop_limit"]},"volume":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"price":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"stopLimitPrice":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"stopLoss":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"takeProfit":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"deviationPoints":{"type":"integer","minimum":0,"maximum":10000,"default":20},"magic":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","default":"0"},"fillPolicy":{"type":"string","enum":["auto","fok","ioc","return","boc"],"default":"auto"},"timeInForce":{"type":"string","enum":["gtc","day","specified","specified_day"],"default":"gtc"},"expiresAt":{"type":"string","format":"date-time"}},"required":["clientOrderId","symbol","side","type","volume"],"additionalProperties":false},"ModifyOrderRequest":{"type":"object","properties":{"price":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"stopLimitPrice":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"stopLoss":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},{"type":"null"}]},"takeProfit":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},{"type":"null"}]},"timeInForce":{"type":"string","enum":["gtc","day","specified","specified_day"]},"expiresAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"ModifyPositionRequest":{"type":"object","properties":{"stopLoss":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},{"type":"null"}]},"takeProfit":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},{"type":"null"}]}},"additionalProperties":false},"ClosePositionRequest":{"type":"object","properties":{"clientOrderId":{"type":"string","minLength":1,"maxLength":31,"pattern":"^[A-Za-z0-9._:-]+$","description":"Caller-defined execution identity, unique within a connected account."},"volume":{"type":"string","pattern":"^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"},"deviationPoints":{"type":"integer","minimum":0,"maximum":10000,"default":20},"fillPolicy":{"type":"string","enum":["auto","fok","ioc","return"],"default":"auto"}},"required":["clientOrderId"],"additionalProperties":false},"ServerVerification":{"type":"object","properties":{"server":{"type":"string"},"status":{"type":"string","enum":["resolved","not_found"]},"terminalBuild":{"type":["string","null"]},"region":{"type":"string"},"workerImageDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"suggestions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":96},"maxItems":25,"description":"When status is not_found: server names MT5 offered during this lookup, plus servers already proven, that match the broker you typed. Verify the one you choose before linking."}},"required":["server","status","terminalBuild","region","workerImageDigest","observedAt","latencyMs"]},"ServerVerificationStreamEvent":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["pending"]},"server":{"type":"string"},"requestId":{"type":"string","description":"The verification's request ID. If the stream drops before a result, read the finished verification from GET /v1/server-verifications/{requestId}."},"pendingAt":{"type":"string"}},"required":["type","server","requestId","pendingAt"]},{"type":"object","properties":{"type":{"type":"string","enum":["result"]},"verification":{"type":"object","properties":{"server":{"type":"string"},"status":{"type":"string","enum":["resolved","not_found"]},"terminalBuild":{"type":["string","null"]},"region":{"type":"string"},"workerImageDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"suggestions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":96},"maxItems":25,"description":"When status is not_found: server names MT5 offered during this lookup, plus servers already proven, that match the broker you typed. Verify the one you choose before linking."}},"required":["server","status","terminalBuild","region","workerImageDigest","observedAt","latencyMs"]}},"required":["type","verification"]},{"type":"object","properties":{"type":{"type":"string","enum":["error"]},"error":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","enum":["history_unsettled"]},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","properties":{"settledThrough":{"type":"string","format":"date-time"},"retryAfterSeconds":{"type":"integer","minimum":0},"nextEligibleAt":{"type":"string","format":"date-time"},"exportToken":{"type":"string"}},"required":["settledThrough","retryAfterSeconds","nextEligibleAt"],"additionalProperties":false}},"required":["code","message","requestId","details"],"additionalProperties":false},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","invalid_api_key","insufficient_scope","subscription_required","trial_required","account_link_required","account_not_found","account_disabled","account_slot_limit","trial_account_already_used","execution_disabled","execution_policy_violation","prop_program_not_set","prop_rule_would_breach","prop_guard_unavailable","order_not_found","position_not_found","commit_unknown","trade_rejected","server_not_found","broker_unreachable","credentials_rejected","read_only_credentials","account_warming","capacity_exhausted","rate_limit_exceeded","request_timeout","terminal_unhealthy","conflict","cursor_expired","history_offset_unavailable","candle_history_unavailable","symbol_not_found","insufficient_history","backtest_unsupported","control_plane_unavailable","internal_error"]},"billingUrl":{"type":"string","format":"uri"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","requestId"],"additionalProperties":false}]}},"required":["type","error"]}]},"ServerVerificationRequest":{"type":"object","properties":{"server":{"type":"string","minLength":1,"maxLength":160}},"required":["server"]},"LinkedAccountCreated":{"type":"object","properties":{"id":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"status":{"type":"string","enum":["pending","active","invalid","disabled"]},"readOnly":{"type":"boolean","default":false,"description":"True when MT5 reported, at the last link or enable-trading check, that this login cannot trade: it was linked with the investor (read-only) password, or the broker disabled trading. Trading requests are refused with read_only_credentials. Reads are unaffected."},"createdAt":{"type":"string"},"verified":{"type":"object","properties":{"balance":{"type":"string"},"equity":{"type":"string"},"currency":{"type":"string"}},"required":["balance","equity","currency"]}},"required":["id","login","server","status","createdAt"]},"AccountCredentials":{"type":"object","properties":{"login":{"type":"string","minLength":1,"maxLength":32},"password":{"type":"string","minLength":1,"maxLength":256},"server":{"type":"string","minLength":1,"maxLength":160}},"required":["login","password","server"]},"AccountList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"status":{"type":"string","enum":["pending","active","invalid","disabled"]},"readOnly":{"type":"boolean","default":false,"description":"True when MT5 reported, at the last link or enable-trading check, that this login cannot trade: it was linked with the investor (read-only) password, or the broker disabled trading. Trading requests are refused with read_only_credentials. Reads are unaffected."},"createdAt":{"type":"string"}},"required":["id","login","server","status","createdAt"]}}},"required":["data"]},"Balance":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"balance":{"type":"string"},"equity":{"type":"string"},"currency":{"type":"string"},"credit":{"type":"string"},"margin":{"type":"string"},"marginFree":{"type":"string"},"profit":{"type":"string"},"leverage":{"type":"string"},"name":{"type":"string"},"company":{"type":"string"}},"required":["accountId","login","server","observedAt","latencyMs","balance","equity","currency","credit","margin","marginFree","profit","leverage","name","company"]},"PositionsObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"positions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"identifier":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"symbol":{"type":"string"},"side":{"type":"string","enum":["buy","sell"]},"volume":{"type":"string"},"openPrice":{"type":"string"},"currentPrice":{"type":"string"},"profit":{"type":"string"},"openedAt":{"type":"string"},"stopLoss":{"type":"string"},"takeProfit":{"type":"string"},"swap":{"type":"string"},"magic":{"type":"string"},"comment":{"type":"string"}},"required":["id","symbol","side","volume","openPrice","currentPrice","profit","openedAt","swap","magic"]}},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived"]}},"required":["accountId","login","server","observedAt","latencyMs","positions","serverClockOffsetSeconds"]},"TradesObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"side":{"type":"string","enum":["buy","sell"]},"volume":{"type":"string"},"closePrice":{"type":"string"},"profit":{"type":"string"},"commission":{"type":"string"},"swap":{"type":"string"},"fee":{"type":"string"},"magic":{"type":"string"},"entry":{"type":"string","enum":["in","out","inout","out_by","other"]},"rawEntry":{"type":"integer"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","rollover","vmargin","split","other"]},"rawReason":{"type":"integer"},"closedAt":{"type":"string"}},"required":["id","orderId","positionId","symbol","side","volume","closePrice","profit","commission","swap","fee","magic","entry","rawEntry","reason","rawReason","closedAt"]}},"nextCursor":{"type":["string","null"]},"historySynced":{"type":"boolean"},"historyState":{"type":"string","enum":["converged","unsettled"]},"settledThrough":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived","inherited",null]}},"required":["accountId","login","server","observedAt","latencyMs","data","nextCursor","historySynced","serverClockOffsetSeconds"]},"DealsObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string","enum":["buy","sell","balance","credit","charge","correction","bonus","commission","commission_daily","commission_monthly","agent_daily","agent_monthly","interest","buy_canceled","sell_canceled","dividend","dividend_franked","tax","other"]},"rawType":{"type":"integer"},"entry":{"type":"string","enum":["in","out","inout","out_by","other"]},"rawEntry":{"type":"integer"},"volume":{"type":"string"},"price":{"type":"string"},"profit":{"type":"string"},"commission":{"type":"string"},"swap":{"type":"string"},"fee":{"type":"string"},"magic":{"type":"string"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","rollover","vmargin","split","other"]},"rawReason":{"type":"integer"},"comment":{"type":"string"},"time":{"type":"string"}},"required":["id","orderId","positionId","symbol","type","rawType","entry","rawEntry","volume","price","profit","commission","swap","fee","magic","reason","rawReason","time"]}},"nextCursor":{"type":["string","null"]},"historySynced":{"type":"boolean"},"historyState":{"type":"string","enum":["converged","unsettled"]},"settledThrough":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived","inherited",null]}},"required":["accountId","login","server","observedAt","latencyMs","data","nextCursor","historySynced","serverClockOffsetSeconds"]},"OrdersObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string","enum":["buy","sell","buy_limit","sell_limit","buy_stop","sell_stop","buy_stop_limit","sell_stop_limit","close_by","other"]},"rawType":{"type":"integer"},"state":{"type":"string","enum":["started","placed","canceled","partial","filled","rejected","expired","request_add","request_modify","request_cancel","other"]},"rawState":{"type":"integer"},"volumeInitial":{"type":"string"},"volumeCurrent":{"type":"string"},"priceOpen":{"type":"string"},"stopLimitPrice":{"type":"string","description":"MT5 price_stoplimit: for a stop-limit order, the limit price placed when priceOpen triggers. Absent for other orders."},"stopLoss":{"type":"string"},"takeProfit":{"type":"string"},"setupAt":{"type":"string"},"doneAt":{"type":"string"},"magic":{"type":"string"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","other"]},"rawReason":{"type":"integer"},"comment":{"type":"string"}},"required":["id","positionId","symbol","type","rawType","state","rawState","volumeInitial","volumeCurrent","priceOpen","setupAt","magic","reason","rawReason"]}},"nextCursor":{"type":["string","null"]},"historySynced":{"type":"boolean"},"historyState":{"type":"string","enum":["converged","unsettled"]},"settledThrough":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived","inherited",null]}},"required":["accountId","login","server","observedAt","latencyMs","data","nextCursor","historySynced","serverClockOffsetSeconds"]},"SymbolsObservation":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"description":{"type":"string"},"digits":{"type":"integer"},"point":{"type":"string"},"contractSize":{"type":"string"},"tickSize":{"type":"string"},"tickValue":{"type":"string"},"currencyBase":{"type":"string"},"currencyProfit":{"type":"string"},"currencyMargin":{"type":"string"}},"required":["symbol","digits","point","contractSize","tickSize","tickValue","currencyBase","currencyProfit","currencyMargin"]}},"missing":{"type":"array","items":{"type":"string"}}},"required":["accountId","login","server","observedAt","latencyMs","data","missing"]},"Snapshot":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"balance":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"balance":{"type":"string"},"equity":{"type":"string"},"currency":{"type":"string"},"credit":{"type":"string"},"margin":{"type":"string"},"marginFree":{"type":"string"},"profit":{"type":"string"},"leverage":{"type":"string"},"name":{"type":"string"},"company":{"type":"string"}},"required":["accountId","login","server","observedAt","latencyMs","balance","equity","currency","credit","margin","marginFree","profit","leverage","name","company"]},"positions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"identifier":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"symbol":{"type":"string"},"side":{"type":"string","enum":["buy","sell"]},"volume":{"type":"string"},"openPrice":{"type":"string"},"currentPrice":{"type":"string"},"profit":{"type":"string"},"openedAt":{"type":"string"},"stopLoss":{"type":"string"},"takeProfit":{"type":"string"},"swap":{"type":"string"},"magic":{"type":"string"},"comment":{"type":"string"}},"required":["id","symbol","side","volume","openPrice","currentPrice","profit","openedAt","swap","magic"]}},"recentTrades":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"symbol":{"type":"string"},"side":{"type":"string","enum":["buy","sell"]},"volume":{"type":"string"},"closePrice":{"type":"string"},"profit":{"type":"string"},"commission":{"type":"string"},"swap":{"type":"string"},"fee":{"type":"string"},"magic":{"type":"string"},"entry":{"type":"string","enum":["in","out","inout","out_by","other"]},"rawEntry":{"type":"integer"},"reason":{"type":"string","enum":["client","mobile","web","expert","sl","tp","so","rollover","vmargin","split","other"]},"rawReason":{"type":"integer"},"closedAt":{"type":"string"}},"required":["id","orderId","positionId","symbol","side","volume","closePrice","profit","commission","swap","fee","magic","entry","rawEntry","reason","rawReason","closedAt"]}},"nextCursor":{"type":["string","null"]},"historySynced":{"type":"boolean"},"historyState":{"type":"string","enum":["converged","unsettled"]},"settledThrough":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived","inherited",null]}},"required":["data","nextCursor"]},"historySynced":{"type":"boolean"},"historyState":{"type":"string","enum":["converged","unsettled"]},"settledThrough":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]},"serverClockOffsetSource":{"type":["string","null"],"enum":["derived","inherited",null]}},"required":["accountId","login","server","observedAt","latencyMs","balance","positions","recentTrades","historySynced","serverClockOffsetSeconds"]},"PropStatus":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"program":{"type":"object","properties":{"initialBalance":{"type":"string","pattern":"^[1-9][0-9]{0,11}(?:\\.[0-9]{1,2})?$","description":"The account size the program was bought at, in account currency."},"preset":{"type":"object","properties":{"firm":{"type":"string","enum":["ftmo","fundednext","the5ers"]},"firmName":{"type":"string"},"program":{"type":"string"},"programName":{"type":"string"},"lastVerified":{"type":"string","format":"date"},"sources":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1},"resetClock":{"type":"object","properties":{"timeZone":{"type":"string"},"hour":{"type":"integer","minimum":0,"maximum":23},"minute":{"type":"integer","minimum":0,"maximum":59},"basis":{"type":"string","enum":["firm_time","server_midnight"],"description":"firm_time resets at the stated wall time in timeZone. server_midnight resets at 00:00 on the MT5 server clock; timeZone is the assumed equivalent and the observed server clock offset wins when they differ."}},"required":["timeZone","hour","minute","basis"],"additionalProperties":false},"dailyLoss":{"type":["object","null"],"properties":{"percent":{"type":"number","exclusiveMinimum":0},"percentOf":{"type":"string","enum":["initial_balance","anchor"]},"anchor":{"type":"string","enum":["start_of_day_balance","higher_of_balance_or_equity"]},"sameDayProfit":{"type":"string","enum":["adds_room","capped_at_limit"],"description":"adds_room: profit made since the reset raises the amount that can still be lost today. capped_at_limit: the room never exceeds the daily limit."}},"required":["percent","percentOf","anchor","sameDayProfit"],"additionalProperties":false},"maxLoss":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["static"]},"percent":{"type":"number","exclusiveMinimum":0},"measure":{"type":"string","enum":["equity","lower_of_balance_or_equity"]}},"required":["type","percent","measure"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["trailing"]},"percent":{"type":"number","exclusiveMinimum":0},"measure":{"type":"string","enum":["equity","lower_of_balance_or_equity"]},"basis":{"type":"string","enum":["end_of_day_balance","intraday_balance","intraday_equity"]},"lockAtInitialBalance":{"type":"boolean"}},"required":["type","percent","measure","basis","lockAtInitialBalance"],"additionalProperties":false}]},"phases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"profitTargetPercent":{"type":["number","null"],"exclusiveMinimum":0}},"required":["id","name","profitTargetPercent"],"additionalProperties":false},"minItems":1},"unverified":{"type":"array","items":{"type":"string"}}},"required":["firm","firmName","program","programName","lastVerified","sources","resetClock","dailyLoss","maxLoss","phases","unverified"],"additionalProperties":false}},"required":["initialBalance","preset"],"additionalProperties":false,"description":"Durable control-plane state: the program the user set for this account and the published rule preset it maps to."},"source":{"type":"object","properties":{"balance":{"type":"string"},"equity":{"type":"string"},"currency":{"type":"string"},"dealCount":{"type":"integer","minimum":0},"historyFrom":{"type":"string","format":"date-time"},"historySynced":{"type":"boolean"},"serverClockOffsetSeconds":{"type":["integer","null"]}},"required":["balance","equity","currency","dealCount","historyFrom","historySynced","serverClockOffsetSeconds"],"additionalProperties":false,"description":"Live MT5 source data the calculation read."},"calculated":{"type":"object","properties":{"evaluatedAt":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["ok","near_breach","breached"]},"roomLeftToday":{"type":"number","description":"The smaller of the daily-loss room and the maximum-loss room."},"bindingRule":{"type":"string","enum":["daily_loss","max_loss"]},"dailyLoss":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["ok","near_breach","breached"]},"limit":{"type":"number"},"anchor":{"type":"number"},"anchorBasis":{"type":"string","enum":["balance","equity"]},"anchorSource":{"type":"string","enum":["deal_history","snapshot","estimated"]},"floor":{"type":"number","description":"Equity at or below this level breaches the daily loss rule."},"roomLeft":{"type":"number"},"usedPercent":{"type":"number"},"breachedAt":{"type":["string","null"],"format":"date-time","default":null,"description":"Time of the first account sample at or below the floor in the current firm day, or null. A breach between two samples is not seen."},"closedProfitToday":{"type":"number"},"floatingProfit":{"type":"number"},"lastResetAt":{"type":"string","format":"date-time"},"nextResetAt":{"type":"string","format":"date-time"},"resetClockSource":{"type":"string","enum":["preset_timezone","server_clock"]}},"required":["state","limit","anchor","anchorBasis","anchorSource","floor","roomLeft","usedPercent","closedProfitToday","floatingProfit","lastResetAt","nextResetAt","resetClockSource"],"additionalProperties":false},"maxLoss":{"type":"object","properties":{"state":{"type":"string","enum":["ok","near_breach","breached"]},"type":{"type":"string","enum":["static","trailing"]},"limit":{"type":"number"},"highWaterMark":{"type":"number"},"highWaterMarkSource":{"type":"string","enum":["initial_balance","deal_history","snapshots","estimated"]},"floor":{"type":"number"},"lockedAtInitialBalance":{"type":"boolean"},"roomLeft":{"type":"number"},"usedPercent":{"type":"number"},"breachedAt":{"type":["string","null"],"format":"date-time","default":null,"description":"Time of the first account sample at or below the floor in force at that time since the program was set, or null. Once set it stays set until the program is changed. A breach between two samples is not seen."}},"required":["state","type","limit","highWaterMark","highWaterMarkSource","floor","lockedAtInitialBalance","roomLeft","usedPercent"],"additionalProperties":false},"profitTargets":{"type":"array","items":{"type":"object","properties":{"phase":{"type":"string"},"phaseName":{"type":"string"},"targetPercent":{"type":"number"},"targetBalance":{"type":"number"},"progress":{"type":"number","description":"The lower of balance and equity, minus the initial balance, so open losses count against progress."},"progressPercent":{"type":"number"},"remaining":{"type":"number"},"reached":{"type":"boolean","description":"True only when both balance and equity are at or above targetBalance. Firms usually also require every position to be closed."}},"required":["phase","phaseName","targetPercent","targetBalance","progress","progressPercent","remaining","reached"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"string","enum":["reset_equity_unobserved","reset_clock_from_server_offset","server_clock_offset_unavailable","daily_anchor_history_incomplete","high_water_mark_history_incomplete","equity_high_water_mark_sampled"]}}},"required":["evaluatedAt","state","roomLeftToday","bindingRule","dailyLoss","maxLoss","profitTargets","notes"],"additionalProperties":false,"description":"FiveSocket-calculated values from the preset and the source data. The firm's own dashboard is authoritative."}},"required":["accountId","login","server","observedAt","latencyMs","program","source","calculated"],"additionalProperties":false},"BacktestRun":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"source":{"type":"object","properties":{"currency":{"type":"string","minLength":1},"leverage":{"type":"number","exclusiveMinimum":0},"instrument":{"type":"object","properties":{"symbol":{"type":"string","minLength":1},"point":{"type":"number","exclusiveMinimum":0},"contractSize":{"type":"number","exclusiveMinimum":0},"tickSize":{"type":"number","exclusiveMinimum":0},"tickValue":{"type":"number","exclusiveMinimum":0},"volumeMin":{"type":"number","exclusiveMinimum":0},"volumeMax":{"type":"number","exclusiveMinimum":0},"volumeStep":{"type":"number","exclusiveMinimum":0},"swapLong":{"type":"number"},"swapShort":{"type":"number"},"swapMode":{"type":"integer","minimum":0,"maximum":9},"tripleRolloverDay":{"type":["integer","null"],"minimum":0,"maximum":6}},"required":["symbol","point","contractSize","tickSize","tickValue","volumeMin","volumeMax","volumeStep","swapLong","swapShort","swapMode","tripleRolloverDay"],"additionalProperties":false},"instrumentObservedAt":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":["integer","null"]}},"required":["currency","leverage","instrument","instrumentObservedAt","serverClockOffsetSeconds"],"additionalProperties":false,"description":"Live MT5 source data the run read: the account currency and leverage, and the symbol's current contract, swap and tick-value facts. The candles themselves are not returned."},"calculated":{"type":"object","properties":{"metadata":{"type":"object","properties":{"symbol":{"type":"string","minLength":1},"timeframe":{"type":"string","enum":["M1","M5","M15","H1","H4","D1"]},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"bars":{"type":"integer","minimum":0},"firstBarTime":{"type":["string","null"],"format":"date-time"},"lastBarTime":{"type":["string","null"],"format":"date-time"},"currency":{"type":"string","minLength":1},"historicalSpread":{"type":"string","enum":["approximated"]},"fillModel":{"type":"string","enum":["next_bar_open"]},"intrabarOrder":{"type":"string","enum":["stop_before_target"]},"commissionIncluded":{"type":"boolean"}},"required":["symbol","timeframe","from","to","bars","firstBarTime","lastBarTime","currency","historicalSpread","fillModel","intrabarOrder","commissionIncluded"],"additionalProperties":false},"metrics":{"type":"object","properties":{"trades":{"type":"integer","minimum":0},"wins":{"type":"integer","minimum":0},"losses":{"type":"integer","minimum":0},"winRate":{"type":["number","null"],"minimum":0,"maximum":1},"profitFactor":{"type":["number","null"],"minimum":0},"grossProfit":{"type":"number"},"grossLoss":{"type":"number"},"netProfit":{"type":"number"},"returnPercent":{"type":"number"},"finalBalance":{"type":"number"},"maxDrawdown":{"type":"number","minimum":0},"maxDrawdownPercent":{"type":"number","minimum":0},"averageNetR":{"type":["number","null"]}},"required":["trades","wins","losses","winRate","profitFactor","grossProfit","grossLoss","netProfit","returnPercent","finalBalance","maxDrawdown","maxDrawdownPercent","averageNetR"],"additionalProperties":false},"costs":{"type":"object","properties":{"spread":{"type":"number"},"swap":{"type":"number"},"commission":{"type":"number"},"total":{"type":"number"}},"required":["spread","swap","commission","total"],"additionalProperties":false},"skippedSignals":{"type":"object","properties":{"position_open":{"type":"integer","minimum":0},"no_balance":{"type":"integer","minimum":0},"drawdown_halt":{"type":"integer","minimum":0},"lot_size":{"type":"integer","minimum":0}},"required":["position_open","no_balance","drawdown_halt","lot_size"],"additionalProperties":false},"equityCurve":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"balance":{"type":"number"}},"required":["time","balance"],"additionalProperties":false},"description":"Balance at trade closes, downsampled to at most 50 points. Use metrics.maxDrawdown for the worst drop; a downsampled curve can miss it."},"trades":{"type":"array","items":{"type":"object","properties":{"side":{"type":"string","enum":["long","short"]},"entryTime":{"type":"string","format":"date-time"},"exitTime":{"type":"string","format":"date-time"},"entryPrice":{"type":"number"},"exitPrice":{"type":"number"},"stopDistance":{"type":"number","exclusiveMinimum":0},"exitReason":{"type":"string","enum":["stop","target","signal","reverse","end"]},"lots":{"type":"number","exclusiveMinimum":0},"riskAmount":{"type":"number"},"rollovers":{"type":"integer","minimum":0},"priceProfit":{"type":"number"},"costs":{"type":"object","properties":{"spread":{"type":"number"},"swap":{"type":"number"},"commission":{"type":"number"}},"required":["spread","swap","commission"],"additionalProperties":false},"netProfit":{"type":"number"},"netR":{"type":"number"},"balanceAfter":{"type":"number"}},"required":["side","entryTime","exitTime","entryPrice","exitPrice","stopDistance","exitReason","lots","riskAmount","rollovers","priceProfit","costs","netProfit","netR","balanceAfter"],"additionalProperties":false},"maxItems":500},"tradesTruncated":{"type":"boolean"},"assumptions":{"type":"array","items":{"type":"string","minLength":1}}},"required":["metadata","metrics","costs","skippedSignals","equityCurve","assumptions"],"additionalProperties":false,"description":"FiveSocket-calculated values. A backtest is a simulation over past bars, not a forecast."},"propOverlay":{"type":["object","null"],"properties":{"firm":{"type":"string","enum":["ftmo","fundednext","the5ers"]},"firmName":{"type":"string"},"program":{"type":"string"},"programName":{"type":"string"},"lastVerified":{"type":"string","format":"date"},"sources":{"type":"array","items":{"type":"string","format":"uri"}},"initialBalance":{"type":"number","exclusiveMinimum":0,"description":"The backtest's initial balance, used as the program size. Percent rules scale with it."},"verdict":{"type":"string","enum":["target_reached","breached","neither"],"description":"An estimate from bar data. The evaluation ends at the first estimated breach or when the first profit target is reached on closed balance, whichever comes first. neither means the run ended before both."},"breach":{"type":["object","null"],"properties":{"rule":{"type":"string","enum":["daily_loss","max_loss"]},"time":{"type":"string","format":"date-time"},"balance":{"type":"number"},"equity":{"type":"number","description":"The estimated equity that touched the floor. Equal to balance when no trade was open."},"floor":{"type":"number"},"basis":{"type":"string","enum":["closed_balance","worst_case_floating","reset_mark"],"description":"closed_balance: a trade close. worst_case_floating: the worst price of a bar while a trade was open, capped at the stop. reset_mark: the open trade marked at a firm reset."}},"required":["rule","time","balance","equity","floor","basis"],"additionalProperties":false},"profitTarget":{"type":["object","null"],"properties":{"phase":{"type":"string"},"phaseName":{"type":"string"},"targetPercent":{"type":"number"},"targetBalance":{"type":"number"},"reachedAt":{"type":["string","null"],"format":"date-time"}},"required":["phase","phaseName","targetPercent","targetBalance","reachedAt"],"additionalProperties":false},"smallestDailyLossMargin":{"type":["number","null"],"description":"The smallest distance between estimated equity and that day's daily-loss floor, over every bar of an open trade, every firm reset and every trade close. Null when the program has no daily-loss rule."},"smallestMaxLossMargin":{"type":"number","description":"The smallest distance between the measured value and the maximum-loss floor, over the same samples."},"daysEvaluated":{"type":"integer","minimum":0},"notes":{"type":"array","items":{"type":"string","enum":["reset_equity_unobserved","reset_clock_from_server_offset","server_clock_offset_unavailable","daily_anchor_history_incomplete","high_water_mark_history_incomplete","equity_high_water_mark_sampled"]}},"limits":{"type":"array","items":{"type":"string","minLength":1}}},"required":["firm","firmName","program","programName","lastVerified","sources","initialBalance","verdict","breach","profitTarget","smallestDailyLossMargin","smallestMaxLossMargin","daysEvaluated","notes","limits"],"additionalProperties":false,"description":"Present when the user has set a prop-firm program for the account: an estimate, from bar data, of how the same run would have fared against that program's daily-loss, maximum-loss and profit-target rules. A run that stays inside the limits here can still fail live."}},"required":["accountId","login","server","source","calculated","propOverlay"],"additionalProperties":false},"BacktestRequest":{"type":"object","properties":{"rule":{"type":"object","properties":{"symbol":{"type":"string","minLength":1,"maxLength":64},"timeframe":{"type":"string","enum":["M1","M5","M15","H1","H4","D1"]},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"entries":{"type":"array","items":{"type":"object","properties":{"side":{"type":"string","enum":["long","short"]},"when":{"$ref":"#/components/schemas/BacktestCondition"},"exit":{"$ref":"#/components/schemas/BacktestCondition"}},"required":["side","when"],"additionalProperties":false},"minItems":1,"maxItems":2},"stop":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["atr"]},"period":{"type":"integer","minimum":1,"maximum":1000},"multiple":{"type":"number","exclusiveMinimum":0,"maximum":100}},"required":["kind","period","multiple"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["percent"]},"value":{"type":"number","exclusiveMinimum":0,"maximum":50}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["price"]},"distance":{"type":"number","exclusiveMinimum":0}},"required":["kind","distance"],"additionalProperties":false}]},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["riskMultiple"]},"value":{"type":"number","exclusiveMinimum":0,"maximum":100}},"required":["kind","value"],"additionalProperties":false},"risk":{"type":"object","properties":{"kind":{"type":"string","enum":["percentOfBalance"]},"value":{"type":"number","exclusiveMinimum":0,"maximum":100}},"required":["kind","value"],"additionalProperties":false},"initialBalance":{"type":"number","exclusiveMinimum":0}},"required":["symbol","timeframe","from","to","entries","stop","risk","initialBalance"],"additionalProperties":false},"costs":{"type":"object","properties":{"commissionPerLotRoundTrip":{"type":"number","minimum":0},"spreadFloorPoints":{"type":"number","minimum":0,"default":0},"costMultiplier":{"type":"number","minimum":1,"maximum":10,"default":1}},"additionalProperties":false},"includeTrades":{"type":"boolean","default":false,"description":"Return the first 500 trades as well as the summary."}},"required":["rule"],"additionalProperties":false},"BacktestCondition":{"anyOf":[{"$ref":"#/components/schemas/BacktestComparison"},{"type":"object","properties":{"kind":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/BacktestComparison"},"minItems":2,"maxItems":8}},"required":["kind","conditions"],"additionalProperties":false}]},"BacktestComparison":{"type":"object","properties":{"kind":{"type":"string","enum":["crossesAbove","crossesBelow","above","below"]},"left":{"$ref":"#/components/schemas/BacktestSeries"},"right":{"$ref":"#/components/schemas/BacktestSeries"}},"required":["kind","left","right"],"additionalProperties":false},"BacktestSeries":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["price"]},"field":{"type":"string","enum":["open","high","low","close"]}},"required":["kind","field"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["constant"]},"value":{"type":"number"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["sma"]},"period":{"type":"integer","minimum":1,"maximum":1000},"source":{"type":"string","enum":["open","high","low","close"],"default":"close"}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["ema"]},"period":{"type":"integer","minimum":1,"maximum":1000},"source":{"type":"string","enum":["open","high","low","close"],"default":"close"}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["rsi"]},"period":{"type":"integer","minimum":1,"maximum":1000},"source":{"type":"string","enum":["open","high","low","close"],"default":"close"}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["atr"]},"period":{"type":"integer","minimum":1,"maximum":1000}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["highest"]},"period":{"type":"integer","minimum":1,"maximum":1000},"source":{"type":"string","enum":["open","high","low","close"],"default":"high"}},"required":["kind","period"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["lowest"]},"period":{"type":"integer","minimum":1,"maximum":1000},"source":{"type":"string","enum":["open","high","low","close"],"default":"low"}},"required":["kind","period"],"additionalProperties":false}]}},"parameters":{}},"paths":{"/ready":{"get":{"responses":{"200":{"description":"The service is ready, or degraded while serving with partial runtime capacity or degraded attach evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiReadiness"}}}},"503":{"description":"The service is warming with no serving runtime, or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiReadiness"}}}}}}},"/v1/accounts/{accountId}/execution":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Account execution policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExecutionConfiguration"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureAccountExecutionRequest"}}}},"responses":{"200":{"description":"Execution enabled after MT5 capability verification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountExecutionConfiguration"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"Execution disabled"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/capabilities":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Live MT5 account execution capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCapabilitiesObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/orders":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Working orders from the live MT5 account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingOrdersObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/orders/{orderId}":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"required":true,"name":"orderId","in":"path"}],"responses":{"200":{"description":"Working or historical MT5 order with its deals","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatusObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"required":true,"name":"orderId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyOrderRequest"}}}},"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"required":true,"name":"orderId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/symbols":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Optional comma-separated list of exact MT5 symbols to inspect."},"required":false,"description":"Optional comma-separated list of exact MT5 symbols to inspect.","name":"symbols","in":"query"}],"responses":{"200":{"description":"Live prices and executable constraints for policy-allowed symbols","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionSymbolsObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/positions/{positionId}":{"patch":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"required":true,"name":"positionId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyPositionRequest"}}}},"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/positions/{positionId}/close":{"post":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$"},"required":true,"name":"positionId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePositionRequest"}}}},"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/execution/commands/{commandId}":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"commandId","in":"path"}],"responses":{"200":{"description":"The broker command reached a confirmed terminal outcome","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"202":{"description":"The broker commit is not yet known and can be reconciled by command ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCommand"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/server-verifications":{"post":{"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerVerificationRequest"}}}},"responses":{"200":{"description":"A completed verification, or newline-delimited pending and terminal events when verification exceeds two seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerVerification"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/ServerVerificationStreamEvent"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/server-verifications/{requestId}":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"requestId","in":"path"}],"responses":{"200":{"description":"The verification started by POST /v1/server-verifications with this request ID. A verification still running streams pending and terminal events after two seconds, like the original request. Reading does not count against the request rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerVerification"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/ServerVerificationStreamEvent"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts":{"post":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCredentials"}}}},"responses":{"201":{"description":"Account linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedAccountCreated"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Linked accounts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}":{"delete":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"idempotency-key","in":"header"}],"responses":{"204":{"description":"Account disabled"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/balance":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Account balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/positions":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Open positions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/trades":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor."},"required":false,"description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor.","name":"from","in":"query"},{"schema":{"type":"string","description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor."},"required":false,"description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor.","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":["boolean","null"],"default":false},"required":false,"name":"requireSynced","in":"query"}],"responses":{"200":{"description":"Closed trades","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradesObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Pagination cursor expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/deals":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor."},"required":false,"description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor.","name":"from","in":"query"},{"schema":{"type":"string","description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor."},"required":false,"description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor.","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":["boolean","null"],"default":false},"required":false,"name":"requireSynced","in":"query"}],"responses":{"200":{"description":"Deal history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealsObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Pagination cursor expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/orders":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor."},"required":false,"description":"Optional initial window start. Defaults deterministically to 30 days before to. Omit with cursor.","name":"from","in":"query"},{"schema":{"type":"string","description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor."},"required":false,"description":"Required on initial windowed reads. The server never defaults it to now. Omit with cursor.","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":["boolean","null"],"default":false},"required":false,"name":"requireSynced","in":"query"}],"responses":{"200":{"description":"Historical orders","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrdersObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Pagination cursor expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/history/export":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","enum":["deals","orders"],"default":"deals"},"required":false,"name":"dataset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"exportToken","in":"query"}],"responses":{"200":{"description":"Certified deal or order history export","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DealsObservation"},{"$ref":"#/components/schemas/OrdersObservation"}]}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"Pagination cursor expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/candles":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"symbol","in":"query"},{"schema":{"type":"string","enum":["M1","M5","M15","H1","H4","D1"]},"required":true,"name":"timeframe","in":"query"},{"schema":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"string","pattern":"^\\d+$"}]},"required":false,"name":"count","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"string","pattern":"^\\d+$"}]},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Completed broker OHLC candles, oldest first; nextTo paginates backward","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"login":{"type":"string"},"server":{"type":"string"},"observedAt":{"type":"string"},"latencyMs":{"type":"number"},"symbol":{"type":"string","minLength":1},"timeframe":{"type":"string","enum":["M1","M5","M15","H1","H4","D1"]},"data":{"type":"array","items":{"type":"object","properties":{"openTime":{"type":"string","format":"date-time"},"serverClockOffsetSeconds":{"type":"integer"},"open":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$"},"high":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$"},"low":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$"},"close":{"type":"string","pattern":"^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$"},"tickVolume":{"type":"string","pattern":"^\\d+$"},"spread":{"type":"integer","minimum":0},"realVolume":{"type":"string","pattern":"^\\d+$"}},"required":["openTime","serverClockOffsetSeconds","open","high","low","close","tickVolume","spread","realVolume"],"additionalProperties":false},"maxItems":1000},"nextTo":{"type":["string","null"],"format":"date-time"},"serverClockOffsetSeconds":{"type":"integer"}},"required":["accountId","login","server","observedAt","latencyMs","symbol","timeframe","data","nextTo","serverClockOffsetSeconds"]}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/symbols":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Comma-separated symbol names. Between 1 and 50 names, each 1 to 64 characters."},"required":true,"description":"Comma-separated symbol names. Between 1 and 50 names, each 1 to 64 characters.","name":"symbols","in":"query"}],"responses":{"200":{"description":"Symbol specifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SymbolsObservation"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/snapshot":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Account snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/prop-status":{"get":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"responses":{"200":{"description":"Prop-firm rule status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PropStatus"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/accounts/{accountId}/backtests":{"post":{"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"accountId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRequest"}}}},"responses":{"200":{"description":"A rule backtest over the account's own broker candles. Read-only: no order is placed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRun"}}}},"202":{"description":"The account session is warming; retry the same request","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Active trial or subscription required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient API key scope, connected account slot limit, or execution policy violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Account is not active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"The broker or terminal rejected the operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Oversized upstream data response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Capacity exhausted, upstream unavailable, or history coverage unsettled","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"504":{"description":"Upstream request timed out","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}