{"openapi":"3.0.1","info":{"title":"TradeCopy","description":"\u003Ca href=\u0022/readme\u0022\u003ECheck our ReadMe\u003C/a\u003E\u003Cbr/\u003E\u003Cbr/\u003ETrade copier","version":"v2026.09.10-12.47"},"paths":{"/UpdateAccount":{"get":{"tags":["Accounts"],"summary":"Updates the specified account\u0027s name and balance consideration flag.\r\nAlso updates associated copier names by calling /UpdateAccountName for matching copiers.","parameters":[{"name":"accountId","in":"query","description":"The ID of the account to update.","required":true,"schema":{"type":"string"}},{"name":"accountName","in":"query","description":"The new name for the account.","required":true,"schema":{"type":"string"}},{"name":"considerAccountBalance","in":"query","description":"Whether the copier should consider account balance.","required":true,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Account updated successfully.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/GetAccount":{"get":{"tags":["Accounts"],"summary":"Returns an account by its internal Account Id.","parameters":[{"name":"accountId","in":"query","description":"The internal Account Id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ChangePassword":{"get":{"tags":["Accounts"],"summary":"Changes the password of an MT4 or MT5 trading account using internal account id (DB id).","parameters":[{"name":"type","in":"query","description":"API type (MT4 or MT5)","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"accountId","in":"query","description":"Internal account id in database","required":true,"schema":{"type":"string"}},{"name":"newPassword","in":"query","description":"New password to apply","required":true,"schema":{"type":"string"}},{"name":"isInvestor","in":"query","description":"\u0060true\u0060 to change investor password; \u0060false\u0060 to change master password.\r\n            If changing the master password, the session will be disconnected and require reconnection.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Password changed successfully.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ChangePasswordByApiId":{"get":{"tags":["Accounts"],"summary":"Changes the password of an MT4 or MT5 trading account.","parameters":[{"name":"type","in":"query","description":"API type (MT4 or MT5)","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"apiId","in":"query","description":"API token of the account (returned from Connect)","required":true,"schema":{"type":"string"}},{"name":"newPassword","in":"query","description":"New password to apply","required":true,"schema":{"type":"string"}},{"name":"isInvestor","in":"query","description":"\u0060true\u0060 to change investor password; \u0060false\u0060 to change master password.\r\n            If changing the master password, the session will be disconnected and require reconnection.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Password changed successfully.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/RemoveAccountByApiId":{"get":{"tags":["Accounts"],"summary":"Removes a trading account by its API ID.","parameters":[{"name":"apiId","in":"query","description":"The unique API ID of the account to remove.","required":true,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"The user key of the requester.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Account not found"},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/RemoveAccount":{"get":{"tags":["Accounts"],"summary":"Removes a trading account by its account ID.","parameters":[{"name":"accountId","in":"query","description":"The unique account ID (MongoDB document ID).","required":true,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"The user key of the requester.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Account not found"},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AddAccount":{"get":{"tags":["Accounts"],"summary":"Adds an MT trading account to the account list.","parameters":[{"name":"managerKey","in":"query","description":"Optional manager key. If omitted, defaults to userKey.","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","description":"Display account name.\r\nExample: \u0022default\u0022","required":true,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"UserKey from https://users.mtapi.io portal. Please register for free.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Source account type.\r\nExample: ApiType.MT4","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"user","in":"query","description":"Source account number.\r\nExample: 1124193263","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"password","in":"query","description":"Source account password.\r\nExample: \u00224ylahjl\u0022","required":true,"schema":{"type":"string"}},{"name":"server","in":"query","description":"Source account server name (as seen in MT Terminal).\r\nExample: \u0022FreshForex-Demo\u0022","required":true,"schema":{"type":"string"}},{"name":"apiId","in":"query","description":"Not required","schema":{"type":"string"}}],"responses":{"200":{"description":"Account ID","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AddAccountByApiId":{"get":{"tags":["Accounts"],"summary":"Registers an account that is ALREADY connected, identified by its terminal session id.","description":"The portal starts terminals of its own: a customer connects an MT account through\r\n/Connect and gets a terminal running under an api id. Asking them for the same\r\ncredentials again, so a copier can open a SECOND session on the same account, is both\r\nredundant and worse - two sessions on one login is exactly what brokers disconnect.\r\n            \r\nSo this adds the account the copier will use by pointing at the session that already\r\nexists. The login and the server are read back from that session rather than taken on\r\ntrust, which also proves the session is real before anything is stored.\r\n            \r\nTHE PASSWORD IS NOT STORED, because it is never supplied. A copier on such an account\r\nrides the customer\u0027s existing terminal session, and if that session ends the copier\r\ncannot re-establish it - it will report a connect failure until the terminal is started\r\nagain. Use /AddAccount when the copier must be able to reconnect on its own.","parameters":[{"name":"managerKey","in":"query","description":"Optional manager key. If omitted, defaults to userKey.","required":false,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"The user the account belongs to.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"MT4 or MT5 \u2014 the platform the session is running on.","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"apiId","in":"query","description":"The terminal session id (the api id of a running terminal).","required":true,"schema":{"type":"string"}},{"name":"name","in":"query","description":"Optional display name; one is generated from the login when omitted.","schema":{"type":"string"}},{"name":"user","in":"query","schema":{"type":"integer","format":"int64","default":0}},{"name":"server","in":"query","schema":{"type":"string"}},{"name":"apiKey","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Account ID","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/Accounts":{"get":{"tags":["Accounts"],"summary":"Retrieves all accounts for the specified user key without testing connection for each.\r\nReturns an array of tradecopy.Functions.Account objects.","parameters":[{"name":"userKey","in":"query","description":"The user key associated with the account list to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountResult\u0022\u003EAccountResult\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AccountsWithSummary":{"get":{"tags":["Accounts"],"summary":"Retrieves all accounts for the specified user key and tests connection for each.\r\nReturns an array of tradecopy.AccountResult objects with connection status and details.","parameters":[{"name":"userKey","in":"query","description":"The user key associated with the account list to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountResult\u0022\u003EAccountResult\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountResult"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AccountsWithTradeSummary":{"get":{"tags":["Accounts"],"summary":"Retrieves all accounts for the specified user key and tests connection for each.\r\nReturns an array of tradecopy.AccountResult objects with connection status and details.","parameters":[{"name":"userKey","in":"query","description":"The user key associated with the account list to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountResult\u0022\u003EAccountResult\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountResult"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AccountWithSummary":{"get":{"tags":["Accounts"],"summary":"Retrieves a specific account by user key and account ID, and tests the connection.\r\nReturns an tradecopy.AccountResult object with connection status and details.","parameters":[{"name":"userKey","in":"query","description":"The user key associated with the account.","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","description":"The ID of the account to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountResult\u0022\u003EAccountResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResult"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AccountWithTradeSummary":{"get":{"tags":["Accounts"],"summary":"Retrieves a specific account by user key and account ID, and tests the connection.\r\nReturns an tradecopy.AccountResult object with connection status and details.","parameters":[{"name":"userKey","in":"query","description":"The user key associated with the account.","required":true,"schema":{"type":"string"}},{"name":"accountId","in":"query","description":"The ID of the account to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountResult\u0022\u003EAccountResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResult"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AccountSetEnabled":{"get":{"tags":["Accounts"],"summary":"Sets the enabled status of a specific account.","parameters":[{"name":"accountId","in":"query","description":"The ID of the account to update.","required":true,"schema":{"type":"string"}},{"name":"enabled","in":"query","description":"The desired enabled status.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Account enabled status updated successfully."},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SignIn":{"get":{"tags":["Auth"],"summary":"Authenticate user using email and hashed password","parameters":[{"name":"email","in":"query","description":"Registered email address","required":true,"schema":{"type":"string"}},{"name":"passwordHash","in":"query","description":"Client-side hashed password","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the user\u0027s userKey","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SignUp":{"get":{"tags":["Auth"],"summary":"Register a new user using email. Password hash not required.","parameters":[{"name":"managerKey","in":"query","description":"Manager key. One manager control several users.","required":true,"schema":{"type":"string"}},{"name":"email","in":"query","description":"Email address (must be unique)","required":true,"schema":{"type":"string"}},{"name":"passwordHash","in":"query","description":"Client-side sha256 hashed password. Not required.","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the new user\u0027s userKey","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SignUpNonHashed":{"get":{"tags":["Auth"],"summary":"Register a new user using email and password hash","parameters":[{"name":"email","in":"query","description":"Email address (must be unique)","required":true,"schema":{"type":"string"}},{"name":"password","in":"query","description":"Client-side password","required":true,"schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"Manager key. One manager control several users.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the new user\u0027s userKey","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/PasswordForgot":{"get":{"tags":["Auth"],"summary":"Request password reset link by email. Generates a unique reset key, stores it, and sends a reset link via email.","parameters":[{"name":"email","in":"query","description":"Registered email address","required":true,"schema":{"type":"string"}},{"name":"frontEndResetUrl","in":"query","description":"Frontend URL to append resetKey to (e.g. https://yourapp.com/reset-password)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/PasswordReset":{"get":{"tags":["Auth"],"summary":"Reset user password using reset key. Updates password hash and clears the reset key.","parameters":[{"name":"resetKey","in":"query","description":"Reset key received by email","required":true,"schema":{"type":"string"}},{"name":"newPasswordHash","in":"query","description":"New password hash (client-side hashed)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/GetUserByEmail":{"get":{"tags":["Auth"],"summary":"Get user by email and managerKey","parameters":[{"name":"email","in":"query","description":"User email","required":true,"schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"Manager key assigned to user","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the user object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudUser"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/StartByAccountId":{"get":{"tags":["Copy"],"summary":"Starts a copier between two existing accounts using their account IDs (masterAccountId and slaveAccountId).\r\nThis endpoint links a master account to a slave account and configures all copier behavior including\r\nrisk parameters, trade copying rules, and filtering options.","description":"Returns tradecopy.Copy.StartResult containing CopierId, SrcId, and DstId.","parameters":[{"name":"managerKey","in":"query","description":"Optional manager key. If omitted, defaults to userKey.","required":false,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"UserKey from users.mtapi.io portal. Required for authentication.","required":true,"schema":{"type":"string"}},{"name":"masterAccountId","in":"query","description":"Internal ID of the master account registered in the system.","required":true,"schema":{"type":"string"}},{"name":"slaveAccountId","in":"query","description":"Internal ID of the slave account registered in the system.","required":true,"schema":{"type":"string"}},{"name":"riskType","in":"query","description":"Method used to calculate risk or position sizing.","required":true,"schema":{"enum":["FixedLot","LotMultiplier","BalanceMultiplier","FixedBalanceMultiplier","EquityMultiplier"],"type":"string","description":"Specifies the method used to calculate trading risk or position sizing."}},{"name":"riskValue","in":"query","description":"Numeric value interpreted based on riskType.","required":true,"schema":{"type":"number","format":"double"}},{"name":"copySL","in":"query","description":"If true, copies Stop Loss (SL) from master to slave.","schema":{"type":"boolean","default":false}},{"name":"copyTP","in":"query","description":"If true, copies Take Profit (TP) from master to slave.","schema":{"type":"boolean","default":false}},{"name":"fixedSlPips","in":"query","description":"Fixed Stop Loss in pips if SL is not copied.","schema":{"type":"integer","format":"int32","default":0}},{"name":"fixedTpPips","in":"query","description":"Fixed Take Profit in pips if TP is not copied.","schema":{"type":"integer","format":"int32","default":0}},{"name":"copyPendingOrders","in":"query","description":"If true, pending orders are copied.","schema":{"type":"boolean","default":false}},{"name":"fixedMasterBalance","in":"query","description":"Artificial master balance used only when using FixedBalanceMultiplier mode.","schema":{"type":"number","format":"double","default":0}},{"name":"reverseCopy","in":"query","description":"Reverse direction of trades.","schema":{"type":"boolean","default":false}},{"name":"stopLossRefinementPips","in":"query","description":"Additional refinement applied to Stop Loss.","schema":{"type":"integer","format":"int32","default":0}},{"name":"takeProfitRefinementPips","in":"query","description":"Additional refinement applied to Take Profit.","schema":{"type":"integer","format":"int32","default":0}},{"name":"forceMinLot","in":"query","description":"Force usage of minimum allowable lot size.","schema":{"type":"boolean","default":true}},{"name":"forceMaxLot","in":"query","description":"Force usage of maximum allowable lot size.","schema":{"type":"boolean","default":true}},{"name":"copyExistingTrades","in":"query","description":"If true, copies all currently open trades on startup.","schema":{"type":"boolean","default":false}},{"name":"contractAlignment","in":"query","description":"Align contract sizes between master and slave when converting lots.","schema":{"type":"boolean","default":true}},{"name":"copyExpiryTime","in":"query","description":"Copy expiry time for pending orders.","schema":{"type":"boolean","default":false}},{"name":"strictClose","in":"query","description":"Force closing slave orders if master closes, even under mismatch conditions.","schema":{"type":"boolean","default":false}},{"name":"copyMagicNumber","in":"query","description":"Defines how magic numbers are handled.","schema":{"enum":["No","Yes","Custom"],"type":"string","description":"Specifies how the copier should handle magic numbers when copying trades.","default":"No"}},{"name":"magicNumber","in":"query","description":"Magic number used when copyMagicNumber = Custom.","schema":{"type":"integer","format":"int32","default":0}},{"name":"tradeDelayMs","in":"query","description":"Delay (in milliseconds) before placing slave trades.","schema":{"type":"integer","format":"int32","default":0}},{"name":"lotRefiner","in":"query","description":"Lot size refinement multiplier.","schema":{"type":"number","format":"double","default":0}},{"name":"filterMagicOption","in":"query","description":"Filtering method by magic number: Copy, Ignore, or None.","schema":{"enum":["None","Copy","Ignore"],"type":"string","description":"Defines how to apply a filter condition (e.g., magic number or comment) when copying trades.","default":"None"}},{"name":"filterMagicValue","in":"query","description":"Magic number used when filtering by magic number.","schema":{"type":"integer","format":"int32","default":0}},{"name":"filterCommentOption","in":"query","description":"Filtering method by comment: Copy, Ignore, or None.","schema":{"enum":["None","Copy","Ignore"],"type":"string","description":"Defines how to apply a filter condition (e.g., magic number or comment) when copying trades.","default":"None"}},{"name":"filterCommentValue","in":"query","description":"Text string to filter order comments.","schema":{"type":"string","default":""}},{"name":"filterSide","in":"query","description":"Filter trades by direction.","schema":{"enum":["CopyAll","CopyBuyOnly","CopySellOnly"],"type":"string","description":"Specifies which trade directions to allow when copying.","default":"CopyAll"}},{"name":"filterLotEnabled","in":"query","description":"Enable filtering by lot size boundaries.","schema":{"type":"boolean","default":false}},{"name":"filterLotMin","in":"query","description":"Minimum allowed lot size when lot filtering is enabled.","schema":{"type":"number","format":"double","default":0}},{"name":"filterLotMax","in":"query","description":"Maximum allowed lot size when lot filtering is enabled.","schema":{"type":"number","format":"double","default":0}},{"name":"slaveTradeConfirmation","in":"query","schema":{"type":"boolean","default":false}},{"name":"filterExistingTrade","in":"query","description":"Optional array of master ticket numbers (strings). When provided together with copyExistingTrades=true, only the listed tickets are processed on startup (all other open master trades are skipped). Repeat the parameter for each ticket. When slaveTradeConfirmation=true, the matching trades are placed into the pending confirmation queue and are not executed until a SlaveTradeConfirm call is made.","schema":{"type":"array","items":{"type":"string"}}},{"name":"maxOpenSlippageType","in":"query","schema":{"enum":["Disabled","Auto","PriceDif"],"type":"string","description":"How the open-slippage guard is computed: \u0060Disabled\u0060 - no check; \u0060Auto\u0060 - a per-symbol-category threshold; \u0060PriceDif\u0060 - the threshold in \u0060maxOpenSlippageValue\u0060 (0 = no check). Not applied to trades from the \u0060SlaveTradeConfirmation\u0060 queue. Default for a new copier: \u0060Disabled\u0060.","default":"Disabled"}},{"name":"maxOpenSlippageValue","in":"query","schema":{"type":"number","format":"double","default":0}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-StartResult\u0022\u003EStartResult\u003C/a\u003E","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/StartResult"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/Remove":{"get":{"tags":["Copy"],"summary":"Stop copying and remove copier","parameters":[{"name":"id","in":"query","description":"Token returned by \u0027Connect\u0027 method","required":true,"schema":{"type":"string"}},{"name":"closeTrades","in":"query","description":"Close trades placed by copier","schema":{"type":"boolean","default":true}},{"name":"userKey","in":"query","schema":{"type":"string","default":""}},{"name":"managerKey","in":"query","schema":{"type":"string","default":""}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/UserCopiers":{"get":{"tags":["Copy"],"parameters":[{"name":"userKey","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-CopyService\u0022\u003ECopyService\u003C/a\u003E array","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/CopyService"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/GetCopier":{"get":{"tags":["Copy"],"summary":"Get copier by id","parameters":[{"name":"id","in":"query","description":"Copier id","required":true,"schema":{"type":"string","default":"790ac8a5-c753-48ff-b8bb-574b3af75b22"}}],"responses":{"200":{"description":"OK","content":{"text/json":{"schema":{"$ref":"#/components/schemas/CopyService"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/UpdateCopier":{"get":{"tags":["Copy"],"summary":"Updates copier settings in the database and notifies the running instance (if any) to apply new configuration.\r\nThis endpoint is used for live copier updates initiated by users.","parameters":[{"name":"id","in":"query","description":"The unique identifier of the copier to update.","schema":{"type":"string"}},{"name":"userKey","in":"query","description":"The user key used to scope and authorize the copier update.","required":true,"schema":{"type":"string"}},{"name":"riskType","in":"query","description":"The risk calculation strategy to use.","required":true,"schema":{"enum":["FixedLot","LotMultiplier","BalanceMultiplier","FixedBalanceMultiplier","EquityMultiplier"],"type":"string","description":"Specifies the method used to calculate trading risk or position sizing."}},{"name":"riskValue","in":"query","description":"The risk parameter value used according to the specified riskType.","required":true,"schema":{"type":"number","format":"double"}},{"name":"riskMultiply","in":"query","description":"Deprecated. Optional proportional multiplier for backward compatibility.","schema":{"type":"number","format":"double"}},{"name":"copySL","in":"query","description":"Whether to copy stop loss values from master to slave.","schema":{"type":"boolean","default":false}},{"name":"copyTP","in":"query","description":"Whether to copy take profit values from master to slave.","schema":{"type":"boolean","default":false}},{"name":"fixedSlPips","in":"query","description":"Fixed stop loss in pips (only used if copySL is false).","schema":{"type":"integer","format":"int32","default":0}},{"name":"fixedTpPips","in":"query","description":"Fixed take profit in pips (only used if copyTP is false).","schema":{"type":"integer","format":"int32","default":0}},{"name":"copyPendingOrders","in":"query","description":"If true, pending orders are copied from master to slave.","schema":{"type":"boolean","default":false}},{"name":"fixedMasterBalance","in":"query","description":"Override balance used for risk calculations. Set to 0 to use live balance.","schema":{"type":"number","format":"double","default":0}},{"name":"reverseCopy","in":"query","description":"If true, reverses trade direction.","schema":{"type":"boolean","default":false}},{"name":"stopLossRefinementPips","in":"query","description":"Adds refinement to stop loss values in pips.","schema":{"type":"integer","format":"int32","default":0}},{"name":"takeProfitRefinementPips","in":"query","description":"Adds refinement to take profit values in pips.","schema":{"type":"integer","format":"int32","default":0}},{"name":"forceMinLot","in":"query","description":"Forces minimum lot size compliance on slave account.","schema":{"type":"boolean","default":true}},{"name":"forceMaxLot","in":"query","description":"Forces maximum lot size compliance on slave account.","schema":{"type":"boolean","default":true}},{"name":"contractAlignment","in":"query","description":"Align contract sizes when calculating lot size between accounts.","schema":{"type":"boolean","default":true}},{"name":"copyExpiryTime","in":"query","description":"Whether to copy expiry time for pending orders.","schema":{"type":"boolean","default":false}},{"name":"strictClose","in":"query","description":"Enables strict close behavior to synchronize trade closure.","schema":{"type":"boolean","default":false}},{"name":"copyMagicNumber","in":"query","description":"Controls whether and how magic numbers are copied.","schema":{"enum":["No","Yes","Custom"],"type":"string","description":"Specifies how the copier should handle magic numbers when copying trades.","default":"No"}},{"name":"magicNumber","in":"query","description":"Custom magic number to assign to copied trades.","schema":{"type":"integer","format":"int32","default":0}},{"name":"tradeDelayMs","in":"query","description":"Delay in milliseconds before placing a copied trade.","schema":{"type":"integer","format":"int32","default":0}},{"name":"lotRefiner","in":"query","description":"Multiplier applied to the calculated lot size to refine final volume.","schema":{"type":"number","format":"double","default":0}},{"name":"filterMagicOption","in":"query","description":"Whether to filter trades by magic number (Copy, Ignore, None).","schema":{"enum":["None","Copy","Ignore"],"type":"string","description":"Defines how to apply a filter condition (e.g., magic number or comment) when copying trades.","default":"None"}},{"name":"filterMagicValue","in":"query","description":"The magic number to use if filtering is enabled.","schema":{"type":"integer","format":"int32","default":0}},{"name":"filterCommentOption","in":"query","description":"Whether to filter trades by comment (Copy, Ignore, None).","schema":{"enum":["None","Copy","Ignore"],"type":"string","description":"Defines how to apply a filter condition (e.g., magic number or comment) when copying trades.","default":"None"}},{"name":"filterCommentValue","in":"query","description":"Text to match against the comment for filtering.","schema":{"type":"string","default":""}},{"name":"filterSide","in":"query","description":"Whether to filter by trade direction (e.g., Buy-only, Sell-only).","schema":{"enum":["CopyAll","CopyBuyOnly","CopySellOnly"],"type":"string","description":"Specifies which trade directions to allow when copying.","default":"CopyAll"}},{"name":"filterLotEnabled","in":"query","description":"Whether to filter trades by lot size range.","schema":{"type":"boolean","default":false}},{"name":"filterLotMin","in":"query","description":"Minimum lot size to allow if lot filter is enabled.","schema":{"type":"number","format":"double","default":0}},{"name":"filterLotMax","in":"query","description":"Maximum lot size to allow if lot filter is enabled.","schema":{"type":"number","format":"double","default":0}},{"name":"maxOpenSlippageType","in":"query","schema":{"enum":["Disabled","Auto","PriceDif"],"type":"string","description":"How the open-slippage guard is computed: \u0060Disabled\u0060 - no check; \u0060Auto\u0060 - a per-symbol-category threshold; \u0060PriceDif\u0060 - the threshold in \u0060maxOpenSlippageValue\u0060 (0 = no check). Not applied to trades from the \u0060SlaveTradeConfirmation\u0060 queue. Omit it to leave the copier\u0027s current setting unchanged."}},{"name":"maxOpenSlippageValue","in":"query","schema":{"type":"number","format":"double","default":0}}],"responses":{"200":{"description":"Copier updated successfully.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/CopierPause":{"get":{"tags":["Copy"],"summary":"Pauses or unpauses a copier instance by updating its status in the database and notifying the running instance.","parameters":[{"name":"id","in":"query","description":"The unique identifier of the copier to pause or unpause.","required":true,"schema":{"type":"string"}},{"name":"paused","in":"query","description":"True to pause the copier; false to resume it.","required":true,"schema":{"type":"boolean"}},{"name":"reason","in":"query","description":"Pause reason","schema":{"enum":["None","WrongMasterPassword","ByUser","EquityProtection","ConnotConnectMaster","WrongSlavePassword","ConnotConnectSlave","MasterAccountDisable","SlaveAccountDisable","MasterAccountDeleted","SlaveAccountDeleted"],"type":"string","description":"Enumeration representing the reasons for pausing the copier service.","default":"ByUser"}}],"responses":{"200":{"description":"Copier pause status updated successfully."},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ReadMe":{"get":{"tags":["Copy"],"summary":"readme.md as html","responses":{"200":{"description":"Success"}}}},"/UpdateEquityProtector":{"get":{"tags":["EquityProtector"],"summary":"Updates equity protector settings for a given account via query parameters.","parameters":[{"name":"accountId","in":"query","description":"The ID of the account to update","required":true,"schema":{"type":"string"}},{"name":"enabled","in":"query","description":"Enable or disable equity protection","schema":{"type":"boolean","default":false}},{"name":"dailyReset","in":"query","description":"Enable daily drawdown reset","schema":{"type":"boolean","default":false}},{"name":"alert","in":"query","description":"Enable notification alert when triggered","schema":{"type":"boolean","default":false}},{"name":"disableCopier","in":"query","description":"Disable copier when triggered","schema":{"type":"boolean","default":false}},{"name":"closeCopiedTrades","in":"query","description":"Close copied trades only","schema":{"type":"boolean","default":false}},{"name":"closeAllTrades","in":"query","description":"Close all trades","schema":{"type":"boolean","default":false}},{"name":"stopLossPercent","in":"query","description":"% drawdown protection","schema":{"type":"number","format":"double","default":0}},{"name":"stopLossValue","in":"query","description":"$ value drawdown protection","schema":{"type":"number","format":"double","default":0}},{"name":"stopLossAbsolute","in":"query","description":"$ absolute minimum equity","schema":{"type":"number","format":"double","default":0}},{"name":"takeProfitPercent","in":"query","description":"% profit protection","schema":{"type":"number","format":"double","default":0}},{"name":"takeProfitValue","in":"query","description":"$ value profit protection","schema":{"type":"number","format":"double","default":0}},{"name":"takeProfitAbsolute","in":"query","description":"$ absolute maximum equity","schema":{"type":"number","format":"double","default":0}}],"responses":{"200":{"description":"Equity protector updated.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TestEquityProtectorCallback":{"get":{"tags":["EquityProtector"],"summary":"Tests the equity protection callback URL for a copier by sending test data.","parameters":[{"name":"copierId","in":"query","description":"The ID of the copier whose callback to test.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Test callback sent successfully.","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/Logs":{"get":{"tags":["Logs"],"summary":"Copier logs","parameters":[{"name":"id","in":"query","description":"Token returned by \u0027Connect\u0027 method","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Message count limit. It not specified - returns all messages. If specified - retuerns last \u0027limit\u0027 messages.","schema":{"type":"integer","format":"int32","default":1000}},{"name":"logLevel","in":"query","description":"Minimum log level to return","schema":{"enum":["Trace","Debug","Information","Warning","Error","Critical","None"],"type":"string","default":"Information"}}],"responses":{"200":{"description":"String array","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeLogs":{"get":{"tags":["Logs"],"summary":"Copier trade logs","parameters":[{"name":"copierId","in":"query","description":"Token (copier id) returned by \u0027Connect\u0027 method","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Record count limit. If not specified - returns all records. If specified - returns last \u0027limit\u0027 records.","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-TradeLog\u0022\u003ETradeLog\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeLog"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeLogsAll":{"get":{"tags":["Logs"],"summary":"All TradeLogs for a given UserKey","parameters":[{"name":"userKey","in":"query","description":"UserKey associated with the copier","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Record count limit. If not specified - returns all records. If specified - returns last \u0027limit\u0027 records.","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-TradeLog\u0022\u003ETradeLog\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeLog"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/Manager/Users":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UserAccounts":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"userKey","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UserCopiers":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"userKey","in":"query","schema":{"type":"string"}},{"name":"showOnlyPaused","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UserRemovedCopiers":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"userKey","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UserFailedStarts":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"userKey","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UserFailedAddAccounts":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"userKey","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/Accounts":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"Success"}}}},"/Manager/Copiers":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","format":"int32","default":100}},{"name":"showOnlyPaused","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/RemovedCopiers":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"Success"}}}},"/Manager/TogglePauseCopier":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"copierId","in":"query","schema":{"type":"string"}},{"name":"paused","in":"query","schema":{"type":"boolean"}},{"name":"reason","in":"query","schema":{"enum":["None","WrongMasterPassword","ByUser","EquityProtection","ConnotConnectMaster","WrongSlavePassword","ConnotConnectSlave","MasterAccountDisable","SlaveAccountDisable","MasterAccountDeleted","SlaveAccountDeleted"],"type":"string","description":"Enumeration representing the reasons for pausing the copier service.","default":"ByUser"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/UnPauseAll":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"reason","in":"query","schema":{"enum":["None","WrongMasterPassword","ByUser","EquityProtection","ConnotConnectMaster","WrongSlavePassword","ConnotConnectSlave","MasterAccountDisable","SlaveAccountDisable","MasterAccountDeleted","SlaveAccountDeleted"],"type":"string","description":"Enumeration representing the reasons for pausing the copier service."}}],"responses":{"200":{"description":"Success"}}}},"/Manager/CopierLogs":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"copierId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/Manager/CopierTradeLogs":{"get":{"tags":["Manager"],"parameters":[{"name":"managerKey","in":"query","schema":{"type":"string"}},{"name":"copierId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}}}},"/OpenOrders":{"get":{"tags":["Orders"],"summary":"Retrieves all opened orders for a given account ID.","parameters":[{"name":"accountId","in":"query","description":"The ID of the account to retrieve opened orders for. This is a required parameter.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-Order\u0022\u003EOrder\u003C/a\u003E array","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/Order"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/OpenOrdersAll":{"get":{"tags":["Orders"],"summary":"Retrieves all opened orders grouped by account names and user identifiers for a specific user.","parameters":[{"name":"userKey","in":"query","description":"The unique identifier for the user whose accounts\u0027 orders are to be retrieved.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of opened orders by user with separate account name and user fields","content":{"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountOrdersResult"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeStatsByAccountId":{"get":{"tags":["Orders"],"summary":"Returns StatsResult that contains calculated parameters and charts.","description":"Returns StatsResult that contains calculated parameters and charts.","parameters":[{"name":"accountId","in":"query","description":"Internal account identifier.","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"Start date for the statistics (format: yyyy-MM-ddTHH:mm:ss).","schema":{"type":"string","format":"date-time"}},{"name":"excludeSameBars","in":"query","description":"Optional flag to exclude consecutive bars with the same data. Defaults to \u0060true\u0060.","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-StatsWithCharts\u0022\u003EStatsResult\u003C/a\u003E object","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/StatsWithCharts"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeStatsByApiId":{"get":{"tags":["Orders"],"summary":"Returns StatsResult that contains calculated parameters and charts.","description":"Returns StatsResult that contains calculated parameters and charts.","parameters":[{"name":"apiId","in":"query","description":"API ID.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"API type","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"from","in":"query","description":"Start date for the statistics (format: yyyy-MM-ddTHH:mm:ss).","schema":{"type":"string","format":"date-time"}},{"name":"excludeSameBars","in":"query","description":"Optional flag to exclude consecutive bars with the same data. Defaults to \u0060true\u0060.","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-StatsWithCharts\u0022\u003EStatsWithCharts\u003C/a\u003E object","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/StatsWithCharts"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeStatsWithoutCharts":{"get":{"tags":["Orders"],"summary":"Returns Stats that contains calculated parameters.","parameters":[{"name":"apiId","in":"query","description":"API ID.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"API type","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}},{"name":"from","in":"query","description":"Start date for the statistics (format: yyyy-MM-ddTHH:mm:ss).","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-Stats\u0022\u003EStats\u003C/a\u003E object","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/Stats"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ClosedOrders":{"get":{"tags":["Orders"],"summary":"Retrieves closed orders for a specific account within a date range.","parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-Order\u0022\u003EOrder\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ClosedOrdersAll":{"get":{"tags":["Orders"],"summary":"Retrieves all closed orders for all of a user\u0027s accounts within a specified date range.\r\nAccounts that fail during the request are ignored.","description":"This endpoint gathers closed orders in parallel across all accounts linked to the specified user.\r\nAny individual account that throws an error will be silently skipped to allow others to complete.","parameters":[{"name":"userKey","in":"query","description":"The unique key identifying the user whose account orders are to be retrieved.","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"The start date of the date range to filter closed orders.","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"The end date of the date range to filter closed orders.","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-AccountOrdersResult\u0022\u003EAccountOrdersResult\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountOrdersResult"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeReportByManager":{"get":{"tags":["Reports"],"summary":"Builds a closed-trades report for a manager by joining TradeLogs (slave tickets)\r\nwith account order history fetched in bulk per account.","parameters":[{"name":"id","in":"query","description":"Your own report id.","required":true,"schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"The required manager key to identify the manager for the report.","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"The start date and time for the report period. Defaults to 7 days ago (September 17, 2025, 01:43 AM CEST) if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"The end date and time for the report period. Defaults to the current time (September 24, 2025, 01:43 AM CEST) if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"server","in":"query","description":"The server identifier for the trade data source (optional).","schema":{"type":"string"}},{"name":"type","in":"query","description":"The type of account to filter the report. Valid values are \u0022real\u0022, \u0022demo\u0022, or \u0022contest\u0022 (optional).","schema":{"type":"string"}},{"name":"slaveBrokerCompany","in":"query","description":"The slave broker company identifier (optional).","schema":{"type":"string"}},{"name":"email","in":"query","description":"Email to send result (optional).","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns a CSV file containing the closed-trades report for the manager."},"201":{"description":"Returns an tradecopy.ExceptionResult if an error occurs during report generation."}}}},"/TradeReportStatus":{"get":{"tags":["Reports"],"summary":"Polls the progress and result of a queued trade report.\r\nReturns the report\u0027s status (queued, processing, completed, timeout, failed), progress percent,\r\nqueued/started/completed timestamps, processed-vs-total users, and \u2014 once completed \u2014 the full\r\nreport data that the client can render or convert to CSV.","parameters":[{"name":"id","in":"query","description":"Report tracking id returned by TradeReportByManager or TradeReportByManagerCsv.","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns a tradecopy.TradeReportStatusResponse for any non-error state (queued, processing, completed, timeout, failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeReportStatusResponse"}}}},"201":{"description":"Returns an tradecopy.ExceptionResult if the report id is missing, unknown, or already expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeReportStatusResponse"}}}}}}},"/TradeReportByUser":{"get":{"tags":["Reports"],"summary":"Builds a closed-trades report for a user by joining TradeLogs (slave tickets)\r\nwith account order history fetched in bulk per account.","parameters":[{"name":"userKey","in":"query","description":"The required user key to identify the user for the report.","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"The start date and time for the report period. Defaults to 7 days ago if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"The end date and time for the report period. Defaults to the current time if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"server","in":"query","description":"The server identifier for the trade data source (optional).","schema":{"type":"string"}},{"name":"type","in":"query","description":"The type of account to filter the report. Valid values are \u0022real\u0022, \u0022demo\u0022, or \u0022contest\u0022 (optional).","schema":{"type":"string"}},{"name":"slaveBrokerCompany","in":"query","description":"The slave broker company identifier (optional).","schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-TradeCloseReportRow\u0022\u003ETradeCloseReportRow\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeReportRow"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeReportByUserCsv":{"get":{"tags":["Reports"],"summary":"Builds a closed-trades report for a user by joining TradeLogs (slave tickets)\r\nwith account order history fetched in bulk per account and returns it as a CSV file.","parameters":[{"name":"userKey","in":"query","description":"The required user key to identify the user for the report.","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","description":"The start date and time for the report period. Defaults to 7 days ago if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"The end date and time for the report period. Defaults to the current time if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"server","in":"query","description":"The server identifier for the trade data source (optional).","schema":{"type":"string"}},{"name":"type","in":"query","description":"The type of account to filter the report. Valid values are \u0022real\u0022, \u0022demo\u0022, or \u0022contest\u0022 (optional).","schema":{"type":"string"}},{"name":"slaveBrokerCompany","in":"query","description":"The slave broker company identifier (optional).","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns csv file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/TradeReportByManagerCsv":{"get":{"tags":["Reports"],"summary":"Builds a closed-trades report for a manager by joining TradeLogs (slave tickets)\r\nwith account order history fetched in bulk per account and returns it as a CSV file.","parameters":[{"name":"id","in":"query","description":"Your own report id.","required":true,"schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"The manager key to identify the manager for the report (optional, defaults to userKey).","required":false,"schema":{"type":"string"}},{"name":"userKey","in":"query","description":"User key (optional if managerKey is provided).","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","description":"The start date and time for the report period. Defaults to 7 days ago (September 17, 2025, 01:42 AM CEST) if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"The end date and time for the report period. Defaults to the current time (September 24, 2025, 01:42 AM CEST) if not specified.","schema":{"type":"string","format":"date-time"}},{"name":"server","in":"query","description":"The server identifier for the trade data source (optional).","schema":{"type":"string"}},{"name":"type","in":"query","description":"The type of account to filter the report. Valid values are \u0022real\u0022, \u0022demo\u0022, or \u0022contest\u0022 (optional).","schema":{"type":"string"}},{"name":"slaveBrokerCompany","in":"query","description":"The slave broker company identifier (optional).","schema":{"type":"string"}},{"name":"email","in":"query","description":"Email to send report when ready (optional).","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns a CSV file containing the closed-trades report for the manager."},"201":{"description":"Returns an tradecopy.ExceptionResult if an error occurs during report generation."}}}},"/CopyReport":{"get":{"tags":["Reports"],"summary":"HTML report: for a master\u0027s last N trades, which copiers copied them and why the rest failed\r\n(zero balance / not enough money / wrong slave password / need to check).","parameters":[{"name":"masterUser","in":"query","description":"Master account login number (alternative to masterAccountId).","schema":{"type":"string"}},{"name":"masterAccountId","in":"query","description":"Master account GUID \u2014 _id or ApiId (alternative to masterUser).","schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"Manager key (scopes the report; provide this or userKey).","schema":{"type":"string"}},{"name":"userKey","in":"query","description":"User key (scopes the report; provide this or managerKey).","schema":{"type":"string"}},{"name":"lastTrades","in":"query","description":"How many of the master\u0027s most recent trades to check (default 3).","schema":{"type":"integer","format":"int32","default":3}},{"name":"live","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"HTML report","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/AccountSummary":{"get":{"tags":["Reports"],"summary":"LIVE account summary (current balance/equity straight from the broker) for one or many accounts.\r\nUnlike CopyReport with live=false \u2014 which shows the stale value persisted in the copier document \u2014\r\nthis always queries the account right now, so a drained account correctly shows 0.\r\nProvide exactly one selector (checked in this order): accountId (Mongo _id), apiId, userKey, managerKey.\r\nmanagerKey/userKey return every account under that key.","parameters":[{"name":"accountId","in":"query","description":"Account Mongo _id (also matches ApiId).","schema":{"type":"string"}},{"name":"apiId","in":"query","description":"Account ApiId.","schema":{"type":"string"}},{"name":"userKey","in":"query","description":"Return all accounts owned by this user key.","schema":{"type":"string"}},{"name":"managerKey","in":"query","description":"Return all accounts under this manager key.","schema":{"type":"string"}},{"name":"timeoutSeconds","in":"query","description":"Per-account live fetch timeout (2..30, default 12).","schema":{"type":"integer","format":"int32","default":12}}],"responses":{"200":{"description":"Array of live account summaries","content":{"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountSummaryRow"}}}}}}}},"/SlaveTradeConfirm":{"get":{"tags":["SlaveTradeConfirm"],"summary":"Confirms or rejects a pending slave trade that a copier is holding because it was\r\nstarted with SlaveTradeConfirmation = true.\r\nOn success (or reject) the pending trade is removed from the confirmation queue.\r\nIf execution fails (e.g. the open-slippage guard rejects the fill), the error is\r\nreturned as an ExceptionResult and the pending trade STAYS in the queue, so it can\r\nbe retried or explicitly rejected until it expires (10 minutes after enqueue) or\r\nthe master trade closes.","parameters":[{"name":"id","in":"query","description":"The copier id.","required":true,"schema":{"type":"string"}},{"name":"uniqueTradeId","in":"query","description":"The UniqueTradeId of the pending trade (as published on the OnSlaveTradeConfirm WebSocket).","required":true,"schema":{"type":"string"}},{"name":"lots","in":"query","description":"Optional override for the slave lot size. Pass 0 (default) to use the copier\u0027s configured risk-based slave lots.\r\nIgnored when reject is true.","schema":{"type":"number","format":"double","default":0}},{"name":"reject","in":"query","description":"If true, the pending trade is rejected and will not be copied to the slave account.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SlaveTradesAwaitingConfirmation":{"get":{"tags":["SlaveTradeConfirm"],"summary":"Returns the list of pending slave trades (enqueued within the last 10 minutes) for a copier\r\nthat was started with SlaveTradeConfirmation = true.","parameters":[{"name":"id","in":"query","description":"The copier id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"\u003Ca href=\u0022#model-PendingSlaveTrade\u0022\u003EPendingSlaveTrade\u003C/a\u003E array","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PendingSlaveTrade"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SymbolList":{"get":{"tags":["SymbolMapping"],"summary":"Returns all symbol names for a trading account, ensuring connection is established first.","parameters":[{"name":"apiId","in":"query","description":"API ID of the trading account.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Trading API type (MT4 or MT5).","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}}],"responses":{"200":{"description":"String array","content":{"text/plain":{"schema":{"type":"array","items":{"type":"string"}}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/MappedSymbols":{"get":{"tags":["SymbolMapping"],"summary":"Retrieves the manually defined symbol mappings for a specific copier,\r\nalong with all available master and slave symbols for that copier.","parameters":[{"name":"id","in":"query","description":"The ID of the copier to retrieve symbol mappings from.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Mapped symbols and available symbol lists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappedSymbolsResult"}}}},"201":{"description":"Exception result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/AddSymbolMapping":{"get":{"tags":["SymbolMapping"],"summary":"Adds or updates a symbol mapping on a copier, storing a master-to-slave symbol pair with optional fixed lots.","parameters":[{"name":"id","in":"query","description":"The ID of the copier to update. This must refer to a copier document in the database.","required":true,"schema":{"type":"string"}},{"name":"masterSymbol","in":"query","description":"The master symbol (source) to be mapped. This is the symbol from the master account.","required":true,"schema":{"type":"string"}},{"name":"slaveSymbol","in":"query","description":"The slave symbol (destination) that the master symbol should be mapped to.\r\nTo specify a fixed lot, use the format \u0060SYMBOL__0.1\u0060, e.g., \u0060EURUSDmini__0.2\u0060.","required":true,"schema":{"type":"string"}},{"name":"slavelots","in":"query","description":"The fixed lot size to use on the slave account for this mapping. Use \u00600\u0060 to apply dynamic lot sizing.","schema":{"type":"number","format":"double"}}],"responses":{"200":{"description":"OK","content":{"text/json":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/DeleteSymbolMapping":{"get":{"tags":["SymbolMapping"],"summary":"Deletes a specific symbol mapping from a copier.","parameters":[{"name":"id","in":"query","description":"The ID of the copier from which the mapping should be removed.","required":true,"schema":{"type":"string"}},{"name":"masterSymbol","in":"query","description":"The master symbol whose mapping is to be deleted.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/json":{"schema":{"type":"string"}}}},"201":{"description":"\u003Ca href=\u0022#model-ExceptionResult\u0022\u003EExceptionResult\u003C/a\u003E array","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/ServerNames":{"get":{"tags":["SymbolMapping"],"summary":"Retrieves all server names for MT5 brokers.","parameters":[{"name":"mt5","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Array of server names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"500":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SymbolParamsLite":{"get":{"tags":["SymbolMapping"],"summary":"Returns all symbol parameters including Symbol, LotMin, LotMax, and TradeMode.","parameters":[{"name":"apiId","in":"query","description":"The API ID of the trading account.","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"The trading API type (MT4 or MT5).","required":true,"schema":{"enum":["MT5","MT4"],"type":"string","description":""}}],"responses":{"200":{"description":"List of symbol parameters","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SymbolLite"}}}}},"201":{"description":"Exception result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/SymbolsEnable":{"get":{"tags":["SymbolMapping"],"summary":"Enables or disables specific symbols for an account.","parameters":[{"name":"accountId","in":"query","description":"Account ID","required":true,"schema":{"type":"string"}},{"name":"enableAllSymbols","in":"query","description":"If true, enables all symbols except those in disabledSymbols","required":true,"schema":{"type":"boolean"}},{"name":"on","in":"query","description":"Symbols to enable (used only if enableAllSymbols is false)","schema":{"type":"array","items":{"type":"string"}}},{"name":"off","in":"query","description":"Symbols to disable (used only if enableAllSymbols is true)","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Symbols updated","content":{"text/plain":{"schema":{"type":"string"}}}},"201":{"description":"Error result","content":{"text/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}},"/OnTradeLog":{"get":{"tags":["WebSockets"],"summary":"WebSocket stream of trade events for a running copier.\r\nConnect with: ws(s)://{host}/OnTradeLog?id={copierId}.\r\nA frame is pushed for every completed open, close, partial close, modify, filter rejection,\r\nequity-protector close, master-disconnect close, and SlaveTradeConfirmation timeout or rejection.\r\nThe same payload is also POSTed to any URL set via SetTradeLogCallback.","parameters":[{"name":"id","in":"query","description":"Copier id returned by the Start endpoint.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"WebSocket stream. Each frame is a TradeLog JSON message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeLog"}}}}}}},"/OnUpdateEquityProtector":{"get":{"tags":["WebSockets"],"summary":"WebSocket stream of equity-protector events for a running copier.\r\nConnect with: ws(s)://{host}/OnUpdateEquityProtector?id={copierId}.\r\nA frame is pushed whenever any configured equity-protection threshold is crossed on the slave account\r\n(stop-loss or take-profit by percent, value, or absolute level).\r\nThe same payload is also POSTed to the URL set via UpdateEquityProtectorCallback.","parameters":[{"name":"id","in":"query","description":"Copier id returned by the Start endpoint.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"WebSocket stream. Each frame is an EquityProtectionCallbackPayload JSON message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquityProtectionCallbackPayload"}}}}}}},"/OnSlaveTradeConfirm":{"get":{"tags":["WebSockets"],"summary":"WebSocket stream of new master trades awaiting confirmation for a copier that was started with slaveTradeConfirmation = true.\r\nConnect with: ws(s)://{host}/OnSlaveTradeConfirm?id={copierId}.\r\nA frame is pushed for every new master MarketOpen and PendingOpen (and for existing trades copied on startup).\r\nSubscribers must call SlaveTradeConfirm within 10 minutes \u2014 optionally with a lot-size override or reject=true \u2014\r\notherwise the trade is dropped and a TradeLog frame is emitted on OnTradeLog.\r\nClose, partial-close, and modify events are never gated and do not appear on this stream.","parameters":[{"name":"id","in":"query","description":"Copier id returned by the Start endpoint.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"WebSocket stream. Each frame is a PendingSlaveTrade JSON message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingSlaveTrade"}}}}}}},"/OnUpdateEquityProtectorByAccountId":{"get":{"tags":["WebSockets"],"summary":"WebSocket stream of equity-protector events for a standalone account (no copier required).\r\nConnect with: ws(s)://{host}/OnUpdateEquityProtectorByAccountId?id={accountId}.\r\nA frame is pushed whenever any configured equity-protection threshold is crossed on the account.\r\nThe same payload is also POSTed to the URL set via UpdateEquityProtectorCallback.","parameters":[{"name":"id","in":"query","description":"Account id from the AddAccount endpoint.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"WebSocket stream. Each frame is an EquityProtectionCallbackPayload JSON message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquityProtectionCallbackPayload"}}}}}}}},"components":{"schemas":{"Account":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the account.","nullable":true},"considerAccountBalance":{"type":"boolean","description":"Indicates whether the account\u0027s balance should be considered in  portfolio value"},"userKey":{"type":"string","description":"The user key that owns this account.","nullable":true},"type":{"enum":["MT5","MT4"],"type":"string","description":"The type of trading platform (e.g., MT4, MT5)."},"user":{"type":"integer","description":"The user number for this account.","format":"int64"},"password":{"type":"string","description":"The password for accessing the account.","nullable":true},"server":{"type":"string","description":"The server name as shown in the trading terminal.","nullable":true},"apiId":{"type":"string","description":"The API identifier used to connect with external services.","nullable":true},"apiKey":{"type":"string","description":"The user\u0027s API key to present when calling the trading API about this account.","nullable":true},"id":{"type":"string","description":"Unique identifier of the account (MongoDB document ID).","nullable":true},"enabled":{"type":"boolean","description":"Indicates whether the account is currently enabled."},"equityProtector":{"$ref":"#/components/schemas/EquityProtectorSettings"},"symbolEnableSettings":{"$ref":"#/components/schemas/SymbolEnableSettings"},"managerKey":{"type":"string","description":"The manager key associated with this account, used for linking to a manager entity.","nullable":true}},"additionalProperties":false,"description":"Represents a trading account entity used in the copier system."},"AccountDetails":{"type":"object","properties":{"serverName":{"type":"string","description":"Server name.","nullable":true},"user":{"type":"string","description":"Account number.","nullable":true},"password":{"type":"string","description":"Account password.","nullable":true},"host":{"type":"string","description":"Host.","nullable":true},"port":{"type":"integer","description":"Port.","format":"int32"},"serverTime":{"type":"string","description":"Server time (UTC).","format":"date-time"},"serverTimeZone":{"type":"integer","description":"Server timezone offset (in hours).","format":"int32"},"company":{"type":"string","description":"Broker company name.","nullable":true},"currency":{"type":"string","description":"Account currency.","nullable":true},"accountName":{"type":"string","description":"Account name.","nullable":true},"group":{"type":"string","description":"Account group.","nullable":true},"accountType":{"type":"string","description":"Account type (e.g., Real, Demo, Contest).","nullable":true},"accountLeverage":{"type":"integer","description":"Account leverage.","format":"int32"},"isInvestor":{"type":"boolean","description":"Indicates if the password is investor (read-only)."}},"additionalProperties":false,"description":"Common account details fields present in both MT4 and MT5 responses."},"AccountOrdersResult":{"type":"object","properties":{"name":{"type":"string","description":"Name of the account.","nullable":true},"user":{"type":"string","description":"User number associated with the account.","nullable":true},"id":{"type":"string","description":"ID","nullable":true,"readOnly":true},"apiId":{"type":"string","description":"API ID","nullable":true,"readOnly":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"},"description":"List of opened orders for the account.","nullable":true}},"additionalProperties":false,"description":"Represents the orders associated with a specific account."},"AccountResult":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the account.","nullable":true},"considerAccountBalance":{"type":"boolean","description":"Indicates whether the account\u0027s balance should be considered in  portfolio value"},"userKey":{"type":"string","description":"The user key that owns this account.","nullable":true},"type":{"enum":["MT5","MT4"],"type":"string","description":"The type of trading platform (e.g., MT4, MT5)."},"user":{"type":"integer","description":"The user number for this account.","format":"int64"},"password":{"type":"string","description":"The password for accessing the account.","nullable":true},"server":{"type":"string","description":"The server name as shown in the trading terminal.","nullable":true},"apiId":{"type":"string","description":"The API identifier used to connect with external services.","nullable":true},"apiKey":{"type":"string","description":"The user\u0027s API key to present when calling the trading API about this account.","nullable":true},"connected":{"type":"boolean","description":"Gets or sets a value indicating whether the account is currently connected."},"connectError":{"$ref":"#/components/schemas/ExceptionResult"},"accountSummary":{"$ref":"#/components/schemas/AccountSummary"},"tradeSummary":{"$ref":"#/components/schemas/TradeSummary"},"accountDetails":{"$ref":"#/components/schemas/AccountDetails"},"id":{"type":"string","description":"Unique identifier of the account (MongoDB document ID).","nullable":true},"enabled":{"type":"boolean","description":"Indicates whether the account is currently enabled."},"equityProtector":{"$ref":"#/components/schemas/EquityProtectorSettings"},"symbolEnableSettings":{"$ref":"#/components/schemas/SymbolEnableSettings"},"managerKey":{"type":"string","description":"The manager key associated with this account, used for linking to a manager entity.","nullable":true}},"additionalProperties":false,"description":"Represents the result of an account query or operation."},"AccountSummary":{"type":"object","properties":{"balance":{"type":"number","description":"Balance.","format":"double"},"credit":{"type":"number","description":"Credit.","format":"double"},"profit":{"type":"number","description":"Profit.","format":"double"},"equity":{"type":"number","description":"Equity.","format":"double"},"margin":{"type":"number","description":"Used margin.","format":"double"},"freeMargin":{"type":"number","description":"Free margin.","format":"double"},"marginLevel":{"type":"number","description":"Margin percent.","format":"double"},"leverage":{"type":"number","description":"Leverage.","format":"double"},"currency":{"type":"string","description":"Currency.","nullable":true},"type":{"type":"string","description":"Account type (Real, Demo, Contest).","nullable":true},"isInvestor":{"type":"boolean","description":"Investor mode (true if investor password is used)."},"synced":{"type":"boolean","description":"True when the source account snapshot is fully synced with the broker (live/trustworthy).\r\nFalse = last-known/stale (terminal (re)connecting); balance may be 0. MT5 only \u2014 MT4 leaves\r\nthis default (false) since that endpoint does not yet report it."}},"additionalProperties":false,"description":"Common account summary trading information fields present in both MT4 and MT5 responses."},"AccountSummaryRow":{"type":"object","properties":{"accountId":{"type":"string","description":"Account Mongo _id.","nullable":true},"apiId":{"type":"string","description":"Account ApiId (token used to reach the rest-api session).","nullable":true},"login":{"type":"integer","description":"Broker login number.","format":"int64"},"name":{"type":"string","description":"Display name.","nullable":true},"server":{"type":"string","description":"Broker server.","nullable":true},"type":{"type":"string","description":"MT4 / MT5.","nullable":true},"enabled":{"type":"boolean","description":"Whether the account is enabled in the copier system."},"managerKey":{"type":"string","description":"Manager key.","nullable":true},"userKey":{"type":"string","description":"User key.","nullable":true},"balance":{"type":"number","description":"Live balance.","format":"double"},"equity":{"type":"number","description":"Live equity.","format":"double"},"credit":{"type":"number","description":"Credit.","format":"double"},"profit":{"type":"number","description":"Floating profit.","format":"double"},"margin":{"type":"number","description":"Used margin.","format":"double"},"freeMargin":{"type":"number","description":"Free margin.","format":"double"},"leverage":{"type":"number","description":"Leverage.","format":"double"},"currency":{"type":"string","description":"Account currency.","nullable":true},"isInvestor":{"type":"boolean","description":"Investor (read-only) mode."},"synced":{"type":"boolean","description":"True when the snapshot is fully synced with the broker (MT5). Stale/unsynced if false."},"error":{"type":"string","description":"Populated when the live fetch failed (e.g. INVALID_TOKEN / timeout); Balance will be 0.","nullable":true}},"additionalProperties":false,"description":"Live account summary row returned by the /AccountSummary endpoint."},"AveragePipsUsd":{"type":"object","properties":{"averagePips":{"type":"number","description":"Average pips per trade.","format":"double"},"averageUsd":{"type":"number","description":"Average USD profit/loss per trade.","format":"double"}},"additionalProperties":false},"CloudUser":{"type":"object","properties":{"id":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"passwordHash":{"type":"string","nullable":true},"createByCopier":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"passwordResetKey":{"type":"string","nullable":true},"balance":{"type":"number","format":"double"},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"},"nullable":true},"logs":{"type":"array","items":{"type":"string"},"nullable":true},"managerKey":{"type":"string","nullable":true}},"additionalProperties":false},"CopyService":{"type":"object","properties":{"userKey":{"type":"string","description":"The user key that owns this copier session.","nullable":true},"masterAccountId":{"type":"string","description":"Master account ID.","nullable":true},"slaveAccountId":{"type":"string","description":"Slave account ID.","nullable":true},"uniqueCopierId":{"type":"string","description":"A unique hash string representing the configuration of the copier (master/slave combination).","nullable":true},"masterType":{"enum":["MT5","MT4"],"type":"string","description":"The account type of the master (e.g., MT4 or MT5)."},"masterUser":{"type":"integer","description":"The user number of the master account.","format":"int64"},"masterPassword":{"type":"string","description":"The password used to connect to the master account.","nullable":true},"masterServer":{"type":"string","description":"The server name for the master account.","nullable":true},"masterApiId":{"type":"string","description":"The unique API ID for the master account.","nullable":true},"masterName":{"type":"string","description":"A friendly name assigned to the master account.","nullable":true},"slaveType":{"enum":["MT5","MT4"],"type":"string","description":"The account type of the slave (e.g., MT4 or MT5)."},"slaveUser":{"type":"integer","description":"The user number of the slave account.","format":"int64"},"slavePassword":{"type":"string","description":"The password used to connect to the slave account.","nullable":true},"slaveServer":{"type":"string","description":"The server name for the slave account.","nullable":true},"slaveApiId":{"type":"string","description":"The unique API ID for the slave account.","nullable":true},"slaveName":{"type":"string","description":"A friendly name assigned to the slave account.","nullable":true},"copySL":{"type":"boolean","description":"Indicates whether Stop Loss values should be copied from master to slave."},"copyTP":{"type":"boolean","description":"Indicates whether Take Profit values should be copied from master to slave."},"fixedSlPips":{"type":"integer","description":"A fixed SL in pips to apply on the slave account if CopySL is false.","format":"int32"},"fixedTpPips":{"type":"integer","description":"A fixed TP in pips to apply on the slave account if CopyTP is false.","format":"int32"},"riskType":{"enum":["FixedLot","LotMultiplier","BalanceMultiplier","FixedBalanceMultiplier","EquityMultiplier"],"type":"string","description":"The risk calculation type used (FixedLot, LotMultiplier, BalanceMultiplier)."},"riskValue":{"type":"number","description":"The value used in the selected risk model (e.g., lot size or multiplier).","format":"double"},"riskMultiply":{"type":"number","description":"If used, overrides risk model with a legacy-style risk multiplier (obsolete).","format":"double"},"timeLoadingStarted":{"type":"string","description":"Timestamp when the copier began loading.","format":"date-time"},"timeLoaded":{"type":"string","description":"Timestamp when the copier finished loading successfully.","format":"date-time"},"masterAccountSummary":{"$ref":"#/components/schemas/AccountSummary"},"slaveAccountSummary":{"$ref":"#/components/schemas/AccountSummary"},"copyPendingOrders":{"type":"boolean","description":"Copy pending orders from master to slave."},"reverseCopy":{"type":"boolean","description":"Reverse buy to sell and sell to buy"},"stopLossRefinementPips":{"type":"integer","description":"Refinement pips for stop loss and take profit.","format":"int32"},"takeProfitRefinementPips":{"type":"integer","description":"Refinement pips for take profit.","format":"int32"},"fixedMasterBalance":{"type":"number","description":"Fixed Master balance for RiskType.FixedBalanceMultiplier.","format":"double"},"maxOpenSlippageType":{"enum":["Disabled","Auto","PriceDif"],"type":"string","description":"Controls how the maximum acceptable open-slippage threshold is computed.\r\n\u003Cbr\u003E\u003Cb\u003Etradecopy.SlippageType.Disabled\u003C/b\u003E (default for a new copier) \u2014 no check. Copiers that existed on 2026-10-05 were set to Auto.\r\n\u003Cbr\u003E\u003Cb\u003Etradecopy.SlippageType.Auto\u003C/b\u003E \u2014 system picks a per-symbol-category default\r\nexpressed as a raw price difference (same units as \u0060Symbol.Bid\u0060 / \u0060Symbol.Ask\u0060).\r\n\u0060MaxOpenSlippageValue\u0060 is ignored in Auto mode. The check is\r\n\u0060abs(currentPrice - masterFillPrice) \u003E autoThreshold\u0060; if it fails the slave open is skipped.\r\nPer-category Auto thresholds (in raw price units):\r\n\u003Clist type=\u0022table\u0022\u003E\u003Clistheader\u003E\u003Cterm\u003ECategory\u003C/term\u003E\u003Cterm\u003EThreshold\u003C/term\u003E\u003Cterm\u003EExample\u003C/term\u003E\u003C/listheader\u003E\u003Citem\u003E\u003Cterm\u003EFX_MAJOR   (EUR/GBP/AUD/USD/CHF/NZD/CAD pairs)\u003C/term\u003E\u003Cterm\u003E0.00100\u003C/term\u003E\u003Cterm\u003EEURUSD 1.10000 \u2192 1.10100 = 10 pips\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EFX_JPY     (xxxJPY)                            \u003C/term\u003E\u003Cterm\u003E0.150  \u003C/term\u003E\u003Cterm\u003EUSDJPY 150.000 \u2192 150.150 = 15 pips\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EFX_EXOTIC  (TRY/ZAR/MXN/etc.)                  \u003C/term\u003E\u003Cterm\u003E0.00200\u003C/term\u003E\u003Cterm\u003E20 pips on 5-digit exotics\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EMETAL_GOLD (XAUUSD)                            \u003C/term\u003E\u003Cterm\u003E1.00   \u003C/term\u003E\u003Cterm\u003E4579.24 \u2192 4580.24 = $1.00/oz\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EMETAL_SILV (XAGUSD)                            \u003C/term\u003E\u003Cterm\u003E0.01   \u003C/term\u003E\u003Cterm\u003E$0.01/oz\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003ECRYPTO     (BTC*/ETH*/USDT)                    \u003C/term\u003E\u003Cterm\u003E1000   \u003C/term\u003E\u003Cterm\u003EBTC 95,000 \u2192 96,000\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EINDEX_CFD  (US500/US30/NAS100/GER40)           \u003C/term\u003E\u003Cterm\u003E10     \u003C/term\u003E\u003Cterm\u003E10 index points\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003EENERGY     (USOIL/UKOIL/NATGAS)                \u003C/term\u003E\u003Cterm\u003E1.00   \u003C/term\u003E\u003Cterm\u003E$1 per barrel\u003C/term\u003E\u003C/item\u003E\u003Citem\u003E\u003Cterm\u003Efallback                                       \u003C/term\u003E\u003Cterm\u003E0      \u003C/term\u003E\u003Cterm\u003EAuto disabled \u2014 guard does nothing\u003C/term\u003E\u003C/item\u003E\u003C/list\u003E\u003Cbr\u003E\u003Cb\u003Etradecopy.SlippageType.PriceDif\u003C/b\u003E \u2014 user-supplied threshold from \u0060MaxOpenSlippageValue\u0060,\r\nin the same raw price-difference units. Use 0 to disable the guard.\r\n\u003Cbr\u003E\u003Cb\u003ENot applied to manually confirmed trades.\u003C/b\u003E When \u0060SlaveTradeConfirmation\u0060 is on, a trade\r\nwaits in the pending queue for a human to approve it, so the gap between the master\u0027s fill price and\r\nthe slave price is dominated by their reaction time rather than by execution slippage. Enforcing the\r\nthreshold there rejects essentially every approved trade on a fast instrument. Confirmed trades are\r\nlet through and the drift is recorded in the TradeLog instead.\r\n"},"maxOpenSlippageValue":{"type":"number","description":"Maximum acceptable open slippage when tradecopy.CopyService.MaxOpenSlippageType = tradecopy.SlippageType.PriceDif.\r\nExpressed as a raw price difference (same units as \u0060Symbol.Bid\u0060 / \u0060Symbol.Ask\u0060).\r\nExamples: 0.00100 for EURUSD (= 10 pips); 1.00 for XAUUSD (= $1.00/oz); 1000 for BTCUSDT (= $1000 drift).\r\nIgnored when \u0060MaxOpenSlippageType\u0060 = tradecopy.SlippageType.Auto or tradecopy.SlippageType.Disabled.\r\nSet to 0 to disable the slippage guard entirely.","format":"double"},"forceMinLot":{"type":"boolean","description":"Enforces the minimum lot size as defined by the slave broker\u0027s symbol settings."},"forceMaxLot":{"type":"boolean","description":"Enforces the maximum lot size as defined by the slave broker\u0027s symbol settings."},"copyExistingTrades":{"type":"boolean","description":"If true, any existing open trades on the master will be copied immediately when the copier starts."},"contractAlignment":{"type":"boolean","description":"Enables contract size alignment when calculating lot equivalence between master and slave accounts."},"copyExpiryTime":{"type":"boolean","description":"If true, copies expiry time of pending orders from master to slave."},"strictClose":{"type":"boolean","description":"Forces slave trades to close strictly when the master trade is closed, even if no SL/TP is set."},"copyMagicNumber":{"enum":["No","Yes","Custom"],"type":"string","description":"Determines how the copier handles magic numbers on slave trades (None, Copy, Custom)."},"magicNumber":{"type":"integer","description":"Custom magic number to apply to trades if tradecopy.CopyService.CopyMagicNumber is set to Custom.","format":"int32"},"tradeDelayMs":{"type":"integer","description":"Delay (in milliseconds) before placing a copied trade on the slave account.","format":"int32"},"lotRefiner":{"type":"number","description":"Multiplier applied to the calculated lot size to refine the final volume (e.g., 0.95 for 95%).","format":"double"},"filterMagicOption":{"enum":["None","Copy","Ignore"],"type":"string","description":"Specifies how to filter trades based on magic number (Copy, Ignore, None)."},"filterMagicValue":{"type":"integer","description":"The magic number value used for filtering trades when tradecopy.CopyService.FilterMagicOption is active.","format":"int32"},"filterCommentOption":{"enum":["None","Copy","Ignore"],"type":"string","description":"Specifies how to filter trades based on comment content (Copy, Ignore, None)."},"filterCommentValue":{"type":"string","description":"The comment text used to filter trades when tradecopy.CopyService.FilterCommentOption is active.","nullable":true},"filterSide":{"enum":["CopyAll","CopyBuyOnly","CopySellOnly"],"type":"string","description":"Determines which trade directions are allowed (All, Buy-only, Sell-only)."},"filterLotEnabled":{"type":"boolean","description":"Enables filtering trades based on their lot size."},"filterLotMin":{"type":"number","description":"Minimum allowed lot size when tradecopy.CopyService.FilterLotEnabled is true.","format":"double"},"filterLotMax":{"type":"number","description":"Maximum allowed lot size when tradecopy.CopyService.FilterLotEnabled is true.","format":"double"},"paused":{"type":"boolean","description":"Pauses the copier, preventing any new trades from being copied."},"pauseReason":{"enum":["None","WrongMasterPassword","ByUser","EquityProtection","ConnotConnectMaster","WrongSlavePassword","ConnotConnectSlave","MasterAccountDisable","SlaveAccountDisable","MasterAccountDeleted","SlaveAccountDeleted"],"type":"string","description":"Pause reason"},"tradeLogCallbackUrl":{"type":"string","description":"Callback url to get trade logs updates","nullable":true},"slaveTradeConfirmation":{"type":"boolean","description":"When true, new master-opened trades are held pending a SlaveTradeConfirm REST call\r\n(published via the OnSlaveTradeConfirm WebSocket) before being placed on the slave account."},"filterExistingTrade":{"type":"array","items":{"type":"string"},"description":"Optional list of master ticket numbers to filter which existing trades are copied on startup.\r\nWhen set together with CopyExistingTrades=true, only these tickets are processed.\r\nWhen SlaveTradeConfirmation=true, matching trades go into the pending confirmation queue.","nullable":true},"unmappedSymbols":{"uniqueItems":true,"type":"array","items":{"type":"string"},"nullable":true},"mappedSymbols":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MappedSymbol"},"description":"A parsed and normalized version of !:SymbolMapping, used during copier runtime.","nullable":true},"loaded":{"type":"boolean","description":"Copier started in cluster"},"id":{"type":"string","description":"Unique ID of the copier instance. Also used as the MongoDB document ID.","nullable":true},"useRedis":{"type":"boolean","description":"Indicates whether to use Redis for unique trade idempotency guards instead of MongoDB UniqueTrades.\r\nConfigured during tradecopy start via environment variable (UseRedis=true).","readOnly":true},"lastLoadFailedUtc":{"type":"string","description":"Last UTC time copier failed to start","format":"date-time"},"terminalGoneSinceUtc":{"type":"string","description":"When this copier first found the terminal it is attached to missing. Default if not.","format":"date-time"},"equityProtector":{"$ref":"#/components/schemas/EquityProtectorSettings"},"lastDailyResetUtc":{"type":"string","format":"date-time"},"managerKey":{"type":"string","description":"Manager key for accessing protected copier operations.","nullable":true}},"additionalProperties":false,"description":"Represents an active or configured trade copier between a master and a slave trading account.\r\nContains configuration, symbol mapping, and runtime information."},"EquityPoint":{"type":"object","properties":{"time":{"type":"string","description":"Time of the equity point.","format":"date-time"},"balance":{"type":"number","description":"Account balance at that time.","format":"double"},"equity":{"type":"number","description":"Account equity at that time.","format":"double"},"balanceDrawdownRaw":{"type":"number","description":"Raw balance drawdown.","format":"double"},"balanceDrawdownRelative":{"type":"number","description":"Relative balance drawdown.","format":"double"},"equityDrawdownRaw":{"type":"number","description":"Raw equity drawdown.","format":"double"},"equityDrawdownRelative":{"type":"number","description":"Relative equity drawdown.","format":"double"},"realizedPL":{"type":"number","description":"Realized profit/loss.","format":"double"},"unrealizedPL":{"type":"number","description":"Unrealized profit/loss.","format":"double"}},"additionalProperties":false},"EquityProtectionCallbackPayload":{"type":"object","properties":{"eventType":{"type":"string","description":"Gets or sets the type of event, defaulting to \u0022equity_protection\u0022.","nullable":true},"copierId":{"type":"string","description":"Gets or sets the unique identifier of the copier associated with the equity protection event.\r\nNull when triggered by standalone account monitoring (no copier).","nullable":true},"accountId":{"type":"string","description":"Gets or sets the account ID for standalone equity protection events (no copier).\r\nNull when triggered by copier-based monitoring.","nullable":true},"reason":{"enum":["None","StopLossPercent","StopLossValue","StopLossAbsolute","TakeProfitPercent","TakeProfitValue","TakeProfitAbsolute"],"type":"string","description":"Gets or sets the reason why the equity protection was triggered."},"timestamp":{"type":"string","description":"Gets or sets the timestamp of when the equity protection event occurred, in ISO 8601 format.","nullable":true},"settings":{"$ref":"#/components/schemas/EquityProtectorSettings"}},"additionalProperties":false,"description":"Represents the payload structure for equity protection callback notifications."},"EquityProtectorSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Indicates whether equity protection is enabled."},"dailyReset":{"type":"boolean","description":"Enables daily reset of drawdown tracking.\r\nWhen true, drawdown thresholds are reset at the start of each day."},"alert":{"type":"boolean","description":"Sends a notification alert when equity protection is triggered."},"disableCopier":{"type":"boolean","description":"Disables the trade copier for this account when equity protection is triggered."},"closeCopiedTrades":{"type":"boolean","description":"Closes only the trades that were opened by the trade copier when equity protection is triggered."},"closeAllTrades":{"type":"boolean","description":"Closes all open trades on the account when equity protection is triggered."},"stopLossPercent":{"type":"number","description":"The percentage-based drawdown threshold at which protection will trigger (e.g., 5%).","format":"double"},"stopLossValue":{"type":"number","description":"The fixed monetary value drawdown threshold (in account currency) that triggers protection.","format":"double"},"stopLossAbsolute":{"type":"number","description":"The minimum absolute equity (in account currency) allowed before protection triggers.","format":"double"},"takeProfitPercent":{"type":"number","description":"The percentage-based profit threshold at which take-profit protection will trigger.","format":"double"},"takeProfitValue":{"type":"number","description":"The fixed monetary gain (in account currency) that triggers take-profit protection.","format":"double"},"takeProfitAbsolute":{"type":"number","description":"The maximum absolute equity ceiling (in account currency) above which protection triggers.","format":"double"},"callbackUrl":{"type":"string","description":"The callback URL to notify when an equity protection event is triggered.","nullable":true},"startBalance":{"type":"number","description":"Start balance at enable moment","format":"double"}},"additionalProperties":false,"description":"Represents the configuration for equity protection on a trading account.\r\nUsed to define risk-based triggers and actions like disabling the copier or closing trades."},"ExceptionResult":{"type":"object","properties":{"message":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"stackTrace":{"type":"string","nullable":true}},"additionalProperties":false},"Expectancy":{"type":"object","properties":{"pips":{"type":"number","description":"Expected value in pips.","format":"double"},"dollar":{"type":"number","description":"Expected value in USD.","format":"double"}},"additionalProperties":false},"Invoice":{"type":"object","properties":{"id":{"type":"string","nullable":true},"amount":{"type":"number","format":"double"},"time":{"type":"string","format":"date-time"},"url":{"type":"string","nullable":true},"paid":{"type":"boolean"}},"additionalProperties":false},"MappedSymbol":{"type":"object","properties":{"masterSymbol":{"type":"string","description":"The source symbol from the master trading account.","nullable":true},"slaveSymbol":{"type":"string","description":"The destination symbol on the slave trading account.","nullable":true},"slaveLots":{"type":"number","description":"The fixed lot size to be used on the slave account when copying this symbol.\r\nIf set to 0, dynamic risk-based lot sizing is assumed.","format":"double"}},"additionalProperties":false,"description":"Represents a mapping between a master account symbol and a corresponding slave account symbol,\r\nincluding an optional fixed lot size for copying trades."},"MappedSymbolsResult":{"type":"object","properties":{"mappedSymbols":{"type":"array","items":{"$ref":"#/components/schemas/MappedSymbol"},"description":"A dictionary of manually defined symbol mappings (master \u2192 slave).","nullable":true},"masterSymbols":{"type":"array","items":{"type":"string"},"description":"All symbols available in the master account.","nullable":true},"slaveSymbols":{"type":"array","items":{"type":"string"},"description":"All symbols available in the slave account.","nullable":true}},"additionalProperties":false,"description":"Represents the response of GetMappedSymbols API, including mappings and available symbols."},"MarketTradeCount":{"type":"object","properties":{"marketName":{"type":"string","description":"Gets or sets the name of the market symbol (e.g., \u0022EURUSD-\u0022, \u0022GBPJPY-\u0022).","nullable":true},"count":{"type":"integer","description":"Gets or sets the total number of trades for the specified market symbol.","format":"int32"}},"additionalProperties":false,"description":"Represents the number of trades executed for a specific market symbol\r\nfrom the inception of the account."},"Order":{"type":"object","properties":{"ticket":{"type":"integer","description":"Ticket number.","format":"int64"},"openTime":{"type":"string","description":"Open time.","format":"date-time"},"closeTime":{"type":"string","description":"Close time. Just for history orders.","format":"date-time"},"expiration":{"type":"string","description":"Expiration time of pending order.","format":"date-time"},"type":{"enum":["Buy","Sell","BuyLimit","SellLimit","BuyStop","SellStop","BuyStopLimit","SellStopLimit","CloseBy","Balance","Credit"],"type":"string","description":"Order type."},"lots":{"type":"number","description":"Amount of lots. Be careful some brokers use non-standard lots.","format":"double"},"symbol":{"type":"string","description":"Trading instrument.","nullable":true},"openPrice":{"type":"number","description":"Open price.","format":"double"},"stopLoss":{"type":"number","description":"Stop loss.","format":"double"},"takeProfit":{"type":"number","description":"Take profit.","format":"double"},"closePrice":{"type":"number","description":"Close price. Just for history orders.","format":"double"},"magicNumber":{"type":"integer","description":"Identifying (magic) number.","format":"int64"},"swap":{"type":"number","description":"Swap value.","format":"double"},"commission":{"type":"number","description":"Commission value.","format":"double"},"comment":{"type":"string","description":"Order comment.","nullable":true},"profit":{"type":"number","description":"Net profit value (without swaps or commissions) in base currency.","format":"double"},"digits":{"type":"integer","description":"Number of digits after decimal point in the symbol price.","format":"int32"}},"additionalProperties":false,"description":"Contains order data."},"PendingSlaveTrade":{"type":"object","properties":{"id":{"type":"string","description":"MongoDB document ID \u2014 delegates to UniqueTradeId.","nullable":true},"copierId":{"type":"string","nullable":true},"uniqueTradeId":{"type":"string","nullable":true},"enqueuedUtc":{"type":"string","format":"date-time"},"masterTicket":{"type":"string","nullable":true},"masterSymbol":{"type":"string","nullable":true},"masterLots":{"type":"number","format":"double"},"type":{"enum":["Buy","Sell","BuyLimit","SellLimit","BuyStop","SellStop","BuyStopLimit","SellStopLimit","CloseBy","Balance","Credit"],"type":"string","description":"Order type"},"masterSL":{"type":"number","format":"double"},"masterTP":{"type":"number","format":"double"},"openPrice":{"type":"number","format":"double"},"magicNumber":{"type":"integer","format":"int64"},"masterComment":{"type":"string","description":"The MASTER order\u0027s own comment, carried so that a confirmed trade is filtered against the\r\nsame text an auto-copied one is. Documents written before this field existed read as null,\r\nwhich the comment filter treats as an empty comment.","nullable":true},"masterOrderOpenTime":{"type":"string","format":"date-time"},"updateType":{"enum":["PendingClose","MarketOpen","PendingOpen","MarketClose","PartialClose","Started","Filled","Cancelling","MarketModify","PendingModify","OnStopLoss","OnTakeProfit","OnStopOut","Balance","Expired","Rejected","MarketCloseBy","MarketCloseNotFound"],"type":"string","description":"Represents the types of updates that can occur for an order."}},"additionalProperties":false,"description":"A pending slave trade waiting for SlaveTradeConfirm before it is placed on the slave account.\r\nPersisted to the PendingSlaveTrades MongoDB collection so pending trades survive pod restarts."},"PeriodDto":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"additionalProperties":false},"ProfitData":{"type":"object","properties":{"tiket":{"type":"integer","description":"Trade ticket ID.","format":"int64"},"date":{"type":"string","description":"Date of the trade.","format":"date-time"},"profit":{"type":"number","description":"Profit from the trade.","format":"double"}},"additionalProperties":false},"Profitability":{"type":"object","properties":{"wonTrades":{"type":"integer","description":"Total number of won trades.","format":"int64"},"wonTradesPercent":{"type":"number","description":"Percentage of won trades.","format":"double"},"lostTrades":{"type":"integer","description":"Total number of lost trades.","format":"int64"},"lostTradesPercent":{"type":"number","description":"Percentage of lost trades.","format":"double"}},"additionalProperties":false},"StartResult":{"type":"object","properties":{"copierId":{"type":"string","description":"Copier token","nullable":true},"masterAccountId":{"type":"string","description":"Master account id","nullable":true},"slaveAccountId":{"type":"string","description":"Destination account api token","nullable":true},"srcId":{"type":"string","description":"Slave account id","nullable":true},"dstId":{"type":"string","description":"Destination account api token","nullable":true}},"additionalProperties":false,"description":"Result of start function"},"Stats":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/TradeSummary"},"markets":{"type":"array","items":{"$ref":"#/components/schemas/MarketTradeCount"},"description":"Gets or sets the trade counts grouped by market symbol\r\nfrom the inception of the account.","nullable":true},"maxBalanceDrawdownRaw":{"type":"number","description":"Maximum raw balance drawdown.","format":"double"},"maxBalanceDrawdownRelative":{"type":"number","description":"Maximum relative balance drawdown.","format":"double"},"maxEquityDrawdownRaw":{"type":"number","description":"Maximum raw equity drawdown.","format":"double"},"maxEquityDrawdownRelative":{"type":"number","description":"Maximum relative equity drawdown.","format":"double"},"profitability":{"$ref":"#/components/schemas/Profitability"},"pips":{"type":"number","description":"Total pips earned.","format":"double"},"lots":{"type":"number","description":"Total lots traded.","format":"double"},"comissions":{"type":"number","description":"Total commissions.","format":"double"},"averageWin":{"$ref":"#/components/schemas/AveragePipsUsd"},"averageLost":{"$ref":"#/components/schemas/AveragePipsUsd"},"longsWon":{"$ref":"#/components/schemas/Won"},"shortsWon":{"$ref":"#/components/schemas/Won"},"bestTrade":{"$ref":"#/components/schemas/ProfitData"},"worstTrade":{"$ref":"#/components/schemas/ProfitData"},"bestTradePips":{"$ref":"#/components/schemas/ProfitData"},"worstTradePips":{"$ref":"#/components/schemas/ProfitData"},"averageTradeLength":{"type":"string","description":"Average duration of a trade.","nullable":true},"profitFactor":{"type":"number","description":"Profit factor.","format":"double"},"standardDeviation":{"type":"number","description":"Standard deviation of returns.","format":"double"},"sharpeRatio":{"type":"number","description":"Sharpe ratio.","format":"double"},"zScore":{"$ref":"#/components/schemas/ZScore"},"expectancy":{"$ref":"#/components/schemas/Expectancy"},"ghpr":{"type":"number","description":"Geometric holding period return (GHPR).","format":"double"},"trades":{"type":"integer","description":"Total number of trades.","format":"int64"}},"additionalProperties":false,"description":"Trading statystics"},"StatsWithCharts":{"type":"object","properties":{"stats":{"$ref":"#/components/schemas/Stats"},"charts":{"type":"array","items":{"$ref":"#/components/schemas/EquityPoint"},"description":"Equity history chart points.","nullable":true}},"additionalProperties":false,"description":"Equity history with trading statistics."},"SymbolEnableSettings":{"type":"object","properties":{"enableAllSymbols":{"type":"boolean","description":"Determines the default symbol access strategy:\r\n\u003Clist type=\u0022bullet\u0022\u003E\u003Citem\u003E\u003Cdescription\u003E\u0060true\u0060: All symbols are enabled except those listed in tradecopy.SymbolEnableSettings.DisabledSymbols.\u003C/description\u003E\u003C/item\u003E\u003Citem\u003E\u003Cdescription\u003E\u0060false\u0060: All symbols are disabled except those listed in tradecopy.SymbolEnableSettings.EnabledSymbols.\u003C/description\u003E\u003C/item\u003E\u003C/list\u003E"},"enabledSymbols":{"type":"array","items":{"type":"string"},"description":"Array of symbols explicitly enabled.\r\nUsed only when tradecopy.SymbolEnableSettings.EnableAllSymbols is \u0060false\u0060.","nullable":true},"disabledSymbols":{"type":"array","items":{"type":"string"},"description":"Array of symbols explicitly disabled.\r\nUsed only when tradecopy.SymbolEnableSettings.EnableAllSymbols is \u0060true\u0060.","nullable":true}},"additionalProperties":false,"description":"Represents symbol access control for a trading account, allowing selective enable/disable rules."},"SymbolLite":{"type":"object","properties":{"symbol":{"type":"string","description":"Symbol name (e.g., EURUSD, XAUUSD).","nullable":true},"lotMin":{"type":"number","description":"Minimum allowed lot size for this symbol.","format":"double"},"lotMax":{"type":"number","description":"Maximum allowed lot size for this symbol.","format":"double"},"tradeMode":{"enum":["Disabled","LongOnly","ShortOnly","CloseOnly","FullAccess"],"type":"string","description":"Trade mode for this symbol (e.g., FullAccess, Disabled)."}},"additionalProperties":false,"description":"Simplified symbol information for trading purposes."},"TradeLog":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/TradeLogMessage"},"nullable":true},"url":{"type":"string","nullable":true},"masterSlaveDelayOpen":{"type":"integer","format":"int32"},"masterSlaveDelayClose":{"type":"integer","format":"int32"},"id":{"type":"string","nullable":true},"userKey":{"type":"string","nullable":true},"timeUTC":{"type":"string","format":"date-time"},"timeDoneUTC":{"type":"string","format":"date-time"},"copierId":{"type":"string","nullable":true},"updateType":{"enum":["PendingClose","MarketOpen","PendingOpen","MarketClose","PartialClose","Started","Filled","Cancelling","MarketModify","PendingModify","OnStopLoss","OnTakeProfit","OnStopOut","Balance","Expired","Rejected","MarketCloseBy","MarketCloseNotFound"],"type":"string","description":"Represents the types of updates that can occur for an order."},"masterUser":{"type":"string","nullable":true},"masterServer":{"type":"string","nullable":true},"masterName":{"type":"string","nullable":true},"masterOrder":{"$ref":"#/components/schemas/Order"},"masterApiType":{"enum":["MT5","MT4"],"type":"string","description":""},"masterApiId":{"type":"string","nullable":true},"slaveUser":{"type":"string","nullable":true},"slaveServer":{"type":"string","nullable":true},"slaveName":{"type":"string","nullable":true},"slaveSymbol":{"type":"string","nullable":true},"slaveLots":{"type":"number","format":"double"},"slaveOrderType":{"enum":["Buy","Sell","BuyLimit","SellLimit","BuyStop","SellStop","BuyStopLimit","SellStopLimit","CloseBy","Balance","Credit"],"type":"string","description":"Order type"},"slaveApiType":{"enum":["MT5","MT4"],"type":"string","description":""},"slaveApiId":{"type":"string","nullable":true},"slaveOrder":{"$ref":"#/components/schemas/Order"},"uniqueTradeId":{"type":"string","nullable":true},"exceptionMessage":{"type":"string","nullable":true},"exceptionCode":{"type":"string","nullable":true},"exceptionStackTrace":{"type":"string","nullable":true},"success":{"type":"boolean"},"slaveTicket":{"type":"string","nullable":true},"slaveType":{"type":"string","nullable":true},"tradeReason":{"enum":["NewSignal","PeriodicCheck","EquityProtector","MasterConnectFail","CopierRemove"],"type":"string"},"slaveBrokerCompany":{"type":"string","nullable":true}},"additionalProperties":false},"TradeLogMessage":{"type":"object","properties":{"timeUTC":{"type":"string","format":"date-time"},"level":{"enum":["Verbose","Debug","Information","Warning","Error","Fatal"],"type":"string"},"message":{"type":"string","nullable":true}},"additionalProperties":false},"TradeReportRow":{"type":"object","properties":{"copierId":{"type":"string","description":"The unique identifier of the copier that handled this trade.","nullable":true},"slaveApiType":{"enum":["MT5","MT4"],"type":"string","description":"The type of the slave account (MT4 or MT5)."},"slaveName":{"type":"string","description":"The display name of the slave account.","nullable":true},"slaveUser":{"type":"string","description":"The login (user number) of the slave account.","nullable":true},"ticket":{"type":"string","description":"The unique ticket number of the closed order.","nullable":true},"symbol":{"type":"string","description":"The symbol (instrument) traded, e.g. EURUSD, XAUUSD.","nullable":true},"type":{"enum":["Buy","Sell","BuyLimit","SellLimit","BuyStop","SellStop","BuyStopLimit","SellStopLimit","CloseBy","Balance","Credit"],"type":"string","description":"The order type (Buy, Sell, BuyLimit, SellLimit, etc.)."},"lots":{"type":"number","description":"The lot size of the trade.","format":"double"},"openTime":{"type":"string","description":"The date and time when the order was opened.","format":"date-time"},"closeTime":{"type":"string","description":"The date and time when the order was closed.","format":"date-time"},"openPrice":{"type":"number","description":"The price at which the order was opened.","format":"double"},"closePrice":{"type":"number","description":"The price at which the order was closed.","format":"double"},"profit":{"type":"number","description":"The profit or loss realized from the trade, in account currency.","format":"double"}},"additionalProperties":false,"description":"Represents a single closed trade record in the trade report."},"TradeReportStatusResponse":{"type":"object","properties":{"reportId":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"queuedAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true},"progressPercent":{"type":"number","format":"double"},"processedUsers":{"type":"integer","format":"int32"},"totalUsers":{"type":"integer","format":"int32"},"totalTrades":{"type":"integer","format":"int32"},"period":{"$ref":"#/components/schemas/PeriodDto"},"message":{"type":"string","nullable":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/TradeReportRow"},"nullable":true},"emailSentTo":{"type":"string","nullable":true}},"additionalProperties":false},"TradeSummary":{"type":"object","properties":{"openTrades":{"type":"integer","description":"Gets or sets the number of currently open trades.","format":"int32"},"openProfit":{"type":"number","description":"Gets or sets the total profit or loss from currently open trades.","format":"double"},"dayProfit":{"type":"number","description":"Gets or sets the profit or loss for the current day.","format":"double"},"weekProfit":{"type":"number","description":"Gets or sets the profit or loss for the current week.","format":"double"},"monthProfit":{"type":"number","description":"Gets or sets the profit or loss for the current month.","format":"double"},"totalProfit":{"type":"number","description":"Gets or sets the total cumulative profit or loss over the account\u0027s history.","format":"double"}},"additionalProperties":false,"description":"Represents a summary of trading statistics for an account."},"Won":{"type":"object","properties":{"wonCount":{"type":"integer","description":"Number of winning trades.","format":"int32"},"all":{"type":"integer","description":"Total number of trades.","format":"int32"},"wonPersent":{"type":"number","description":"Winning percentage.","format":"double"}},"additionalProperties":false},"ZScore":{"type":"object","properties":{"zScoreDecimal":{"type":"number","description":"Z-score value (decimal form).","format":"double"},"zScoreProbability":{"type":"number","description":"Z-score probability.","format":"double"}},"additionalProperties":false}}},"tags":[{"name":"Accounts","description":"Account management: CRUD, connectivity, enable/disable, password changes"},{"name":"Auth","description":"Authentication and user management"},{"name":"Copy","description":"Copier management: start, stop, update, pause, list masters and copiers"},{"name":"EquityProtector","description":"Equity protector configuration and callbacks"},{"name":"Logs","description":"Logs and trade logs"},{"name":"Orders","description":"Open and closed orders, trade statistics"},{"name":"SlaveTradeConfirm","description":"Endpoints for confirming (or rejecting) new master trades held by copiers\r\nthat were started with SlaveTradeConfirmation = true."},{"name":"SymbolMapping","description":"Symbol mapping, symbol parameters and server names"},{"name":"WebSockets","description":"Server-side WebSocket endpoints that broadcast copier events in real time.\r\nEach endpoint upgrades an HTTP GET into a WebSocket and pushes JSON messages\r\n(camelCase, enums as strings) to every subscriber of the given copier id.\r\nClients only receive; any inbound frames are ignored."}],"servers":[{"url":"https://copy.mrpc.pro"}]}