{
  "openapi": "3.0.1",
  "info": {
    "title": "TradeCopy",
    "description": "<a href=\"/readme\">Check our ReadMe</a><br/><br/>Trade copier",
    "version": "v2026.11.04-11.36"
  },
  "paths": {
    "/UpdateAccount": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Updates the specified account's name and balance consideration flag.\r\nAlso updates associated copier names by calling /UpdateAccountName for matching copiers.\r\nOmitted = unchanged: a parameter that is not sent keeps the account's current value.",
        "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. Omitted = unchanged; an empty name is refused.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "considerAccountBalance",
            "in": "query",
            "description": "Whether the copier should consider account balance. Omitted = unchanged.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account updated successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "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": "`true` to change investor password; `false` to change master password.\r\n            If changing the master password, the session will be disconnected and require reconnection.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Password changed successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "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": "`true` to change investor password; `false` to change master password.\r\n            If changing the master password, the session will be disconnected and require reconnection.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Password changed successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Display account name.\r\nExample: \"default\"",
            "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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "type": "string",
              "description": "",
              "default": "MT5"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Source account number.\r\nExample: 1124193263",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "Source account password.\r\nExample: \"4ylahjl\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "server",
            "in": "query",
            "description": "Source account server name (as seen in MT Terminal).\r\nExample: \"FreshForex-Demo\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiId",
            "in": "query",
            "description": "Not required",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account ID",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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's 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.",
            "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 — the platform the session is running on.",
            "required": true,
            "schema": {
              "enum": [
                "MT5",
                "MT4",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "type": "string",
              "description": "",
              "default": "MT5"
            }
          },
          {
            "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"
            }
          },
          {
            "name": "hidden",
            "in": "query",
            "description": "The session belongs to another customer (a public master account the portal lets this user\r\n             copy): the account's session id is never written to a reply (tradecopy.Functions.Account.HideApiId). Once hidden, an\r\n             account stays hidden.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account ID",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-AccountResult\">AccountResult</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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": "<a href=\"#model-AccountResult\">AccountResult</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountResult"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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": "<a href=\"#model-AccountResult\">AccountResult</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountResult"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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": "<a href=\"#model-AccountResult\">AccountResult</a>",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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": "<a href=\"#model-AccountResult\">AccountResult</a>",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account enabled status updated successfully."
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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's userKey",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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.",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the new user's userKey",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the new user's userKey",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/Start": {
      "get": {
        "tags": [
          "Copy"
        ],
        "parameters": [
          {
            "name": "managerKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "masterType",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "MT5",
                "MT4",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "type": "string",
              "description": "",
              "default": "MT5"
            }
          },
          {
            "name": "masterUser",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          },
          {
            "name": "masterPassword",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "masterServer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "masterName",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slaveType",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "MT5",
                "MT4",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "type": "string",
              "description": "",
              "default": "MT5"
            }
          },
          {
            "name": "slaveUser",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          },
          {
            "name": "slavePassword",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slaveServer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slaveName",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "riskType",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "FixedLot",
                "LotMultiplier",
                "BalanceMultiplier",
                "FixedBalanceMultiplier",
                "EquityMultiplier"
              ],
              "type": "string",
              "description": "Specifies the method used to calculate trading risk or position sizing.",
              "default": "FixedLot"
            }
          },
          {
            "name": "riskValue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "riskMultiply",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "masterApiId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slaveApiId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "copySL",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "copyTP",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "fixedSlPips",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "fixedTpPips",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "copyPendingOrders",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "fixedMasterBalance",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "reverseCopy",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "stopLossRefinementPips",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "takeProfitRefinementPips",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "forceMinLot",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "forceMaxLot",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "copyExistingTrades",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "contractAlignment",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "copyExpiryTime",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "strictClose",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "copyMagicNumber",
            "in": "query",
            "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",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "tradeDelayMs",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "lotRefiner",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "filterMagicOption",
            "in": "query",
            "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",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "filterCommentOption",
            "in": "query",
            "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",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "filterSide",
            "in": "query",
            "schema": {
              "enum": [
                "CopyAll",
                "CopyBuyOnly",
                "CopySellOnly"
              ],
              "type": "string",
              "description": "Specifies which trade directions to allow when copying.",
              "default": "CopyAll"
            }
          },
          {
            "name": "filterLotEnabled",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "filterLotMin",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "filterLotMax",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "slaveTradeConfirmation",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "maxOpenSlippageType",
            "in": "query",
            "schema": {
              "enum": [
                "Disabled",
                "Auto",
                "PriceDif"
              ],
              "type": "string",
              "description": "Specifies how the maximum acceptable open-slippage threshold is calculated for a copier.\r\n<br>\r\nEither way the guard is skipped for trades executed from the `SlaveTradeConfirmation` queue:\r\nthe measured drift there is mostly the confirming user's reaction time, and their confirm is the\r\nprice acceptance. See `CopyService.OrderSendInternal`.\r\n<br><b>Default: tradecopy.SlippageType.Disabled, on both transports.</b> A new copier gets it unless the request\r\nnames another type. Copiers that existed on 2026-10-05 were set to tradecopy.SlippageType.Auto by the migration\r\nin `readme/scripts/slippage-to-names.js`, and an Update that omits the type leaves it unchanged.\r\n<br><b>Stored by name.</b>`CopyService.MaxOpenSlippageType` is written as `\"Disabled\"` /\r\n`\"Auto\"` / `\"PriceDif\"`, so these numbers are no longer part of the database contract.\r\nThey were once: until 2026-09-09 the stored ints were Auto=0, PriceDif=1 (still the meaning of any\r\nint in TradeCopy3 / TradeCopyIO / Traia), then Disabled=0, Auto=1, PriceDif=2 (mrpc_copy). An int\r\nstill read from an old document is interpreted with the numbers below; the migration replaced them\r\nwith names everywhere. See `readme/max-open-slippage.md`.\r\n",
              "default": "Disabled"
            }
          },
          {
            "name": "maxOpenSlippageValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "filterExistingTrade",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "linkMode",
            "in": "query",
            "schema": {
              "enum": [
                "Comment",
                "Magic",
                "Store"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveComment",
            "in": "query",
            "schema": {
              "enum": [
                "Empty",
                "CopyMaster",
                "Custom"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveCommentText",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-StartResult\">StartResult</a>",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StartResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/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.",
            "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.",
              "default": "FixedLot"
            }
          },
          {
            "name": "riskValue",
            "in": "query",
            "description": "Numeric value interpreted based on riskType.",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "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": "Specifies how the maximum acceptable open-slippage threshold is calculated for a copier.\r\n<br>\r\nEither way the guard is skipped for trades executed from the `SlaveTradeConfirmation` queue:\r\nthe measured drift there is mostly the confirming user's reaction time, and their confirm is the\r\nprice acceptance. See `CopyService.OrderSendInternal`.\r\n<br><b>Default: tradecopy.SlippageType.Disabled, on both transports.</b> A new copier gets it unless the request\r\nnames another type. Copiers that existed on 2026-10-05 were set to tradecopy.SlippageType.Auto by the migration\r\nin `readme/scripts/slippage-to-names.js`, and an Update that omits the type leaves it unchanged.\r\n<br><b>Stored by name.</b>`CopyService.MaxOpenSlippageType` is written as `\"Disabled\"` /\r\n`\"Auto\"` / `\"PriceDif\"`, so these numbers are no longer part of the database contract.\r\nThey were once: until 2026-09-09 the stored ints were Auto=0, PriceDif=1 (still the meaning of any\r\nint in TradeCopy3 / TradeCopyIO / Traia), then Disabled=0, Auto=1, PriceDif=2 (mrpc_copy). An int\r\nstill read from an old document is interpreted with the numbers below; the migration replaced them\r\nwith names everywhere. See `readme/max-open-slippage.md`.\r\n",
              "default": "Disabled"
            }
          },
          {
            "name": "maxOpenSlippageValue",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "linkMode",
            "in": "query",
            "schema": {
              "enum": [
                "Comment",
                "Magic",
                "Store"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveComment",
            "in": "query",
            "schema": {
              "enum": [
                "Empty",
                "CopyMaster",
                "Custom"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveCommentText",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-StartResult\">StartResult</a>",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StartResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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 'Connect' 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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": "<a href=\"#model-CopyService\">CopyService</a> array",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CopyService"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopyService"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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.\r\nOmitted = unchanged: every setting is optional, and a setting that is not sent keeps the copier's current value.\r\nA sent value is applied, false, 0 and an empty text included. Send only what changes.",
        "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. Omitted = unchanged (as every setting below).",
            "schema": {
              "enum": [
                "FixedLot",
                "LotMultiplier",
                "BalanceMultiplier",
                "FixedBalanceMultiplier",
                "EquityMultiplier"
              ],
              "type": "string"
            }
          },
          {
            "name": "riskValue",
            "in": "query",
            "description": "The risk parameter value used according to the specified riskType.",
            "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"
            }
          },
          {
            "name": "copyTP",
            "in": "query",
            "description": "Whether to copy take profit values from master to slave.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "fixedSlPips",
            "in": "query",
            "description": "Fixed stop loss in pips (only used if copySL is false).",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "fixedTpPips",
            "in": "query",
            "description": "Fixed take profit in pips (only used if copyTP is false).",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "copyPendingOrders",
            "in": "query",
            "description": "If true, pending orders are copied from master to slave.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "fixedMasterBalance",
            "in": "query",
            "description": "Override balance used for risk calculations. Set to 0 to use live balance.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "reverseCopy",
            "in": "query",
            "description": "If true, reverses trade direction.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "stopLossRefinementPips",
            "in": "query",
            "description": "Adds refinement to stop loss values in pips.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "takeProfitRefinementPips",
            "in": "query",
            "description": "Adds refinement to take profit values in pips.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "forceMinLot",
            "in": "query",
            "description": "Forces minimum lot size compliance on slave account.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "forceMaxLot",
            "in": "query",
            "description": "Forces maximum lot size compliance on slave account.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "contractAlignment",
            "in": "query",
            "description": "Align contract sizes when calculating lot size between accounts.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "copyExpiryTime",
            "in": "query",
            "description": "Whether to copy expiry time for pending orders.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "strictClose",
            "in": "query",
            "description": "Enables strict close behavior to synchronize trade closure.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "copyMagicNumber",
            "in": "query",
            "description": "Controls whether and how magic numbers are copied.",
            "schema": {
              "enum": [
                "No",
                "Yes",
                "Custom"
              ],
              "type": "string"
            }
          },
          {
            "name": "magicNumber",
            "in": "query",
            "description": "Custom magic number to assign to copied trades.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "tradeDelayMs",
            "in": "query",
            "description": "Delay in milliseconds before placing a copied trade.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lotRefiner",
            "in": "query",
            "description": "Multiplier applied to the calculated lot size to refine final volume.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filterMagicOption",
            "in": "query",
            "description": "Whether to filter trades by magic number (Copy, Ignore, None).",
            "schema": {
              "enum": [
                "None",
                "Copy",
                "Ignore"
              ],
              "type": "string"
            }
          },
          {
            "name": "filterMagicValue",
            "in": "query",
            "description": "The magic number to use if filtering is enabled.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filterCommentOption",
            "in": "query",
            "description": "Whether to filter trades by comment (Copy, Ignore, None).",
            "schema": {
              "enum": [
                "None",
                "Copy",
                "Ignore"
              ],
              "type": "string"
            }
          },
          {
            "name": "filterCommentValue",
            "in": "query",
            "description": "Text to match against the comment for filtering.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filterSide",
            "in": "query",
            "description": "Whether to filter by trade direction (e.g., Buy-only, Sell-only).",
            "schema": {
              "enum": [
                "CopyAll",
                "CopyBuyOnly",
                "CopySellOnly"
              ],
              "type": "string"
            }
          },
          {
            "name": "filterLotEnabled",
            "in": "query",
            "description": "Whether to filter trades by lot size range.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "filterLotMin",
            "in": "query",
            "description": "Minimum lot size to allow if lot filter is enabled.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "filterLotMax",
            "in": "query",
            "description": "Maximum lot size to allow if lot filter is enabled.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxOpenSlippageType",
            "in": "query",
            "description": "Open-slippage guard: Disabled, Auto or PriceDif. Omitted = unchanged.",
            "schema": {
              "enum": [
                "Disabled",
                "Auto",
                "PriceDif"
              ],
              "type": "string"
            }
          },
          {
            "name": "maxOpenSlippageValue",
            "in": "query",
            "description": "Largest accepted price difference to the master's fill when maxOpenSlippageType is PriceDif.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "slaveTradeConfirmation",
            "in": "query",
            "description": "Hold new master trades for confirmation (SlaveTradeConfirm). Omitted = unchanged.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "linkMode",
            "in": "query",
            "schema": {
              "enum": [
                "Comment",
                "Magic",
                "Store"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveComment",
            "in": "query",
            "schema": {
              "enum": [
                "Empty",
                "CopyMaster",
                "Custom"
              ],
              "type": "string"
            }
          },
          {
            "name": "slaveCommentText",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Copier updated successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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. Resuming always clears the stored reason; with conditional it names the reason being resumed.",
            "schema": {
              "enum": [
                "None",
                "WrongMasterPassword",
                "ByUser",
                "EquityProtection",
                "ConnotConnectMaster",
                "WrongSlavePassword",
                "ConnotConnectSlave",
                "MasterAccountDisable",
                "SlaveAccountDisable",
                "MasterAccountDeleted",
                "SlaveAccountDeleted",
                "Suspended",
                "LowSlaveBalance"
              ],
              "type": "string",
              "description": "Enumeration representing the reasons for pausing the copier service.",
              "default": "ByUser"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "managerKey",
            "in": "query",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "conditional",
            "in": "query",
            "description": "Pause: only a copier that is running (never overwrite an existing pause). Resume: only a copier paused with\r\nexactly reason. tradecopy.PauseReason.Suspended pauses are always conditional.\r\nAnswers `SKIPPED` instead of `OK` when the policy refused the change.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Copier pause status updated successfully."
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/ReadMe": {
      "get": {
        "tags": [
          "Copy"
        ],
        "summary": "readme.md as html",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/CopiersByApiKey": {
      "get": {
        "tags": [
          "Copy"
        ],
        "summary": "Retrieves copiers for a user by their APIKey (passed in query string or APIKey header).",
        "parameters": [
          {
            "name": "apiKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-CopyService\">CopyService</a> array",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CopyService"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/StartCopier": {
      "post": {
        "tags": [
          "Copy"
        ],
        "summary": "Starts a copier directly by terminal identifiers and APIKey.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "<a href=\"#model-StartResult\">StartResult</a>",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StartResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/StartByTerminals": {
      "post": {
        "tags": [
          "Copy"
        ],
        "summary": "Starts a copier directly by terminal identifiers and APIKey.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartCopierApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "<a href=\"#model-StartResult\">StartResult</a>",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StartResult"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/UpdateEquityProtector": {
      "get": {
        "tags": [
          "EquityProtector"
        ],
        "summary": "Updates equity protector settings for a given account via query parameters.\r\nOmitted = unchanged: a setting that is not sent keeps its current value; a sent value (false and 0 included) is applied.",
        "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"
            }
          },
          {
            "name": "dailyReset",
            "in": "query",
            "description": "Enable daily drawdown reset",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "alert",
            "in": "query",
            "description": "Enable notification alert when triggered",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "disableCopier",
            "in": "query",
            "description": "Disable copier when triggered",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "closeCopiedTrades",
            "in": "query",
            "description": "Close copied trades only",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "closeAllTrades",
            "in": "query",
            "description": "Close all trades",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "stopLossPercent",
            "in": "query",
            "description": "% drawdown protection",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "stopLossValue",
            "in": "query",
            "description": "$ value drawdown protection",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "stopLossAbsolute",
            "in": "query",
            "description": "$ absolute minimum equity",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "takeProfitPercent",
            "in": "query",
            "description": "% profit protection",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "takeProfitValue",
            "in": "query",
            "description": "$ value profit protection",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "takeProfitAbsolute",
            "in": "query",
            "description": "$ absolute maximum equity",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Equity protector updated.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test callback sent successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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 'Connect' method",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Message count limit. It not specified - returns all messages. If specified - retuerns last 'limit' 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "String array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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 'Connect' method",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Record count limit. If not specified - returns all records. If specified - returns last 'limit' records.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-TradeLog\">TradeLog</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TradeLog"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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 'limit' records.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-TradeLog\">TradeLog</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TradeLog"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
        ],
        "summary": "Pauses or resumes one copier. Resuming clears the stored reason; pausing with\r\ntradecopy.PauseReason.Suspended never overwrites a pause that is already in place\r\n(tradecopy.PausePolicy). Any other pause reason overwrites, as it always did: this is the\r\noperator's tool.",
        "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",
                "Suspended",
                "LowSlaveBalance"
              ],
              "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",
                "Suspended",
                "LowSlaveBalance"
              ],
              "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-Order\">Order</a> array",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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' 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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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 `true`.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-StatsWithCharts\">StatsResult</a> object",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StatsWithCharts"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "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 `true`.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-StatsWithCharts\">StatsWithCharts</a> object",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StatsWithCharts"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "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": "<a href=\"#model-Stats\">Stats</a> object",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-Order\">Order</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/ClosedOrdersAll": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Retrieves all closed orders for all of a user's 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": "<a href=\"#model-AccountOrdersResult\">AccountOrdersResult</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountOrdersResult"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> array",
            "content": {
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResult"
                }
              }
            }
          }
        }
      }
    },
    "/AccountProviders": {
      "get": {
        "tags": [
          "ProviderAccounts"
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AddTradingAccount": {
      "post": {
        "tags": [
          "ProviderAccounts"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TradingAccountRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TradingAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TradingAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TradingAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AddProviderAccount": {
      "post": {
        "tags": [
          "ProviderAccounts"
        ],
        "summary": "Authenticate an authorized broker account and register its provider session with TradeCopy.",
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderAccountRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/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 manager key to identify the manager for the report (optional, defaults to userKey).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The user key (optional if managerKey is provided).",
            "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 \"real\", \"demo\", or \"contest\" (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's status (queued, processing, completed, timeout, failed), progress percent,\r\nqueued/started/completed timestamps, processed-vs-total users, and — once completed — 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 \"real\", \"demo\", or \"contest\" (optional).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slaveBrokerCompany",
            "in": "query",
            "description": "The slave broker company identifier (optional).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-TradeCloseReportRow\">TradeCloseReportRow</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TradeReportRow"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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 \"real\", \"demo\", or \"contest\" (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": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The user key (optional if managerKey is provided).",
            "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 \"real\", \"demo\", or \"contest\" (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's 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 — _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's 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 — which shows the stale value persisted in the copier document —\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's 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
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "<a href=\"#model-PendingSlaveTrade\">PendingSlaveTrade</a> array",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingSlaveTrade"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a>",
            "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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "type": "string",
              "description": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "String array",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "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 `SYMBOL__0.1`, e.g., `EURUSDmini__0.2`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slavelots",
            "in": "query",
            "description": "The fixed lot size to use on the slave account for this mapping. Use `0` to apply dynamic lot sizing.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "<a href=\"#model-ExceptionResult\">ExceptionResult</a> 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",
                "MT4_MTAPI",
                "MT5_MTAPI",
                "MT4_MRPC",
                "MT5_MRPC",
                "TL",
                "CT"
              ],
              "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"
              }
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "schema": {
              "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "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 — optionally with a lot-size override or reject=true —\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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "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"
            }
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The owner's user key. Required unless sent as the X-User-Key header, or the owner's API key is sent as the ApiKey header.",
            "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's balance should be considered in  portfolio value"
          },
          "userKey": {
            "type": "string",
            "description": "The user key that owns this account.",
            "nullable": true
          },
          "type": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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
          },
          "id": {
            "type": "string",
            "description": "Unique identifier of the account (MongoDB document ID).",
            "nullable": true
          },
          "apiId": {
            "type": "string",
            "description": "tradecopy.Functions.Account.ApiId as JSON writes it: the session id, or null when it is someone else's (tradecopy.Functions.Account.HideApiId).",
            "nullable": true
          },
          "hideApiId": {
            "type": "boolean",
            "description": "This account's terminal session id belongs to someone else and must never be shown to the account's owner."
          },
          "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's balance should be considered in  portfolio value"
          },
          "userKey": {
            "type": "string",
            "description": "The user key that owns this account.",
            "nullable": true
          },
          "type": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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
          },
          "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
          },
          "apiId": {
            "type": "string",
            "description": "tradecopy.Functions.Account.ApiId as JSON writes it: the session id, or null when it is someone else's (tradecopy.Functions.Account.HideApiId).",
            "nullable": true
          },
          "hideApiId": {
            "type": "boolean",
            "description": "This account's terminal session id belongs to someone else and must never be shown to the account's owner."
          },
          "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 — 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
          },
          "apiKey": {
            "type": "string",
            "description": "The API 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
          },
          "masterType": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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"
          },
          "masterServer": {
            "type": "string",
            "description": "The server name for the master account.",
            "nullable": true
          },
          "masterHidden": {
            "type": "boolean",
            "description": "The master is another customer's public account. Its session id, and anything derived from it, is never written to\r\na reply that this copier's owner can read. Copied from the master account's tradecopy.Functions.Account.HideApiId when the\r\ncopier is created."
          },
          "masterName": {
            "type": "string",
            "description": "A friendly name assigned to the master account.",
            "nullable": true
          },
          "slaveType": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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<br><b>tradecopy.SlippageType.Disabled</b> (default for new copiers, both transports) — no guard.\r\nCopiers that existed on 2026-10-05 were migrated to Auto.\r\n<br><b>tradecopy.SlippageType.Auto</b> — system picks a per-symbol-category default\r\nexpressed as a raw price difference (same units as `Symbol.Bid` / `Symbol.Ask`).\r\n`MaxOpenSlippageValue` is ignored in Auto mode. The check is\r\n`abs(currentPrice - masterFillPrice) > autoThreshold`; if it fails the slave open is skipped.\r\nPer-category Auto thresholds (in raw price units):\r\n<list type=\"table\"><listheader><term>Category</term><term>Threshold</term><term>Example</term></listheader><item><term>FX_MAJOR   (EUR/GBP/AUD/USD/CHF/NZD/CAD pairs)</term><term>0.00100</term><term>EURUSD 1.10000 → 1.10100 = 10 pips</term></item><item><term>FX_JPY     (xxxJPY)                            </term><term>0.150  </term><term>USDJPY 150.000 → 150.150 = 15 pips</term></item><item><term>FX_EXOTIC  (TRY/ZAR/MXN/etc.)                  </term><term>0.00200</term><term>20 pips on 5-digit exotics</term></item><item><term>METAL_GOLD (XAUUSD)                            </term><term>1.00   </term><term>4579.24 → 4580.24 = $1.00/oz</term></item><item><term>METAL_SILV (XAGUSD)                            </term><term>0.01   </term><term>$0.01/oz</term></item><item><term>CRYPTO     (BTC*/ETH*/USDT)                    </term><term>1000   </term><term>BTC 95,000 → 96,000</term></item><item><term>INDEX_CFD  (US500/US30/NAS100/GER40)           </term><term>10     </term><term>10 index points</term></item><item><term>ENERGY     (USOIL/UKOIL/NATGAS)                </term><term>1.00   </term><term>$1 per barrel</term></item><item><term>fallback                                       </term><term>0      </term><term>Auto disabled — guard does nothing</term></item></list><br><b>tradecopy.SlippageType.PriceDif</b> — user-supplied threshold from `MaxOpenSlippageValue`,\r\nin the same raw price-difference units. Use 0 to disable the guard.\r\n<br><b>Not applied to manually confirmed trades.</b> When `SlaveTradeConfirmation` is on, a trade\r\nwaits in the pending queue for a human to approve it, so the gap between the master's 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<br><b>Stored by name</b> (\"Disabled\" / \"Auto\" / \"PriceDif\"), not as the enum's number: the number was\r\nrenumbered once and then meant different things in different databases. A document without the\r\nfield reads as Disabled (the zero value).\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 `Symbol.Bid` / `Symbol.Ask`).\r\nExamples: 0.00100 for EURUSD (= 10 pips); 1.00 for XAUUSD (= $1.00/oz); 1000 for BTCUSDT (= $1000 drift).\r\nIgnored when `MaxOpenSlippageType` = 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's symbol settings."
          },
          "forceMaxLot": {
            "type": "boolean",
            "description": "Enforces the maximum lot size as defined by the slave broker's 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",
              "Suspended",
              "LowSlaveBalance"
            ],
            "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"
          },
          "accountState": {
            "enum": [
              "Ok",
              "AutoTradingDisabledByBroker",
              "InsufficientFunds",
              "BelowMinLot"
            ],
            "type": "string",
            "description": "The follower account's state for copying (tradecopy.CopierAccountState); Ok when opens go through."
          },
          "accountStateSinceUtc": {
            "type": "string",
            "description": "When tradecopy.CopyService.AccountState last changed (UTC).",
            "format": "date-time"
          },
          "linkMode": {
            "enum": [
              "Comment",
              "Magic",
              "Store"
            ],
            "type": "string",
            "description": "How slave orders are linked to master orders. Null: Comment (every copier created before this setting).",
            "nullable": true
          },
          "slaveComment": {
            "enum": [
              "Empty",
              "CopyMaster",
              "Custom"
            ],
            "type": "string",
            "description": "The comment of slave orders when the link is not the comment (LinkMode Magic or Store). Null: Empty.",
            "nullable": true
          },
          "slaveCommentText": {
            "type": "string",
            "description": "The comment text for tradecopy.SlaveCommentOption.Custom (31 characters at most, never starting with \"__\").",
            "nullable": true
          },
          "linkSlot": {
            "type": "integer",
            "description": "A cache of the copier's slot (collection CopierLinkSlots is the truth): an older image that saves the copier drops it and\r\nloses nothing, the slot is found again by copier id.",
            "format": "int32",
            "nullable": true
          },
          "id": {
            "type": "string",
            "description": "Unique ID of the copier instance. Also used as the MongoDB document ID.",
            "nullable": true
          },
          "masterApiId": {
            "type": "string",
            "description": "tradecopy.CopyService.MasterApiId as JSON carries it: null for a hidden master.",
            "nullable": true
          },
          "masterPassword": {
            "type": "string",
            "description": "tradecopy.CopyService.MasterPassword as JSON carries it: null for a hidden master (an attached one has none anyway).",
            "nullable": true
          },
          "uniqueCopierId": {
            "type": "string",
            "description": "tradecopy.CopyService.UniqueCopierId as JSON carries it: null for a hidden master - an old-form id holds its session,\r\n            a new one the login of another customer's account.",
            "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
          },
          "createdUtc": {
            "type": "string",
            "description": "When the copier was created (stamped by M:tradecopy.CopierPairKeys.InsertNewAsync(tradecopy.Mongo,tradecopy.CopyService,System.Boolean,System.TimeSpan,System.String)). Null on copiers created before it\r\nexisted. The per-master trade report reads it: a copier created after a master trade was never expected to copy it.",
            "format": "date-time",
            "nullable": true
          },
          "lastLoadFailedUtc": {
            "type": "string",
            "description": "Last UTC time copier failed to start",
            "format": "date-time"
          },
          "lastLoadError": {
            "type": "string",
            "description": "Why the last load failed, when it cannot succeed until the owner acts - today only ACCOUNT_API_KEY_MISSING (no owner\r\nAPI key stored for an account: it is never connected as a trial terminal). Null after a successful load.",
            "nullable": true
          },
          "terminalGoneSinceUtc": {
            "type": "string",
            "description": "When this copier first found the terminal it is attached to missing. Default if not.",
            "format": "date-time"
          },
          "ownerGoneSinceUtc": {
            "type": "string",
            "description": "When the owner check first answered that this copier's owner (tradecopy.CopyService.UserKey) does\r\nnot exist. Default if it has not, or if a later check found the owner again.",
            "format": "date-time"
          },
          "terminalDeletedSinceUtc": {
            "type": "string",
            "description": "When a connect first found a terminal of this copier deleted (CONNECT_BY_TOKEN_TERMINAL_DELETED); default while none is.",
            "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": "A copier read from Mongo without a MasterType/SlaveType element (never written by this code, but old documents\r\nexist) gets the zero value, legacy MT5, which the serializer never sees: it is given its one name here, after the\r\nwhole document is read (BsonClassMapSerializer calls EndInit)."
      },
      "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 \"equity_protection\".",
            "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 → 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., \"EURUSD-\", \"GBPJPY-\").",
            "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 — 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's 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
      },
      "ProviderAccountRequest": {
        "type": "object",
        "properties": {
          "managerKey": {
            "type": "string",
            "nullable": true
          },
          "userKey": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "type": "string",
            "description": ""
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "accountId": {
            "type": "string",
            "nullable": true
          },
          "apiKey": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "server": {
            "type": "string",
            "nullable": true
          },
          "accessToken": {
            "type": "string",
            "nullable": true
          },
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Secrets are accepted in a JSON body and are never returned by provider discovery."
      },
      "StartCopierApiRequest": {
        "type": "object",
        "properties": {
          "masterApiId": {
            "type": "string",
            "nullable": true
          },
          "slaveApiId": {
            "type": "string",
            "nullable": true
          },
          "masterPlatform": {
            "type": "string",
            "nullable": true
          },
          "masterLogin": {
            "type": "integer",
            "format": "int64"
          },
          "masterServer": {
            "type": "string",
            "nullable": true
          },
          "masterName": {
            "type": "string",
            "nullable": true
          },
          "slavePlatform": {
            "type": "string",
            "nullable": true
          },
          "slaveLogin": {
            "type": "integer",
            "format": "int64"
          },
          "slaveServer": {
            "type": "string",
            "nullable": true
          },
          "slaveName": {
            "type": "string",
            "nullable": true
          },
          "riskType": {
            "type": "string",
            "nullable": true
          },
          "riskValue": {
            "type": "number",
            "format": "double"
          },
          "copySL": {
            "type": "boolean"
          },
          "copyTP": {
            "type": "boolean"
          },
          "copyPendingOrders": {
            "type": "boolean"
          },
          "reverseCopy": {
            "type": "boolean"
          },
          "apiKey": {
            "type": "string",
            "nullable": true
          },
          "userKey": {
            "type": "string",
            "nullable": true
          },
          "fixedMasterBalance": {
            "type": "number",
            "description": "The master balance lots are sized against for tradecopy.RiskType.FixedBalanceMultiplier.",
            "format": "double",
            "nullable": true
          },
          "fixedSlPips": {
            "type": "integer",
            "description": "Stop loss distance from the open price, in points, when the master's stop loss is not copied. 0 = none.",
            "format": "int32",
            "nullable": true
          },
          "fixedTpPips": {
            "type": "integer",
            "description": "Take profit distance from the open price, in points, when the master's take profit is not copied. 0 = none.",
            "format": "int32",
            "nullable": true
          },
          "stopLossRefinementPips": {
            "type": "integer",
            "description": "Moves a copied stop loss further from the price by this many points (negative: closer).",
            "format": "int32",
            "nullable": true
          },
          "takeProfitRefinementPips": {
            "type": "integer",
            "description": "Moves a copied take profit further from the price by this many points (negative: closer).",
            "format": "int32",
            "nullable": true
          },
          "forceMinLot": {
            "type": "boolean",
            "description": "Raise a lot below the slave symbol's minimum to that minimum instead of refusing the trade. Default true.",
            "nullable": true
          },
          "forceMaxLot": {
            "type": "boolean",
            "description": "Cut a lot above the slave symbol's maximum to that maximum instead of refusing the trade. Default true.",
            "nullable": true
          },
          "copyExistingTrades": {
            "type": "boolean",
            "description": "Copy the master's already-open trades when the copier starts. Start only.",
            "nullable": true
          },
          "contractAlignment": {
            "type": "boolean",
            "description": "Convert lots by the two symbols' contract sizes. Default true.",
            "nullable": true
          },
          "copyExpiryTime": {
            "type": "boolean",
            "description": "Copy the expiry time of pending orders.",
            "nullable": true
          },
          "strictClose": {
            "type": "boolean",
            "description": "The slave trade is NOT closed when the master closes; it closes only at its own stop loss or take profit\r\n(the copier skips the close, see the MarketClose handling). Needs a stop loss and a take profit on the slave.",
            "nullable": true
          },
          "copyMagicNumber": {
            "enum": [
              "No",
              "Yes",
              "Custom"
            ],
            "type": "string",
            "description": "Magic number of slave trades: No (0), Yes (the master's) or Custom (tradecopy.CopierSettings.MagicNumber).",
            "nullable": true
          },
          "magicNumber": {
            "type": "integer",
            "description": "The magic number slave trades carry when tradecopy.CopierSettings.CopyMagicNumber is Custom.",
            "format": "int32",
            "nullable": true
          },
          "tradeDelayMs": {
            "type": "integer",
            "description": "Milliseconds to wait before each slave trade is placed. 0 = none.",
            "format": "int32",
            "nullable": true
          },
          "lotRefiner": {
            "type": "number",
            "description": "Lots added to every calculated slave lot size (e.g. 0.01). 0 = none.",
            "format": "double",
            "nullable": true
          },
          "filterMagicOption": {
            "enum": [
              "None",
              "Copy",
              "Ignore"
            ],
            "type": "string",
            "description": "Filter master trades by magic number: None, Copy (only this one) or Ignore (all but this one).",
            "nullable": true
          },
          "filterMagicValue": {
            "type": "integer",
            "description": "The magic number tradecopy.CopierSettings.FilterMagicOption compares against.",
            "format": "int32",
            "nullable": true
          },
          "filterCommentOption": {
            "enum": [
              "None",
              "Copy",
              "Ignore"
            ],
            "type": "string",
            "description": "Filter master trades by comment: None, Copy (comment contains the text) or Ignore (comment does not).",
            "nullable": true
          },
          "filterCommentValue": {
            "type": "string",
            "description": "The text tradecopy.CopierSettings.FilterCommentOption looks for in the master's comment (case-insensitive).",
            "nullable": true
          },
          "filterSide": {
            "enum": [
              "CopyAll",
              "CopyBuyOnly",
              "CopySellOnly"
            ],
            "type": "string",
            "description": "Copy all trades, buys only or sells only.",
            "nullable": true
          },
          "filterLotEnabled": {
            "type": "boolean",
            "description": "Copy only master trades whose volume is within [tradecopy.CopierSettings.FilterLotMin, tradecopy.CopierSettings.FilterLotMax].",
            "nullable": true
          },
          "filterLotMin": {
            "type": "number",
            "description": "Smallest master volume copied when tradecopy.CopierSettings.FilterLotEnabled.",
            "format": "double",
            "nullable": true
          },
          "filterLotMax": {
            "type": "number",
            "description": "Largest master volume copied when tradecopy.CopierSettings.FilterLotEnabled.",
            "format": "double",
            "nullable": true
          },
          "slaveTradeConfirmation": {
            "type": "boolean",
            "description": "Hold every new master trade until it is confirmed (SlaveTradeConfirm) or 10 minutes pass.",
            "nullable": true
          },
          "maxOpenSlippageType": {
            "enum": [
              "Disabled",
              "Auto",
              "PriceDif"
            ],
            "type": "string",
            "description": "The open-slippage guard: Disabled, Auto (per symbol category) or PriceDif (tradecopy.CopierSettings.MaxOpenSlippageValue).",
            "nullable": true
          },
          "maxOpenSlippageValue": {
            "type": "number",
            "description": "Largest accepted price difference to the master's fill when tradecopy.CopierSettings.MaxOpenSlippageType is PriceDif.",
            "format": "double",
            "nullable": true
          },
          "filterExistingTrade": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With tradecopy.CopierSettings.CopyExistingTrades: copy only these master tickets on start. Start only.",
            "nullable": true
          },
          "linkMode": {
            "enum": [
              "Comment",
              "Magic",
              "Store"
            ],
            "type": "string",
            "description": "How slave orders are linked to master orders: Comment (the \"__login_ticket\" mark), Magic (a link magic number, the\r\ncomment is free) or Store (no magic and no mark). Null on a start: the deployment's default for the slave\r\n(COPIER_LINK_MODE); on an update: unchanged.",
            "nullable": true
          },
          "slaveComment": {
            "enum": [
              "Empty",
              "CopyMaster",
              "Custom"
            ],
            "type": "string",
            "description": "The slave order comment when the link is not the comment: Empty, CopyMaster or Custom (tradecopy.CopierSettings.SlaveCommentText).",
            "nullable": true
          },
          "slaveCommentText": {
            "type": "string",
            "description": "The comment for tradecopy.SlaveCommentOption.Custom: at most 31 characters, never starting with \"__\".",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Direct copier start request using terminals and APIKey. Every tradecopy.CopierSettings property can be given\r\ntoo (camelCase, enums by name); one left out is the copier's default."
      },
      "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<list type=\"bullet\"><item><description>`true`: All symbols are enabled except those listed in tradecopy.SymbolEnableSettings.DisabledSymbols.</description></item><item><description>`false`: All symbols are disabled except those listed in tradecopy.SymbolEnableSettings.EnabledSymbols.</description></item></list>"
          },
          "enabledSymbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of symbols explicitly enabled.\r\nUsed only when tradecopy.SymbolEnableSettings.EnableAllSymbols is `false`.",
            "nullable": true
          },
          "disabledSymbols": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of symbols explicitly disabled.\r\nUsed only when tradecopy.SymbolEnableSettings.EnableAllSymbols is `true`.",
            "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
          },
          "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",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "type": "string",
            "description": ""
          },
          "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",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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
          },
          "masterHidden": {
            "type": "boolean",
            "description": "The copier's master is another customer's public account (tradecopy.CopyService.MasterHidden)."
          },
          "masterActionKey": {
            "type": "string",
            "description": "The master action this row belongs to: the same for every copier of the master (M:tradecopy.MasterActions.Of(tradecopy.ApiType,System.String,System.String,System.Int64,System.String,System.String)).",
            "nullable": true
          },
          "masterActionKind": {
            "type": "string",
            "description": "open, pending_place, pending_modify, pending_delete, modify, partial_close or close (M:tradecopy.MasterActions.Kind(tradecopy.UpdateType)).",
            "nullable": true
          },
          "masterActionLots": {
            "type": "number",
            "description": "The master lots the action moved where they differ from the order's lots: the closed part of a partial close.",
            "format": "double",
            "nullable": true
          },
          "slaveLotsCalculated": {
            "type": "number",
            "description": "A follower lot below the broker's minimum: the lots the sizing came to (the row's own lots are 0).",
            "format": "double",
            "nullable": true
          },
          "slaveMinLot": {
            "type": "number",
            "description": "The follower symbol's minimum lot, where a refusal named it.",
            "format": "double",
            "nullable": true
          },
          "masterApiId": {
            "type": "string",
            "description": "tradecopy.TradeLog.MasterApiId as JSON carries it: null for a hidden master.",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "tradecopy.TradeLog.Url as JSON carries it: null for a hidden master (a call about the master names its session).",
            "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",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "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's history.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Represents a summary of trading statistics for an account."
      },
      "TradingAccountRequest": {
        "type": "object",
        "properties": {
          "managerKey": {
            "type": "string",
            "nullable": true
          },
          "userKey": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "enum": [
              "MT5",
              "MT4",
              "MT4_MTAPI",
              "MT5_MTAPI",
              "MT4_MRPC",
              "MT5_MRPC",
              "TL",
              "CT"
            ],
            "type": "string",
            "description": ""
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "user": {
            "type": "integer",
            "format": "int64"
          },
          "password": {
            "type": "string",
            "nullable": true
          },
          "server": {
            "type": "string",
            "nullable": true
          },
          "apiKey": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "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": "ProviderAccounts",
      "description": "Provider discovery and token/password authentication for standalone CT/TL accounts."
    },
    {
      "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."
    }
  ]
}