{
  "_type": "export",
  "__export_format": 4,
  "__export_date": "2026-05-25T00:00:00.000Z",
  "__export_source": "tickerall.docs:v1",
  "resources": [
    {
      "_id": "wrk_tickerall",
      "_type": "workspace",
      "name": "TickerAll API",
      "description": "Connect and automate your own MT4/MT5 broker accounts. Set the apiKey + accountId environment variables (Manage Environments), then send. Generated from https://tickerall.com/docs.",
      "scope": "collection"
    },
    {
      "_id": "env_tickerall_base",
      "_type": "environment",
      "parentId": "wrk_tickerall",
      "name": "Base environment",
      "data": {
        "baseUrl": "https://api.tickerall.com",
        "wsBaseUrl": "wss://api.tickerall.com",
        "apiKey": "cf_api_xxxxxxxxxxxxxxxxxxxx",
        "accountId": "acc_8Kd3...",
        "ticket": "4072808150"
      },
      "dataPropertyOrder": {
        "&": [
          "baseUrl",
          "wsBaseUrl",
          "apiKey",
          "accountId",
          "ticket"
        ]
      },
      "metaSortKey": 1
    },
    {
      "_id": "fld_sessions",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Sessions",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 0
    },
    {
      "_id": "req_post_v1_sessions",
      "_type": "request",
      "parentId": "fld_sessions",
      "name": "Open a broker session",
      "description": "Connect a broker account. We authenticate and warm a live connection, then hand back an accountId — the handle for THIS broker connection. One API key can hold several broker accounts, so the id lives in this response (and in GET /v1/accounts), NOT in the key. Use it in every later /v1/accounts/:id call. Your password is held in memory only while the connection is live, never saved to disk.\n\n**Body fields**\n- `broker` (\"mt4\" | \"mt5\") — required — Which platform your broker server runs.\n- `server` (string) — required — Broker server name, e.g. \"Exness-MT5Trial7\".\n- `account` (number | string) — required — Your numeric broker login — the account number your broker assigns (e.g. 12345678). NOT your TickerAll email.\n- `password` (string) — required — Broker (investor or master) password. Used once to authenticate; never persisted.\n- `terminalType` (\"MOBILE\" | \"WEB\") — Which client the connection presents AS — MOBILE (default) or WEB. Both expose the full surface (account, quotes, positions, history). Omit for MOBILE.\n- `webTerminalUrl` (string) — The broker’s web-terminal URL, e.g. https://mt5.yourbroker.com. REQUIRED when terminalType is \"WEB\" — web terminals are per-broker-domain, so the URL must be supplied. Ignored for MOBILE.\n- `webEndpoint` (string) — Advanced, optional: an explicit WebSocket endpoint override (e.g. wss://host/path) for the rare broker whose WS host/path differs from the webTerminalUrl derivation. Ignored for MOBILE.\n\n**Notes**\n- On the Free tier, only demo broker accounts are accepted — a real-money login is rejected with FREE_TIER_LIVE_REJECTED.\n- The connection stays warm for a while (see expiresAt). If it cools, calls return BROKER_ACCOUNT_NOT_HOT — just POST /v1/sessions again to reconnect.\n\n**Example response** — 200 OK\n```json\n{\n  \"accountId\": \"acc_8Kd3...\",\n  \"isDemo\": true,\n  \"status\": \"connected\",\n  \"expiresAt\": \"2026-05-22T18:42:10.000Z\"\n}\n```",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/sessions",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"broker\": \"mt5\",\n  \"server\": \"Exness-MT5Trial7\",\n  \"account\": 12345678,\n  \"password\": \"your-broker-password\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 0,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_delete_v1_sessions_accountid",
      "_type": "request",
      "parentId": "fld_sessions",
      "name": "Disconnect a session",
      "description": "Disconnect a broker account and release its connection. Returns no body.\n\n**Path parameters**\n- `accountId` (string) — required — The accountId returned by POST /v1/sessions.",
      "method": "DELETE",
      "url": "{{ _.baseUrl }}/v1/sessions/{{ _.accountId }}",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 1,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "fld_accounts",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Accounts",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 1000
    },
    {
      "_id": "req_get_v1_accounts",
      "_type": "request",
      "parentId": "fld_accounts",
      "name": "List connected accounts",
      "description": "List every broker account attached to your API key, with connection state.\n\n**Notes**\n- accountNumber is masked to the last 4 digits. hot=false means the connection cooled — POST /v1/sessions to re-warm it.\n\n**Example response** — 200 OK\n```json\n[\n  {\n    \"id\": \"acc_8Kd3...\",\n    \"broker\": \"mt5\",\n    \"server\": \"Exness-MT5Trial7\",\n    \"accountNumber\": \"****5678\",\n    \"isDemo\": true,\n    \"status\": \"CONNECTED\",\n    \"hot\": true,\n    \"lastHotAt\": \"2026-05-22T18:30:01.000Z\",\n    \"createdAt\": \"2026-05-20T09:11:55.000Z\"\n  }\n]\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/accounts",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 1000,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_get_v1_accounts_id",
      "_type": "request",
      "parentId": "fld_accounts",
      "name": "Get account info + positions",
      "description": "Live account info — balance, equity, margin, leverage — plus the current open positions.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Notes**\n- If the connection has cooled, you get status:\"offline\" with a hint instead of live data — POST /v1/sessions to reconnect.\n- Money fields (equity, margin, freeMargin, marginLevel) may be null on an MT4 account that has not yet pushed a balance frame — null is honest \"not available yet\", never a misleading 0.\n\n**Example response** — 200 OK (status: \"online\")\n```json\n{\n  \"id\": \"acc_8Kd3...\",\n  \"broker\": \"mt5\",\n  \"server\": \"Exness-MT5Trial7\",\n  \"accountNumber\": \"****5678\",\n  \"isDemo\": true,\n  \"status\": \"online\",\n  \"account\": {\n    \"name\": \"Demo Account 12345678\",\n    \"accountType\": \"demo\",\n    \"leverage\": 500,\n    \"balance\": 9871.42,\n    \"currency\": \"USD\",\n    \"equity\": 9863.10,\n    \"margin\": 142.50,\n    \"freeMargin\": 9720.60,\n    \"marginLevel\": 6921.5\n  },\n  \"positions\": [\n    {\n      \"ticket\": 4072808150,\n      \"symbol\": \"BTCUSDm\",\n      \"side\": \"BUY\",\n      \"volume\": 0.10,\n      \"entryPrice\": 77512.73,\n      \"stopLoss\": 71000,\n      \"takeProfit\": 84000,\n      \"currentPrice\": 77640.10,\n      \"profit\": 12.74,\n      \"swap\": 0,\n      \"commission\": 0,\n      \"comment\": \"my-strategy\",\n      \"magic\": 0,\n      \"openTime\": \"2026-05-22T17:55:03.000Z\"\n    }\n  ]\n}\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 1001,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_delete_v1_accounts_id",
      "_type": "request",
      "parentId": "fld_accounts",
      "name": "Remove a broker account",
      "description": "Remove a broker account from your roster. We disconnect its live connection and drop it from your account list and from billing — this does NOT touch the broker account itself or any open positions. Reversible: reconnect the same login with POST /v1/sessions to re-add it.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Notes**\n- Idempotent — removing an already-removed account returns the same 200 shape.\n- If the account had always-hot enabled, that per-connection charge stops immediately; billableCount is your remaining always-hot connection count.\n\n**Example response** — 200 OK\n```json\n{\n  \"id\": \"acc_8Kd3...\",\n  \"status\": \"DISCONNECTED\",\n  \"removed\": true,\n  \"billableCount\": 0\n}\n```",
      "method": "DELETE",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 1002,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_post_v1_accounts_id_migrate",
      "_type": "request",
      "parentId": "fld_accounts",
      "name": "POST /v1/accounts/:id/migrate",
      "description": "Switch which terminal type the account presents AS (\"MOBILE\" or \"WEB\"). Your open positions, pending orders and balance live on the broker account, not the connection, so they are preserved across the switch.\n\nRequires an `Idempotency-Key` header — a unique string per logical action, so a retried request never double-fires.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Body fields**\n- `to` (\"MOBILE\" | \"WEB\") — required — The transport to switch to.\n\n**Notes**\n- status is \"noop\" when the account is already on the requested transport.\n- Switching runs only when the account is idle (no in-flight trade — otherwise 409).\n- Both terminal types expose the full surface (account, quotes, positions, history).\n- The switch is zero-gap — the new transport is warmed before the old session is dropped — so open positions, orders and balance carry over untouched.\n\n**Example response** — 200 OK\n```json\n{\n  \"id\": \"acc_8Kd3...\",\n  \"terminalType\": \"MOBILE\",\n  \"status\": \"noop\"\n}\n```",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/migrate",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"to\": \"2026-05-29\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 1003,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "fld_symbols",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Symbols",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 2000
    },
    {
      "_id": "req_get_v1_accounts_id_symbols",
      "_type": "request",
      "parentId": "fld_symbols",
      "name": "List tradeable symbols",
      "description": "List tradeable symbols on the account, in the broker’s native names (pass-through, no normalization). symbols is the full catalog; watched is the subset that is actively streaming live ticks right now.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Notes**\n- Use a name from symbols when placing orders; subscribe to a name to start it ticking on the WebSocket.\n\n**Example response** — 200 OK\n```json\n{\n  \"symbols\": [\"BTCUSDm\", \"ETHUSDm\", \"EURUSDm\", \"XAUUSDm\", \"USOILm\", \"...\"],\n  \"watched\": [\"BTCUSDm\", \"ETHUSDm\", \"EURUSDm\"]\n}\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/symbols",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 2000,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "fld_candles_history",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Candles & history",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 3000
    },
    {
      "_id": "req_get_v1_accounts_id_candles",
      "_type": "request",
      "parentId": "fld_candles_history",
      "name": "Historical OHLC candles (authed)",
      "description": "Fetch historical OHLC bars from your connected broker, for any symbol the broker streams on this account. Returns the most-recent N hours of bars at the requested timeframe. Coarser timeframes (H4, D1, W1, MN1) reach much further back — daily bars typically cover years of history.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Query parameters**\n- `symbol` (string) — required — Broker-native symbol name, e.g. \"BTCUSDm\". Discover names via GET /v1/accounts/:id/symbols.\n- `hours` (number) — How many hours of data to return, counted backwards from now. Defaults to 24, capped at ~5 years.\n- `timeframe` (\"M1\"|\"M5\"|\"M15\"|\"M30\"|\"H1\"|\"H4\"|\"D1\"|\"W1\"|\"MN1\") — Bar interval. Defaults to \"M5\". Coarser timeframes go back further for the same hours value.\n\n**Notes**\n- Authed — needs your API key (same as the rest of the customer API). Works for any symbol your broker exposes on the connected account.\n- Each candle is { timestamp, open, high, low, close, bid }. timestamp is the bar OPEN time in Unix seconds (UTC); bid mirrors close.\n- Timeframes: M1, M5, M15, M30, H1, H4, D1, W1, MN1. Daily and coarser reach back years; intraday (M1–H4) covers recent months. One request returns as much history as fits in a few seconds — pass a large hours and take what comes back.\n- Deep look-backs are isolated onto a dedicated history connection — a big walk never disturbs your live tick stream.\n- If the broker returns no decodable bars for the symbol/range (e.g. an illiquid pair), the response is a 200 with an empty candles array — never a 500.\n\n**Example response** — 200 OK\n```json\n{\n  \"symbol\": \"BTCUSDm\",\n  \"hours\": 17520,\n  \"timeframe\": \"D1\",\n  \"candles\": [\n    { \"timestamp\": 1747699200, \"open\": 104200.10, \"high\": 107840.55, \"low\": 103520.00, \"close\": 106910.73, \"bid\": 106910.73 },\n    { \"timestamp\": 1747785600, \"open\": 106910.73, \"high\": 108100.00, \"low\": 105480.20, \"close\": 107512.40, \"bid\": 107512.40 }\n  ]\n}\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/candles",
      "body": {},
      "parameters": [
        {
          "name": "symbol",
          "value": "BTCUSDm",
          "description": "Broker-native symbol name, e.g. \"BTCUSDm\". Discover names via GET /v1/accounts/:id/symbols.",
          "disabled": false
        },
        {
          "name": "hours",
          "value": "8760",
          "description": "How many hours of data to return, counted backwards from now. Defaults to 24, capped at ~5 years.",
          "disabled": false
        },
        {
          "name": "timeframe",
          "value": "D1",
          "description": "Bar interval. Defaults to \"M5\". Coarser timeframes go back further for the same hours value.",
          "disabled": false
        }
      ],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 3000,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_get_v1_public_candles",
      "_type": "request",
      "parentId": "fld_candles_history",
      "name": "Historical OHLC candles (public demo)",
      "description": "Unauthenticated read of the always-on demo feed — powers the sparklines and chart on tickerall.com. Limited to TickerAll’s demo symbol list and only callable from tickerall.com (origin-gated). For arbitrary broker symbols from your own code, use GET /v1/accounts/:id/candles above.\n\n**Query parameters**\n- `symbol` (string) — required — One of the demo feed’s symbols (e.g. BTCUSDm, ETHUSDm, EURUSDm, XAUUSDm).\n- `hours` (number) — How many hours of data to return. Defaults to 24, capped at ~5 years.\n- `timeframe` (\"M1\"|\"M5\"|\"M15\"|\"M30\"|\"H1\"|\"H4\"|\"D1\"|\"W1\"|\"MN1\") — Bar interval. Defaults to \"M5\". Coarser timeframes go back further for the same hours value.\n\n**Notes**\n- No API key needed, but origin-gated: this endpoint accepts requests from tickerall.com only and exists to drive the public demo widgets. For programmatic access from your own code use GET /v1/accounts/:id/candles instead — it works on any symbol your broker exposes.\n- Each candle is { timestamp, open, high, low, close, bid }. timestamp is the bar OPEN time in Unix seconds (UTC); bid mirrors close.\n- Only the demo feed’s symbol list is available here. For any other symbol, connect a broker account and call GET /v1/accounts/:id/candles instead.\n\n**Example response** — 200 OK\n```json\n{\n  \"symbol\": \"BTCUSDm\",\n  \"hours\": 17520,\n  \"timeframe\": \"D1\",\n  \"candles\": [\n    { \"timestamp\": 1747699200, \"open\": 104200.10, \"high\": 107840.55, \"low\": 103520.00, \"close\": 106910.73, \"bid\": 106910.73 },\n    { \"timestamp\": 1747785600, \"open\": 106910.73, \"high\": 108100.00, \"low\": 105480.20, \"close\": 107512.40, \"bid\": 107512.40 }\n  ]\n}\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/public/candles",
      "body": {},
      "parameters": [
        {
          "name": "symbol",
          "value": "BTCUSDm",
          "description": "One of the demo feed’s symbols (e.g. BTCUSDm, ETHUSDm, EURUSDm, XAUUSDm).",
          "disabled": false
        },
        {
          "name": "hours",
          "value": "8760",
          "description": "How many hours of data to return. Defaults to 24, capped at ~5 years.",
          "disabled": false
        },
        {
          "name": "timeframe",
          "value": "D1",
          "description": "Bar interval. Defaults to \"M5\". Coarser timeframes go back further for the same hours value.",
          "disabled": false
        }
      ],
      "headers": [],
      "authentication": {},
      "metaSortKey": 3001,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "fld_orders",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Orders",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 4000
    },
    {
      "_id": "req_post_v1_accounts_id_orders",
      "_type": "request",
      "parentId": "fld_orders",
      "name": "Place an order",
      "description": "Place a market order (fills immediately) or a pending limit/stop order (rests until price is hit).\n\nRequires an `Idempotency-Key` header — a unique string per logical action, so a retried request never double-fires.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Body fields**\n- `type` (\"market\" | \"limit\" | \"stop\") — required — Order type.\n- `symbol` (string) — required — Broker-native symbol, e.g. \"BTCUSDm\".\n- `side` (\"BUY\" | \"SELL\") — required — Trade direction.\n- `volume` (number) — required — Lots, e.g. 0.10. Must be positive.\n- `price` (number) — Trigger price. Required for limit and stop; ignored for market.\n- `stopLoss` (number) — Stop-loss price. Omit for none.\n- `takeProfit` (number) — Take-profit price. Omit for none.\n- `comment` (string (≤ 31 chars)) — Optional strategy tag stored on the order.\n\n**Notes**\n- Requires an Idempotency-Key header (see Conventions). Re-sending the same key returns the original response without placing a second order.\n- status is \"open\" for market orders and \"pending\" for limit/stop orders.\n- A broker rejection (bad volume, market closed, stop-level too tight, insufficient margin) comes back as 422 BROKER_REJECTED with the broker’s reason in message.\n\n**Example response** — 201 Created\n```json\n{\n  \"ticket\": 4072808150,\n  \"symbol\": \"BTCUSDm\",\n  \"side\": \"BUY\",\n  \"type\": \"market\",\n  \"volume\": 0.10,\n  \"price\": null,\n  \"stopLoss\": 71000,\n  \"takeProfit\": 84000,\n  \"comment\": \"my-strategy\",\n  \"status\": \"open\",\n  \"timestamp\": \"2026-05-22T17:55:03.000Z\"\n}\n```",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/orders",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"type\": \"market\",\n  \"symbol\": \"BTCUSDm\",\n  \"side\": \"BUY\",\n  \"volume\": 0.1,\n  \"stopLoss\": 71000,\n  \"takeProfit\": 84000\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 4000,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_delete_v1_accounts_id_positions_ticket",
      "_type": "request",
      "parentId": "fld_orders",
      "name": "Close a position",
      "description": "Close an open position. Omit volume for a full close, or pass a smaller volume for a partial close.\n\nRequires an `Idempotency-Key` header — a unique string per logical action, so a retried request never double-fires.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n- `ticket` (number) — required — Ticket of the position to close (from the order response or GET /v1/accounts/:id).\n\n**Body fields**\n- `volume` (number) — Partial-close volume in lots. If omitted, the whole position is closed.\n\n**Notes**\n- Requires an Idempotency-Key header.\n- If the ticket is not an open position on this account you get 404 TICKET_NOT_FOUND.\n\n**Example response** — 200 OK\n```json\n{\n  \"ticket\": 4072808150,\n  \"symbol\": \"BTCUSDm\",\n  \"side\": \"BUY\",\n  \"volume\": 0.10,\n  \"closed\": true,\n  \"timestamp\": \"2026-05-22T18:10:44.000Z\"\n}\n```",
      "method": "DELETE",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/positions/{{ _.ticket }}",
      "body": {},
      "parameters": [],
      "headers": [
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 4001,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_patch_v1_accounts_id_positions_ticket",
      "_type": "request",
      "parentId": "fld_orders",
      "name": "Modify stop-loss / take-profit",
      "description": "Modify the stop-loss and/or take-profit of an open position. Provide at least one of stopLoss / takeProfit.\n\nRequires an `Idempotency-Key` header — a unique string per logical action, so a retried request never double-fires.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n- `ticket` (number) — required — Ticket of the position to modify.\n\n**Body fields**\n- `stopLoss` (number) — New stop-loss price. Omit to leave unchanged.\n- `takeProfit` (number) — New take-profit price. Omit to leave unchanged.\n\n**Notes**\n- Requires an Idempotency-Key header.\n- You must supply at least one of stopLoss or takeProfit; sending neither is a VALIDATION_ERROR.\n- Some brokers enforce a minimum stop distance (stop level). Too-tight values come back as 422 BROKER_REJECTED.\n\n**Example response** — 200 OK\n```json\n{\n  \"ticket\": 4072808150,\n  \"symbol\": \"BTCUSDm\",\n  \"side\": \"BUY\",\n  \"volume\": 0.10,\n  \"stopLoss\": 72000,\n  \"takeProfit\": 85000,\n  \"timestamp\": \"2026-05-22T18:12:09.000Z\"\n}\n```",
      "method": "PATCH",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/positions/{{ _.ticket }}",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"stopLoss\": 71000,\n  \"takeProfit\": 84000\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 4002,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "fld_trade_history",
      "_type": "request_group",
      "parentId": "wrk_tickerall",
      "name": "Trade history",
      "description": "",
      "environment": {},
      "environmentPropertyOrder": null,
      "metaSortKey": 5000
    },
    {
      "_id": "req_get_v1_accounts_id_history",
      "_type": "request",
      "parentId": "fld_trade_history",
      "name": "Closed-trade history",
      "description": "Closed-trade history for the account — executed trades paired into round-trips (entry + exit), the equivalent of MT5’s history_deals_get. Returns the recent window your broker provides on connect plus any trades closed live during the session. Filter by symbol and close-time range.\n\n**Path parameters**\n- `id` (string) — required — accountId.\n\n**Query parameters**\n- `symbol` (string) — Narrow to one broker-native symbol, e.g. \"ETHUSDm\". Omit for all symbols.\n- `from` (ISO-8601 | epoch seconds) — Only trades closed at/after this time.\n- `to` (ISO-8601 | epoch seconds) — Only trades closed at/before this time.\n- `limit` (number) — Max rows returned, newest-first. Defaults to 500, capped at 5000.\n- `waitMs` (number) — How long to wait (ms) for history to populate on a just-connected account. Defaults to 4000; pass 0 to skip the wait on a warm connection.\n\n**Notes**\n- Returns the recent window your broker pushes on connect (typically the last few weeks) plus trades closed live during the current session. from/to filter those rows — they do not fetch further back than the broker’s window.\n- Each row is a round-trip: ticket is the open/position ticket; closeTicket is the closing deal (may be null for a trade closed live this session). profit is realised P/L in the account currency.\n- complete=true is a confirmed round-trip with trustworthy P/L. complete=false marks an incomplete/unmatched row, where profit is reported as null rather than a misleading 0.\n- swap and commission are reported as 0 (not carried in this data set).\n- A cheap read that never disturbs your live tick stream. On a connection that has cooled you get 409 BROKER_ACCOUNT_NOT_HOT — POST /v1/sessions to reconnect.\n\n**Example response** — 200 OK\n```json\n{\n  \"trades\": [\n    {\n      \"ticket\": \"4072808150\",\n      \"symbol\": \"ETHUSDm\",\n      \"side\": \"BUY\",\n      \"volume\": 0.10,\n      \"openPrice\": 2500.50,\n      \"closePrice\": 2510.25,\n      \"openTime\": \"2026-05-20T10:00:00.000Z\",\n      \"closeTime\": \"2026-05-20T12:30:00.000Z\",\n      \"profit\": 0.98,\n      \"swap\": 0,\n      \"commission\": 0,\n      \"stopLoss\": 0,\n      \"takeProfit\": 0,\n      \"closeTicket\": \"4072808151\",\n      \"complete\": true\n    }\n  ],\n  \"count\": 1,\n  \"limit\": 500\n}\n```",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/accounts/{{ _.accountId }}/history",
      "body": {},
      "parameters": [
        {
          "name": "symbol",
          "value": "BTCUSDm",
          "description": "Narrow to one broker-native symbol, e.g. \"ETHUSDm\". Omit for all symbols.",
          "disabled": false
        },
        {
          "name": "from",
          "value": "2026-05-01",
          "description": "Only trades closed at/after this time.",
          "disabled": false
        },
        {
          "name": "to",
          "value": "2026-05-29",
          "description": "Only trades closed at/before this time.",
          "disabled": false
        },
        {
          "name": "limit",
          "value": "50",
          "description": "Max rows returned, newest-first. Defaults to 500, capped at 5000.",
          "disabled": false
        },
        {
          "name": "waitMs",
          "value": "4000",
          "description": "How long to wait (ms) for history to populate on a just-connected account. Defaults to 4000; pass 0 to skip the wait on a warm connection.",
          "disabled": false
        }
      ],
      "headers": [],
      "authentication": {
        "type": "bearer",
        "token": "{{ _.apiKey }}"
      },
      "metaSortKey": 5000,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "ws_tickerall_stream",
      "_type": "websocket_request",
      "parentId": "wrk_tickerall",
      "name": "Stream (ticks / positions / account)",
      "description": "Realtime data over a single long-lived WebSocket.\n\nConnect to `{{ _.wsBaseUrl }}/v1/stream` and authenticate with the same bearer token — either as an `Authorization: Bearer <key>` header on the upgrade, or `?token={{ _.apiKey }}` in the URL where headers are awkward (browser clients).\n\nAfter connecting, send a subscribe frame listing the channels you want:\n```json\n{\n  \"type\": \"subscribe\",\n  \"channels\": [\n    {\n      \"kind\": \"ticks\",\n      \"accountId\": \"{{ _.accountId }}\",\n      \"symbols\": [\n        \"BTCUSDm\",\n        \"ETHUSDm\"\n      ]\n    },\n    {\n      \"kind\": \"positions\",\n      \"accountId\": \"{{ _.accountId }}\"\n    },\n    {\n      \"kind\": \"account\",\n      \"accountId\": \"{{ _.accountId }}\"\n    }\n  ],\n  \"correlationId\": \"sub-1\"\n}\n```\n\nThe server streams `tick`, `position_update`, and `account_update` frames, plus a `subscribed` acknowledgement. Send `{ \"type\": \"ping\" }` to get a `pong` and keep the connection alive.",
      "url": "{{ _.wsBaseUrl }}/v1/stream?token={{ _.apiKey }}",
      "headers": [
        {
          "name": "Authorization",
          "value": "Bearer {{ _.apiKey }}"
        }
      ],
      "authentication": {},
      "parameters": [],
      "metaSortKey": 6000
    }
  ]
}