{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algotradertools/json-schema/algotradertools-connect-account-schema.json",
  "title": "ConnectAccount",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algotradertools-openapi.json#/components/schemas/ConnectAccount",
  "type": "object",
  "properties": {
    "platform": {
      "type": "string",
      "enum": [
        "mt4",
        "mt5"
      ],
      "description": "MetaTrader 4 or 5."
    },
    "server": {
      "type": "string",
      "description": "The broker's server, exactly as MetaTrader shows it.",
      "maxLength": 64
    },
    "login": {
      "type": "integer",
      "description": "The MetaTrader account number."
    },
    "password": {
      "type": "string",
      "description": "The master (trading) or investor (read-only) password. It's stored encrypted with the account's terminal and never shown again.",
      "format": "password",
      "writeOnly": true
    },
    "credential_kind": {
      "type": "string",
      "enum": [
        "investor",
        "master"
      ],
      "description": "Which password this is. Followers need `master`; a master can be either."
    },
    "nickname": {
      "type": "string",
      "description": "A name to tell it apart.",
      "maxLength": 64
    },
    "proxy_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "socks5",
        "socks4",
        "http",
        null
      ],
      "description": "The proxy's protocol: `socks5` when there's a proxy but no type."
    },
    "proxy_address": {
      "type": [
        "string",
        "null"
      ],
      "description": "A proxy for the account's terminal to reach the broker through, as `host:port`, so the broker sees the proxy's IP address instead of ours. It's tried before the terminal starts. Left out, empty or null: a direct connection.",
      "maxLength": 255
    },
    "proxy_username": {
      "type": "string",
      "description": "The proxy's username, if it needs one. Stored encrypted with the terminal, like the password, and never shown again.",
      "maxLength": 255,
      "writeOnly": true
    },
    "proxy_password": {
      "type": "string",
      "description": "The proxy's password, if it needs one. Like the username, stored encrypted and never shown again.",
      "format": "password",
      "maxLength": 255,
      "writeOnly": true
    }
  },
  "required": [
    "platform",
    "server",
    "login",
    "password",
    "credential_kind"
  ]
}