{"openapi":"3.0.3","info":{"title":"MetaRPC TradeLocker Client API","version":"1.0.0","description":"MetaRPC TradeLocker Client API \u2014 REST \u0026 WebSocket API specification for automated trading, quotes, and account management on TradeLocker accounts. Compatible with Postman, Insomnia, and Swagger UI.\n\nAuthentication: send your API key in the \u0060APIKey\u0060 header on every request (\u0060api-key\u0060, \u0060X-API-Key\u0060 and \u0060Authorization: Bearer\u0060 are accepted too). Call \u0060Authenticate\u0060, then \u0060Connect\u0060; pass the returned \u0060data.id\u0060 in the \u0060id\u0060 header on all other calls. WebSocket streams take the same two headers from a server or tool; a client that cannot set headers may pass \u0060apikey\u0060 and \u0060id\u0060 as query parameters. The gateway refuses a WebSocket handshake whose \u0060Origin\u0060 host is not its own.\n\nBilling: connected time is billed per provider account (see the portal pricing page; a one-hour minimum applies when a connection is closed within its first hour); at a zero balance connections are suspended and every call except \u0060Disconnect\u0060 and \u0060GetCapabilities\u0060 answers 403 \u0060INSUFFICIENT_FUNDS\u0060 until a deposit. A request without a key runs in unbilled, time-limited trial mode; a key that is sent but unknown is rejected, never downgraded to trial. \u0060GetCapabilities\u0060 returns \u0060features\u0060, the optional behaviours this deployment really provides; a name that is absent is not available.\n\nConventions: request and response bodies use the proto3 JSON mapping (camelCase field names, 64-bit integers as decimal strings, enums as names, decimals as \u0060{\u0022value\u0022:\u00221.25\u0022}\u0060). Fields holding their default value (empty string, 0, false) are omitted from responses. On GET requests the request message is bound from query parameters, nested fields with dotted names (\u0060quantity.value\u0060).","x-source":"tradelocker-api @ 575e44abff0b94a7eabf88f06f715264fac08a18 (proto/api.proto: identical to the commit; working tree clean)"},"servers":[{"url":"https://tl.mrpc.pro"}],"tags":[{"name":"Account Helper","description":"Account Helper operations"},{"name":"Authentication","description":"Authentication operations"},{"name":"Capabilities","description":"Capabilities operations"},{"name":"Connection","description":"Connection operations"},{"name":"Market Info","description":"Market Info operations"},{"name":"Quote History","description":"Quote History operations"},{"name":"Subscription Service","description":"Subscription Service operations"},{"name":"Trading Helper","description":"Trading Helper operations"}],"paths":{"/Authenticate":{"get":{"tags":["Authentication"],"summary":"Authenticate","description":"Authenticate (Authentication).\n\nRequest fields are bound from query parameters. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060AuthenticationReply\u0060.","operationId":"AuthenticateGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"accessToken","in":"query","required":false,"schema":{"type":"string"}},{"name":"refreshToken","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"password","in":"query","required":false,"schema":{"type":"string"}},{"name":"server","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"ApiKey":[]}],"responses":{"200":{"description":"AuthenticationReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Authentication"],"summary":"Authenticate","description":"Authenticate (Authentication).\n\nThe JSON request body is a \u0060AuthenticationRequest\u0060.\n\nReturns \u0060AuthenticationReply\u0060.","operationId":"AuthenticatePost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationRequest"}}}},"security":[{"ApiKey":[]}],"responses":{"200":{"description":"AuthenticationReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticationReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Connect":{"get":{"tags":["Connection"],"summary":"Connect","description":"Connect (Connection).\n\nRequest fields are bound from query parameters. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060ConnectionReply\u0060.","operationId":"ConnectGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"grantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"ApiKey":[]}],"responses":{"200":{"description":"ConnectionReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Connection"],"summary":"Connect","description":"Connect (Connection).\n\nThe JSON request body is a \u0060ConnectRequest\u0060.\n\nReturns \u0060ConnectionReply\u0060.","operationId":"ConnectPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRequest"}}}},"security":[{"ApiKey":[]}],"responses":{"200":{"description":"ConnectionReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/ConnectByToken":{"get":{"tags":["Connection"],"summary":"Connect By Token","description":"Connect By Token (Connection).\n\nThis call takes no request fields.\n\nReturns \u0060ConnectionReply\u0060.","operationId":"ConnectByTokenGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"ConnectionReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Connection"],"summary":"Connect By Token","description":"Connect By Token (Connection).\n\nThis call takes no request fields; send no body or \u0060{}\u0060.\n\nReturns \u0060ConnectionReply\u0060.","operationId":"ConnectByTokenPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Empty"}}}},"responses":{"200":{"description":"ConnectionReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Reconnect":{"get":{"tags":["Connection"],"summary":"Reconnect","description":"Reconnect (Connection).\n\nRequest fields are bound from query parameters. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060ReconnectReply\u0060.","operationId":"ReconnectGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"forceReconnection","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"ReconnectReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Connection"],"summary":"Reconnect","description":"Reconnect (Connection).\n\nThe JSON request body is a \u0060ReconnectRequest\u0060.\n\nReturns \u0060ReconnectReply\u0060.","operationId":"ReconnectPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectRequest"}}}},"responses":{"200":{"description":"ReconnectReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/ReconnectByToken":{"get":{"tags":["Connection"],"summary":"Reconnect","description":"Reconnect (Connection).\n\nRequest fields are bound from query parameters. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060ReconnectReply\u0060.","operationId":"ReconnectByTokenGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"forceReconnection","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"ReconnectReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Connection"],"summary":"Reconnect","description":"Reconnect (Connection).\n\nThe JSON request body is a \u0060ReconnectRequest\u0060.\n\nReturns \u0060ReconnectReply\u0060.","operationId":"ReconnectByTokenPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectRequest"}}}},"responses":{"200":{"description":"ReconnectReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconnectReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Disconnect":{"get":{"tags":["Connection"],"summary":"Disconnect","description":"Disconnect (Connection).\n\nThis call takes no request fields.\n\nReturns \u0060Empty\u0060.","operationId":"DisconnectGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"Empty object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Empty"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Connection"],"summary":"Disconnect","description":"Disconnect (Connection).\n\nThis call takes no request fields; send no body or \u0060{}\u0060.\n\nReturns \u0060Empty\u0060.","operationId":"DisconnectPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Empty"}}}},"responses":{"200":{"description":"Empty object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Empty"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/AccountSummary":{"get":{"tags":["Account Helper"],"summary":"Account Summary","description":"Account Summary (Account Helper).\n\nThis call takes no request fields.\n\nReturns \u0060AccountSummaryReply\u0060.","operationId":"AccountSummary","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"AccountSummaryReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountSummaryReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OpenedOrders":{"get":{"tags":["Account Helper"],"summary":"Opened Orders","description":"Opened Orders (Account Helper).\n\nThis call takes no request fields.\n\nReturns \u0060Snapshot\u0060.","operationId":"OpenedOrders","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"Snapshot object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/History":{"get":{"tags":["Account Helper"],"summary":"History","description":"History (Account Helper).\n\nRequest fields are bound from query parameters.\n\nReturns \u0060HistoryReply\u0060.","operationId":"History","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"fromMs","in":"query","required":false,"schema":{"type":"string","format":"int64"}},{"name":"toMs","in":"query","required":false,"schema":{"type":"string","format":"int64"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"HistoryReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Journal":{"get":{"tags":["Account Helper"],"summary":"Journal","description":"Journal (Account Helper).\n\nThis call takes no request fields.\n\nReturns \u0060JournalReply\u0060.","operationId":"Journal","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"JournalReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JournalReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Symbols":{"get":{"tags":["Market Info"],"summary":"Symbols","description":"Symbols (Market Info).\n\nThis call takes no request fields.\n\nReturns \u0060InstrumentsReply\u0060.","operationId":"Symbols","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"responses":{"200":{"description":"InstrumentsReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentsReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/SymbolInfo":{"get":{"tags":["Market Info"],"summary":"Symbol Info","description":"Symbol Info (Market Info).\n\nRequest fields are bound from query parameters.\n\nReturns \u0060Instrument\u0060.","operationId":"SymbolInfo","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"symbolId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Instrument object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instrument"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Quote":{"get":{"tags":["Market Info"],"summary":"Quote","description":"Quote (Market Info).\n\nRequest fields are bound from query parameters.\n\nReturns \u0060Quote\u0060.","operationId":"Quote","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"symbolId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Quote object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/RequiredMargin":{"get":{"tags":["Market Info"],"summary":"Required Margin","description":"Required Margin (Market Info).\n\nRequest fields are bound from query parameters; nested fields use dotted names such as \u0060quantity.value\u0060.\n\nReturns \u0060RequiredMarginReply\u0060.","operationId":"RequiredMargin","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"symbolId","in":"query","required":false,"schema":{"type":"string"}},{"name":"side","in":"query","required":false,"schema":{"type":"string"}},{"name":"quantity.value","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"RequiredMarginReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequiredMarginReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OrderSend":{"get":{"tags":["Trading Helper"],"summary":"Order Send","description":"Order Send (Trading Helper).\n\nRequest fields are bound from query parameters; nested fields use dotted names such as \u0060quantity.value\u0060. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060Command\u0060.","operationId":"OrderSendGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"symbolId","in":"query","required":false,"schema":{"type":"string"}},{"name":"side","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"}},{"name":"quantity.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"price.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"stopLoss.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"takeProfit.value","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Trading Helper"],"summary":"Order Send","description":"Order Send (Trading Helper).\n\nThe JSON request body is a \u0060PlaceOrderRequest\u0060.\n\nReturns \u0060Command\u0060.","operationId":"OrderSendPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceOrderRequest"}}}},"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OrderCancel":{"get":{"tags":["Trading Helper"],"summary":"Order Cancel","description":"Order Cancel (Trading Helper).\n\nRequest fields are bound from query parameters. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060Command\u0060.","operationId":"OrderCancelGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"orderId","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Trading Helper"],"summary":"Order Cancel","description":"Order Cancel (Trading Helper).\n\nThe JSON request body is a \u0060CancelOrderRequest\u0060.\n\nReturns \u0060Command\u0060.","operationId":"OrderCancelPost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderRequest"}}}},"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OrderModify":{"get":{"tags":["Trading Helper"],"summary":"Order Modify","description":"Order Modify (Trading Helper).\n\nRequest fields are bound from query parameters; nested fields use dotted names such as \u0060quantity.value\u0060. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060Command\u0060.","operationId":"OrderModifyGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"orderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"quantity.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"price.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"stopLoss.value.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"stopLoss.clear","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"takeProfit.value.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"takeProfit.clear","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"patch":{"tags":["Trading Helper"],"summary":"Order Modify","description":"Order Modify (Trading Helper).\n\nThe JSON request body is a \u0060ModifyOrderRequest\u0060.\n\nReturns \u0060Command\u0060.","operationId":"OrderModifyPatch","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyOrderRequest"}}}},"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/PositionClose":{"get":{"tags":["Trading Helper"],"summary":"Position Close","description":"Position Close (Trading Helper).\n\nRequest fields are bound from query parameters; nested fields use dotted names such as \u0060quantity.value\u0060. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060Command\u0060.","operationId":"PositionCloseGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"positionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"quantity.value","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"post":{"tags":["Trading Helper"],"summary":"Position Close","description":"Position Close (Trading Helper).\n\nThe JSON request body is a \u0060ClosePositionRequest\u0060.\n\nReturns \u0060Command\u0060.","operationId":"PositionClosePost","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePositionRequest"}}}},"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/PositionModify":{"get":{"tags":["Trading Helper"],"summary":"Position Modify","description":"Position Modify (Trading Helper).\n\nRequest fields are bound from query parameters; nested fields use dotted names such as \u0060stopLoss.value.value\u0060. The same call is also available with a JSON body; prefer that for secrets and state-changing requests, because query strings end up in access logs and browser history.\n\nReturns \u0060Command\u0060.","operationId":"PositionModifyGet","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"positionId","in":"query","required":false,"schema":{"type":"string"}},{"name":"stopLoss.value.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"stopLoss.clear","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"takeProfit.value.value","in":"query","required":false,"schema":{"type":"string"}},{"name":"takeProfit.clear","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}},"patch":{"tags":["Trading Helper"],"summary":"Position Modify","description":"Position Modify (Trading Helper).\n\nThe JSON request body is a \u0060ModifyPositionRequest\u0060.\n\nReturns \u0060Command\u0060.","operationId":"PositionModifyPatch","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyPositionRequest"}}}},"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/GetCommand":{"get":{"tags":["Trading Helper"],"summary":"Get Command","description":"Get Command (Trading Helper).\n\nRequest fields are bound from query parameters.\n\nReturns \u0060Command\u0060.","operationId":"GetCommand","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"clientRequestId","in":"query","required":false,"schema":{"type":"string"}},{"name":"operation","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Command object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Command"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Bars":{"get":{"tags":["Quote History"],"summary":"Bars","description":"Bars (Quote History).\n\nRequest fields are bound from query parameters.\n\nReturns \u0060BarsReply\u0060.","operationId":"Bars","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}},{"name":"id","in":"header","required":true,"description":"Connection id returned by Connect (data.id).","schema":{"type":"string"}},{"name":"symbolId","in":"query","required":false,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"fromMs","in":"query","required":false,"schema":{"type":"string","format":"int64"}},{"name":"toMs","in":"query","required":false,"schema":{"type":"string","format":"int64"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"BarsReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarsReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OnQuotes":{"get":{"tags":["Subscription Service"],"summary":"On Quotes","description":"On Quotes (Subscription Service).\n\nRequest fields are bound from query parameters.\n\nUpgrades to a WebSocket (this route answers 426 to a plain HTTP request). Every text frame is a JSON \u0060StreamEvent\u0060. The stream ends when the client closes the socket, the connection is disconnected, expires or is suspended, or a slow consumer is cut off (429); reconnect to receive a fresh snapshot. Pass between 1 and 20 symbol ids as repeated \u0060symbolIds\u0060 query parameters (\u0060symbolIds=EURUSD\u0026symbolIds=GBPUSD\u0060). The gateway refuses (HTTP 403) a handshake whose \u0060Origin\u0060 header host differs from the host it was sent to, so open the stream from a server, script or tool - not from a page on another site. Send the credentials as the \u0060APIKey\u0060 and \u0060id\u0060 headers; the \u0060apikey\u0060 and \u0060id\u0060 query parameters exist for clients that cannot set headers, and put the key in the URL (keep query strings out of access logs). A refused upgrade is a plain HTTP status with the error envelope, never a socket: 401 key, 403 suspended (INSUFFICIENT_FUNDS) or foreign Origin, 404 unknown connection.","operationId":"OnQuotes","parameters":[{"name":"apikey","in":"query","required":true,"description":"API key. Browsers cannot set headers on a WebSocket; non-browser clients may send the \u0060APIKey\u0060 header instead.","schema":{"type":"string"}},{"name":"id","in":"query","required":true,"description":"Connection id returned by Connect (data.id). Non-browser clients may send the \u0060id\u0060 header instead.","schema":{"type":"string"}},{"name":"symbolIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"security":[{"ApiKeyQuery":[],"ConnectionIdQuery":[]}],"x-websocket":true,"x-websocket-message":{"$ref":"#/components/schemas/StreamEvent"},"responses":{"101":{"description":"Switching Protocols - the connection is now a WebSocket delivering StreamEvent frames."},"426":{"description":"Upgrade Required - the request was not a WebSocket upgrade."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OnTrade":{"get":{"tags":["Subscription Service"],"summary":"On Trade","description":"On Trade (Subscription Service).\n\nThis call takes no request fields.\n\nUpgrades to a WebSocket (this route answers 426 to a plain HTTP request). Every text frame is a JSON \u0060StreamEvent\u0060. The stream ends when the client closes the socket, the connection is disconnected, expires or is suspended, or a slow consumer is cut off (429); reconnect to receive a fresh snapshot. The gateway refuses (HTTP 403) a handshake whose \u0060Origin\u0060 header host differs from the host it was sent to, so open the stream from a server, script or tool - not from a page on another site. Send the credentials as the \u0060APIKey\u0060 and \u0060id\u0060 headers; the \u0060apikey\u0060 and \u0060id\u0060 query parameters exist for clients that cannot set headers, and put the key in the URL (keep query strings out of access logs). A refused upgrade is a plain HTTP status with the error envelope, never a socket: 401 key, 403 suspended (INSUFFICIENT_FUNDS) or foreign Origin, 404 unknown connection.","operationId":"OnTrade","parameters":[{"name":"apikey","in":"query","required":true,"description":"API key. Browsers cannot set headers on a WebSocket; non-browser clients may send the \u0060APIKey\u0060 header instead.","schema":{"type":"string"}},{"name":"id","in":"query","required":true,"description":"Connection id returned by Connect (data.id). Non-browser clients may send the \u0060id\u0060 header instead.","schema":{"type":"string"}}],"security":[{"ApiKeyQuery":[],"ConnectionIdQuery":[]}],"x-websocket":true,"x-websocket-message":{"$ref":"#/components/schemas/StreamEvent"},"responses":{"101":{"description":"Switching Protocols - the connection is now a WebSocket delivering StreamEvent frames."},"426":{"description":"Upgrade Required - the request was not a WebSocket upgrade."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/OnAccount":{"get":{"tags":["Subscription Service"],"summary":"On Account","description":"On Account (Subscription Service).\n\nThis call takes no request fields.\n\nUpgrades to a WebSocket (this route answers 426 to a plain HTTP request). Every text frame is a JSON \u0060StreamEvent\u0060. The stream ends when the client closes the socket, the connection is disconnected, expires or is suspended, or a slow consumer is cut off (429); reconnect to receive a fresh snapshot. The gateway refuses (HTTP 403) a handshake whose \u0060Origin\u0060 header host differs from the host it was sent to, so open the stream from a server, script or tool - not from a page on another site. Send the credentials as the \u0060APIKey\u0060 and \u0060id\u0060 headers; the \u0060apikey\u0060 and \u0060id\u0060 query parameters exist for clients that cannot set headers, and put the key in the URL (keep query strings out of access logs). A refused upgrade is a plain HTTP status with the error envelope, never a socket: 401 key, 403 suspended (INSUFFICIENT_FUNDS) or foreign Origin, 404 unknown connection.","operationId":"OnAccount","parameters":[{"name":"apikey","in":"query","required":true,"description":"API key. Browsers cannot set headers on a WebSocket; non-browser clients may send the \u0060APIKey\u0060 header instead.","schema":{"type":"string"}},{"name":"id","in":"query","required":true,"description":"Connection id returned by Connect (data.id). Non-browser clients may send the \u0060id\u0060 header instead.","schema":{"type":"string"}}],"security":[{"ApiKeyQuery":[],"ConnectionIdQuery":[]}],"x-websocket":true,"x-websocket-message":{"$ref":"#/components/schemas/StreamEvent"},"responses":{"101":{"description":"Switching Protocols - the connection is now a WebSocket delivering StreamEvent frames."},"426":{"description":"Upgrade Required - the request was not a WebSocket upgrade."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}},"/Capabilities":{"get":{"tags":["Capabilities"],"summary":"Get Capabilities","description":"Get Capabilities (Capabilities).\n\nThis call takes no request fields.\n\nReturns \u0060CapabilitiesReply\u0060.","operationId":"GetCapabilities","parameters":[{"name":"APIKey","in":"header","required":true,"description":"Service API key issued in the MRPC portal.","schema":{"type":"string"}}],"security":[{"ApiKey":[]}],"responses":{"200":{"description":"CapabilitiesReply object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesReply"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Unprocessable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"501":{"$ref":"#/components/responses/NotImplemented"},"503":{"$ref":"#/components/responses/Unavailable"},"504":{"$ref":"#/components/responses/GatewayTimeout"}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","name":"APIKey","in":"header","description":"Service API key issued in the MRPC portal."},"ConnectionId":{"type":"apiKey","name":"id","in":"header","description":"Connection id returned by Connect (data.id)."},"ApiKeyQuery":{"type":"apiKey","name":"apikey","in":"query","description":"API key for WebSocket streams (browsers cannot set headers on a WebSocket)."},"ConnectionIdQuery":{"type":"apiKey","name":"id","in":"query","description":"Connection id for WebSocket streams."}},"schemas":{"DecimalValue":{"type":"object","description":"All monetary/quantity values are lossless decimal strings; quantities are UNITS.","properties":{"value":{"type":"string"}},"example":{"value":"1.2500"}},"Empty":{"type":"object"},"AuthenticationRequest":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"server":{"type":"string"}}},"ProviderAccount":{"type":"object","properties":{"accountId":{"type":"string"},"accountNumber":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"live":{"type":"boolean"}}},"AuthenticationReply":{"type":"object","properties":{"grantId":{"type":"string"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/ProviderAccount"}}}},"ConnectRequest":{"type":"object","properties":{"grantId":{"type":"string"},"accountId":{"type":"string"}}},"ConnectionData":{"type":"object","description":"created_ms: when the connection was opened (unix ms). expires_ms: set only for trial connections (omitted = no expiry).","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"environment":{"type":"string"},"createdMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"expiresMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."}}},"ConnectionReply":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ConnectionData"}}},"ReconnectRequest":{"type":"object","description":"Reconnect (GET or POST /Reconnect; the same call is also served as /ReconnectByToken): re-establishes the provider link of an existing connection\nfrom the credentials the service already holds. The id header names the connection and the API key must own it; no credentials are sent.\nforce_reconnection: tear the link down and build it again even if it is alive. Without it the link is verified and only repaired when it is not.\nA forced reconnect is allowed once per RECONNECT_MIN_INTERVAL_SECONDS (default 10) and account; inside that interval the stored result of the\nlast one is answered with throttled = true and the provider is not contacted.","properties":{"forceReconnection":{"type":"boolean"}}},"ReconnectData":{"type":"object","description":"id, account_id, environment, created_ms and expires_ms are those of ConnectionData and never change: Reconnect opens no new connection, charges nothing\nand does not move a trial\u0027s expiry. Absent bools and zero numbers are false/zero (JSON omits them).\nlink_was_alive: the link answered a provider probe before anything was changed; absent when no probe was made (a forced reconnect).\nlink_was_recreated: this call re-established the link. tokens_refreshed: the stored access token was renewed (the rotated tokens are persisted before they are used).\nthrottled: a forced reconnect inside the minimum interval; every other field then describes the stored last result and retry_after_ms is the wait for the next one.\ncompleted_ms: when the described reconnect finished (unix ms). actions: what was done, from the stable set\ntoken_refreshed, account_reauthorized, wire_reopened, account_session_reset (cTrader) and token_refreshed, caches_cleared, streams_restarted (TradeLocker).","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"environment":{"type":"string"},"createdMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"expiresMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"linkWasAlive":{"type":"boolean"},"linkWasRecreated":{"type":"boolean"},"tokensRefreshed":{"type":"boolean"},"throttled":{"type":"boolean"},"completedMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"retryAfterMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"actions":{"type":"array","items":{"type":"string"}}}},"ReconnectReply":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReconnectData"}}},"AccountSummaryReply":{"type":"object","description":"Every field after free_margin is optional: omitted means the provider did not supply it (never zero).\nprofit: floating profit/loss of the open positions. margin_level: equity / margin x 100, only when margin \u003E 0.","properties":{"accountId":{"type":"string"},"currency":{"type":"string"},"balance":{"$ref":"#/components/schemas/DecimalValue"},"equity":{"$ref":"#/components/schemas/DecimalValue"},"margin":{"$ref":"#/components/schemas/DecimalValue"},"freeMargin":{"$ref":"#/components/schemas/DecimalValue"},"profit":{"$ref":"#/components/schemas/DecimalValue"},"marginLevel":{"$ref":"#/components/schemas/DecimalValue"},"leverage":{"$ref":"#/components/schemas/DecimalValue"},"accountNumber":{"type":"string"},"name":{"type":"string"}}},"Instrument":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"digits":{"type":"integer","format":"int32"},"minQuantity":{"$ref":"#/components/schemas/DecimalValue"},"maxQuantity":{"$ref":"#/components/schemas/DecimalValue"},"quantityStep":{"$ref":"#/components/schemas/DecimalValue"},"lotSize":{"$ref":"#/components/schemas/DecimalValue"},"infoRouteId":{"type":"string"},"tradeRouteId":{"type":"string"},"tickSize":{"description":"Optional (omitted = unavailable): tick_size/tick_value as published by the provider, currencies, swap rates, category, whether trading is open now.","allOf":[{"$ref":"#/components/schemas/DecimalValue"}]},"tickValue":{"$ref":"#/components/schemas/DecimalValue"},"baseCurrency":{"type":"string"},"quoteCurrency":{"type":"string"},"swapLong":{"$ref":"#/components/schemas/DecimalValue"},"swapShort":{"$ref":"#/components/schemas/DecimalValue"},"category":{"type":"string"},"tradingEnabled":{"type":"boolean"}}},"InstrumentsReply":{"type":"object","properties":{"instruments":{"type":"array","items":{"$ref":"#/components/schemas/Instrument"}}}},"SymbolRequest":{"type":"object","properties":{"symbolId":{"type":"string"}}},"Quote":{"type":"object","properties":{"symbolId":{"type":"string"},"bid":{"$ref":"#/components/schemas/DecimalValue"},"ask":{"$ref":"#/components/schemas/DecimalValue"},"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."}}},"Position":{"type":"object","properties":{"id":{"type":"string"},"symbolId":{"type":"string"},"side":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"},"price":{"$ref":"#/components/schemas/DecimalValue"},"stopLoss":{"$ref":"#/components/schemas/DecimalValue"},"takeProfit":{"$ref":"#/components/schemas/DecimalValue"},"stopLossOrderId":{"type":"string"},"takeProfitOrderId":{"type":"string"},"openedMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"comment":{"type":"string"},"profit":{"description":"Optional (omitted = unavailable). profit/swap/commission/margin are in the account currency; current_price is the price a close would get (bid for buy, ask for sell).","allOf":[{"$ref":"#/components/schemas/DecimalValue"}]},"swap":{"$ref":"#/components/schemas/DecimalValue"},"commission":{"$ref":"#/components/schemas/DecimalValue"},"margin":{"$ref":"#/components/schemas/DecimalValue"},"currentPrice":{"$ref":"#/components/schemas/DecimalValue"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"symbolId":{"type":"string"},"side":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"},"price":{"$ref":"#/components/schemas/DecimalValue"},"positionId":{"type":"string"},"correlationId":{"type":"string"},"stopLoss":{"$ref":"#/components/schemas/DecimalValue"},"takeProfit":{"$ref":"#/components/schemas/DecimalValue"},"openedMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."}}},"Snapshot":{"type":"object","properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."}}},"PlaceOrderRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"symbolId":{"type":"string"},"side":{"type":"string"},"type":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"},"price":{"$ref":"#/components/schemas/DecimalValue"},"stopLoss":{"$ref":"#/components/schemas/DecimalValue"},"takeProfit":{"$ref":"#/components/schemas/DecimalValue"}}},"CancelOrderRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"orderId":{"type":"string"}}},"ModifyOrderRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"orderId":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"},"price":{"$ref":"#/components/schemas/DecimalValue"},"stopLoss":{"$ref":"#/components/schemas/ProtectionChange"},"takeProfit":{"$ref":"#/components/schemas/ProtectionChange"}}},"ClosePositionRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"positionId":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"}}},"ProtectionChange":{"type":"object","description":"Omitted protection leaves it unchanged; clear=true removes it; value sets an absolute price. Set at most one of: \u0060value\u0060, \u0060clear\u0060.","x-oneofs":{"change":["value","clear"]},"properties":{"value":{"$ref":"#/components/schemas/DecimalValue"},"clear":{"type":"boolean"}}},"ModifyPositionRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"positionId":{"type":"string"},"stopLoss":{"$ref":"#/components/schemas/ProtectionChange"},"takeProfit":{"$ref":"#/components/schemas/ProtectionChange"}}},"Command":{"type":"object","properties":{"clientRequestId":{"type":"string"},"operation":{"type":"string"},"state":{"$ref":"#/components/schemas/CommandState"},"correlationId":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"errorCode":{"type":"string"},"updatedMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"createdMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"confirmedPosition":{"description":"Broker-confirmed state; absent when only submission is acknowledged.","allOf":[{"$ref":"#/components/schemas/Position"}]},"confirmedOrder":{"$ref":"#/components/schemas/Order"}}},"GetCommandRequest":{"type":"object","properties":{"clientRequestId":{"type":"string"},"operation":{"type":"string"}}},"HistoryRequest":{"type":"object","properties":{"fromMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"toMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"limit":{"type":"integer","format":"int32"}}},"Deal":{"type":"object","properties":{"id":{"type":"string"},"orderId":{"type":"string"},"positionId":{"type":"string"},"symbolId":{"type":"string"},"side":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"},"price":{"$ref":"#/components/schemas/DecimalValue"},"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"profit":{"description":"Optional (omitted = unavailable). entry is \u0022in\u0022 or \u0022out\u0022.","allOf":[{"$ref":"#/components/schemas/DecimalValue"}]},"commission":{"$ref":"#/components/schemas/DecimalValue"},"swap":{"$ref":"#/components/schemas/DecimalValue"},"entry":{"type":"string"}}},"HistoryReply":{"type":"object","properties":{"deals":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"hasMore":{"type":"boolean"},"coverage":{"type":"string"}}},"BarsRequest":{"type":"object","properties":{"symbolId":{"type":"string"},"period":{"type":"string"},"fromMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"toMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"limit":{"type":"integer","format":"int32"}}},"Bar":{"type":"object","properties":{"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"open":{"$ref":"#/components/schemas/DecimalValue"},"high":{"$ref":"#/components/schemas/DecimalValue"},"low":{"$ref":"#/components/schemas/DecimalValue"},"close":{"$ref":"#/components/schemas/DecimalValue"},"volume":{"type":"string"}}},"BarsReply":{"type":"object","properties":{"bars":{"type":"array","items":{"$ref":"#/components/schemas/Bar"}},"hasMore":{"type":"boolean"}}},"SubscribeRequest":{"type":"object","properties":{"symbolIds":{"type":"array","items":{"type":"string"}}}},"StreamEvent":{"type":"object","properties":{"sequence":{"type":"string","format":"uint64","description":"Unsigned 64-bit integer encoded as a decimal string."},"kind":{"type":"string"},"delivery":{"type":"string"},"snapshot":{"$ref":"#/components/schemas/Snapshot"},"quote":{"$ref":"#/components/schemas/Quote"},"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"account":{"$ref":"#/components/schemas/AccountSummaryReply"}}},"CapabilitiesReply":{"type":"object","properties":{"provider":{"type":"string"},"environment":{"type":"string"},"quoteDelivery":{"type":"string"},"tradeDelivery":{"type":"string"},"orderTypes":{"type":"array","items":{"type":"string"}},"quantityUnit":{"type":"string"},"liveVerified":{"type":"boolean"},"quantityMappingVerified":{"type":"boolean"},"configurationStatus":{"type":"string"},"features":{"type":"array","items":{"type":"string"},"description":"Optional behaviours this deployment really provides (see the docs); a name that is absent is not available."}}},"RequiredMarginRequest":{"type":"object","properties":{"symbolId":{"type":"string"},"side":{"type":"string"},"quantity":{"$ref":"#/components/schemas/DecimalValue"}}},"RequiredMarginReply":{"type":"object","description":"margin is in \u0060currency\u0060 (the account currency); source names who computed it (for example \u0022provider_estimate\u0022).","properties":{"margin":{"$ref":"#/components/schemas/DecimalValue"},"currency":{"type":"string"},"source":{"type":"string"}}},"JournalEntry":{"type":"object","description":"One line of the connection log: kind is connection, command or provider; code is a stable token; no credentials ever appear.","properties":{"timestampMs":{"type":"string","format":"int64","description":"64-bit integer encoded as a decimal string."},"kind":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}},"JournalReply":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/JournalEntry"}}}},"CommandState":{"type":"string","enum":["COMMAND_STATE_UNSPECIFIED","ACCEPTED","DISPATCHING","SUBMITTED","COMPLETED","REJECTED","EXPIRED_BEFORE_DISPATCH","EXECUTION_UNKNOWN"]},"Error":{"type":"object","description":"Error envelope returned with every non-2xx status. Match on the HTTP status and \u0060reason\u0060, never on the message text.","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Name of the failing gRPC status as the gateway prints it (PermissionDenied, NotFound, FailedPrecondition, ...). Errors the gateway raises itself (a malformed request) use INVALID_ARGUMENT.","example":"PermissionDenied"},"reason":{"type":"string","description":"Stable machine-readable token (API_KEY_INVALID, INSUFFICIENT_FUNDS, TERMINAL_INSTANCE_NOT_FOUND, GRANT_NOT_FOUND, CONNECTION_ID_IN_USE, OAUTH_STATE_EXPIRED, ...). Empty when the failure has none; a provider failure then carries its code as the whole \u0060message\u0060.","example":"INSUFFICIENT_FUNDS"},"message":{"type":"string","description":"\u0060REASON: readable detail\u0060 when there is a reason, otherwise the detail alone.","example":"INSUFFICIENT_FUNDS: Account suspended due to insufficient funds; add funds and the connection resumes by itself. Disconnect is still allowed."}},"required":["code","message"]}},"required":["error"],"example":{"error":{"code":"NotFound","reason":"TERMINAL_INSTANCE_NOT_FOUND","message":"TERMINAL_INSTANCE_NOT_FOUND: Connection not found, disconnected or expired; Connect again."}}}},"responses":{"BadRequest":{"description":"400 - INVALID_ARGUMENT: malformed JSON, unknown or duplicated query field, or an invalid value. Reasons: CONNECTION_ID_INVALID (the id header sent with Connect is not a GUID).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"401 - UNAUTHENTICATED: API_KEY_INVALID (a key was sent but is unknown, or two different keys were sent), API_KEY_REQUIRED (no key and trial is off), CONTRACTOR_NOT_FOUND (the key\u0027s account no longer exists).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"403 - PERMISSION_DENIED: INSUFFICIENT_FUNDS - the balance is zero or negative. Authenticate and Connect are refused and open connections are suspended: every call except Disconnect and GetCapabilities is refused until a deposit, after which they resume by themselves. Also returned for a WebSocket upgrade with a foreign Origin header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"404 - NOT_FOUND: TERMINAL_INSTANCE_NOT_FOUND (the connection id is unknown, disconnected, expired or belongs to someone else - Connect again), GRANT_NOT_FOUND (unknown grant, or the account is not part of it - Authenticate again), or the order, position, command or symbol does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"409 - ALREADY_EXISTS: CONNECTION_ID_IN_USE - the id header sent with Connect already belongs to another customer or account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unprocessable":{"description":"422 - FAILED_PRECONDITION: the request is valid but the broker or provider refused it. error.message carries the provider\u0027s code (SYMBOL_NOT_FOUND, INVALID_VOLUME, REAUTHENTICATION_REQUIRED, ENVIRONMENT_MISMATCH, RATE_LIMITED, HTTP_4xx, ...); the sign-in routes use the OAUTH_* reasons.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"429 - RESOURCE_EXHAUSTED: rate or concurrency limit reached, or a stream consumer was too slow (open the stream again for a fresh snapshot).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotImplemented":{"description":"501 - UNIMPLEMENTED: this provider cannot do it (for example RequiredMargin on TradeLocker, reason REQUIRED_MARGIN_UNSUPPORTED). Capabilities.features lists what a deployment provides.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"503 - UNAVAILABLE (and any other upstream failure): the provider or gateway is temporarily unavailable. Reasons: AUTHORITY_UNAVAILABLE (keys cannot be verified right now - retry), CUSTOMER_KEYS_NOT_CONFIGURED (this deployment accepts no customer keys).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"GatewayTimeout":{"description":"504 - DEADLINE_EXCEEDED: the call did not finish within 30 seconds. For a trading command, ask GetCommand before repeating it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"security":[{"ApiKey":[],"ConnectionId":[]}]}