{
  "openapi": "3.1.0",
  "info": {
    "title": "Capital.com API (independent, unofficial description by Broker API Hub)",
    "version": "2026-10-12",
    "description": "An independent, unofficial description of the Capital.com API, built by Broker API Hub from Capital.com's public documentation. It is not Capital.com's own specification, and Broker API Hub is not affiliated with or endorsed by Capital.com.\n\nIt is generated from 36 endpoint records. Every operation carries x-source, the page it was read on, and x-checked, the date that page was last checked. No operation here is recorded as conflicting or unverified. An operation this file does not list is not recorded here, which is not evidence that it does not exist.\n\nSecurity schemes are only the authentication headers the endpoint records list. How a credential is obtained and how long it lasts is on https://openbrokerapi.com/brokers/capital-com.\n\nResponse schemas: 22 of the 36 operations carry a response block written by hand for an earlier file on this site, each schema with its own x-source. Those operations are marked x-carried.\n\n14 operations carry a mock reply as an example under the default response. Its values are invented.\n\nWhere this file and Capital.com's own documentation differ, the documentation wins. Educational only. Nothing here is advice.",
    "x-independent": true,
    "x-licence": "All rights reserved. Given for reference. Not part of the CC BY 4.0 downloads.",
    "x-cite": "Broker API Hub, Capital.com API OpenAPI description, openbrokerapi.com/specs/capital-com.json, newest check 2026-10-12",
    "x-generated": "2026-10-12",
    "x-generated-basis": "The newest checked date among the endpoint records in this file. It is not the date the file was built.",
    "x-page": "https://openbrokerapi.com/brokers/capital-com",
    "x-base-addresses": {
      "live": "https://api-capital.backend-capital.com/",
      "demo": "https://demo-api-capital.backend-capital.com/"
    },
    "x-base-addresses-note": "The base addresses exactly as the broker record words them. Only an entry that is a plain address is listed under servers."
  },
  "externalDocs": {
    "description": "Capital.com's own documentation",
    "url": "https://open-api.capital.com/"
  },
  "servers": [
    {
      "url": "https://demo-api-capital.backend-capital.com",
      "description": "Recorded on the Capital.com record as \"demo\"."
    },
    {
      "url": "https://api-capital.backend-capital.com",
      "description": "Recorded on the Capital.com record as \"live\"."
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Confirms"
    },
    {
      "name": "General"
    },
    {
      "name": "History"
    },
    {
      "name": "Markets"
    },
    {
      "name": "Positions"
    },
    {
      "name": "Session"
    },
    {
      "name": "Watchlists"
    },
    {
      "name": "Working orders"
    }
  ],
  "paths": {
    "/api/v1/accounts": {
      "get": {
        "operationId": "accounts",
        "summary": "List every financial account for the logged in client, with balance, deposit, profit and loss and available funds.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Switch the active account with PUT /api/v1/session. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsResponse"
                },
                "example": {
                  "accounts": [
                    {
                      "accountId": "MOCK-ACCOUNT-001",
                      "accountName": "Mock USD",
                      "status": "ENABLED",
                      "accountType": "CFD",
                      "preferred": true,
                      "balance": {
                        "balance": 1000,
                        "deposit": 1000,
                        "profitLoss": 0,
                        "available": 1000
                      },
                      "currency": "USD",
                      "symbol": "$"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/accounts"
      }
    },
    "/api/v1/accounts/preferences": {
      "get": {
        "operationId": "accounts-preferences",
        "summary": "Read the account's trading preferences: whether hedging mode is on, and the leverage in use and on offer for each asset class.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "hedgingMode": false,
                  "leverages": {
                    "CURRENCIES": {
                      "current": 10,
                      "available": [
                        1,
                        10,
                        20,
                        30
                      ]
                    },
                    "INDICES": {
                      "current": 10,
                      "available": [
                        1,
                        10,
                        20
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/accounts-preferences"
      },
      "put": {
        "operationId": "put-accounts-preferences",
        "summary": "Change the account's trading preferences: the leverage per asset class, the hedging mode, or both.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on a request with a body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "leverages": {
                    "type": "object",
                    "description": "New leverage values, keyed by asset class."
                  },
                  "hedgingMode": {
                    "type": "boolean",
                    "description": "True to switch hedging mode on, false to switch it off."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "status": "SUCCESS"
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/put-accounts-preferences"
      }
    },
    "/api/v1/accounts/topUp": {
      "post": {
        "operationId": "post-accounts-top-up",
        "summary": "Add to or take from the balance of the current demo account. Demo only: it moves no real money.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required. The reference caps a demo balance at 100000 and limits this call to 10 requests a second and 100 requests per account per day.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on a request with a body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Amount to add to the demo balance. Minimum -400000, maximum 400000, so a negative value reduces it."
                  }
                },
                "required": [
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "successful": true
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/post-accounts-top-up"
      }
    },
    "/api/v1/clientsentiment": {
      "get": {
        "operationId": "client-sentiment-list",
        "summary": "The share of clients holding long and short positions in each of a list of markets, as two percentages per market.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "marketIds",
            "in": "query",
            "required": false,
            "description": "Market identifiers, separated by commas.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "clientSentiments": [
                    {
                      "marketId": "MOCKMKT",
                      "longPositionPercentage": 62.5,
                      "shortPositionPercentage": 37.5
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/client-sentiment-list"
      }
    },
    "/api/v1/clientsentiment/{marketId}": {
      "get": {
        "operationId": "client-sentiment",
        "summary": "Share of Capital.com clients long and short on one market. GET /api/v1/clientsentiment?marketIds= takes a comma separated list.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "description": "Market identifier, the same value as the epic.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSentiment"
                },
                "example": {
                  "marketId": "SILVER",
                  "longPositionPercentage": 60,
                  "shortPositionPercentage": 40
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/client-sentiment"
      }
    },
    "/api/v1/confirms/{dealReference}": {
      "get": {
        "operationId": "confirms",
        "summary": "Check whether a deal was accepted or rejected. For a new position, the opened deal IDs are in affectedDeals.",
        "description": "Confirmed on the official reference. Always call this after opening or closing: a 200 on POST /api/v1/positions does not prove the position opened. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Confirms"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealReference",
            "in": "path",
            "required": true,
            "description": "dealReference from POST or DELETE on positions or working orders. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Confirm"
                },
                "example": {
                  "date": "2026-09-18T10:00:00.000",
                  "status": "OPEN",
                  "reason": "SUCCESS",
                  "dealStatus": "ACCEPTED",
                  "epic": "SILVER",
                  "dealReference": "o_MOCK-REF-0001",
                  "dealId": "MOCK-DEAL-0000",
                  "affectedDeals": [
                    {
                      "dealId": "MOCK-DEAL-0001",
                      "status": "OPENED"
                    }
                  ],
                  "level": 30.14,
                  "size": 1,
                  "direction": "BUY",
                  "guaranteedStop": false,
                  "trailingStop": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/confirms"
      }
    },
    "/api/v1/history/activity": {
      "get": {
        "operationId": "history-activity",
        "summary": "Account activity such as orders and positions, with optional detail and FIQL filtering. Default is the last 10 minutes.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. The date range between from and to can be at most 1 day. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "History"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start date. Format YYYY-MM-DDTHH:MM:SS, filtered on the UTC date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End date. Format YYYY-MM-DDTHH:MM:SS, filtered on the UTC date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lastPeriod",
            "in": "query",
            "required": false,
            "description": "Seconds back from now when no date range is given. Default 600, maximum 86400.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "detailed",
            "in": "query",
            "required": false,
            "description": "True for extra detail on each activity. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "dealId",
            "in": "query",
            "required": false,
            "description": "Only activity for this deal. Mock value shown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "FIQL filter on epic, source, status and type.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityResponse"
                },
                "example": {
                  "activities": [
                    {
                      "date": "2026-09-18T10:00:00.000",
                      "dateUTC": "2026-09-18T09:00:00.000",
                      "epic": "SILVER",
                      "dealId": "MOCK-DEAL-0001",
                      "source": "USER",
                      "type": "POSITION",
                      "status": "ACCEPTED"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/history-activity"
      }
    },
    "/api/v1/history/transactions": {
      "get": {
        "operationId": "history-transactions",
        "summary": "Money movements: trades, swaps, deposits, withdrawals and fees. Default is the last 10 minutes.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "History"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start date. Format YYYY-MM-DDTHH:MM:SS, filtered on the UTC date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End date. Format YYYY-MM-DDTHH:MM:SS, filtered on the UTC date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lastPeriod",
            "in": "query",
            "required": false,
            "description": "Seconds back from now when no date range is given. Default 600.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Transaction type, for example DEPOSIT, WITHDRAWAL, TRADE or SWAP.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                },
                "example": {
                  "transactions": [
                    {
                      "date": "2026-09-18T10:00:00.000",
                      "dateUtc": "2026-09-18T09:00:00.000",
                      "instrumentName": "Silver",
                      "transactionType": "TRADE",
                      "note": "Trade closed",
                      "reference": "MOCK-TX-0001",
                      "size": "1.05",
                      "currency": "USD"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/history-transactions"
      }
    },
    "/api/v1/marketnavigation": {
      "get": {
        "operationId": "marketnavigation",
        "summary": "The top level of the market navigation tree: one node per market category, each with an identifier to browse into.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "nodes": [
                    {
                      "id": "hierarchy_v1.mock_group",
                      "name": "mock_group"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/marketnavigation"
      }
    },
    "/api/v1/marketnavigation/{nodeId}": {
      "get": {
        "operationId": "marketnavigation-by-node",
        "summary": "The nodes and markets beneath one node of the market navigation tree. Walk it from the top level to reach the epics in a category.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "nodeId",
            "in": "path",
            "required": true,
            "description": "Identifier of the node to open, from GET /api/v1/marketnavigation.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Most markets to return. Default 500, maximum 500.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "nodes": [
                    {
                      "id": "hierarchy_v1.mock_group.most_traded",
                      "name": "Most Traded"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/marketnavigation-by-node"
      }
    },
    "/api/v1/markets": {
      "get": {
        "operationId": "markets",
        "summary": "Search markets by term or fetch up to 50 epics at once. With no query it returns every market.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "searchTerm",
            "in": "query",
            "required": false,
            "description": "Text to search for, such as Bitcoin or BTC. Takes priority over epics.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "epics",
            "in": "query",
            "required": false,
            "description": "Comma separated epics, at most 50.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketsResponse"
                },
                "example": {
                  "markets": [
                    {
                      "instrumentName": "Silver",
                      "expiry": "-",
                      "epic": "SILVER",
                      "instrumentType": "COMMODITIES",
                      "marketStatus": "TRADEABLE",
                      "lotSize": 1,
                      "high": 30.5,
                      "low": 29.8,
                      "percentageChange": 0.51,
                      "netChange": 0.15,
                      "bid": 30.12,
                      "offer": 30.14,
                      "updateTime": "2026-09-18T10:15:00.000",
                      "updateTimeUTC": "2026-09-18T09:15:00.000",
                      "delayTime": 0,
                      "streamingPricesAvailable": true,
                      "scalingFactor": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/markets"
      }
    },
    "/api/v1/markets/{epic}": {
      "get": {
        "operationId": "market",
        "summary": "Full details for one market: instrument, dealing rules, opening hours and a price snapshot.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Our mock trims the response, which also includes opening hours per weekday. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "epic",
            "in": "path",
            "required": true,
            "description": "Instrument epic.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDetails"
                },
                "example": {
                  "instrument": {
                    "epic": "SILVER",
                    "expiry": "-",
                    "name": "Silver",
                    "lotSize": 1,
                    "type": "COMMODITIES",
                    "controlledRiskAllowed": true,
                    "streamingPricesAvailable": true,
                    "currency": "USD",
                    "marginFactor": 10,
                    "marginFactorUnit": "PERCENTAGE"
                  },
                  "dealingRules": {
                    "minDealSize": {
                      "unit": "POINTS",
                      "value": 0.1
                    },
                    "minNormalStopOrLimitDistance": {
                      "unit": "PERCENTAGE",
                      "value": 0.01
                    },
                    "maxStopOrLimitDistance": {
                      "unit": "PERCENTAGE",
                      "value": 60
                    }
                  },
                  "snapshot": {
                    "marketStatus": "TRADEABLE",
                    "bid": 30.12,
                    "offer": 30.14,
                    "decimalPlacesFactor": 3,
                    "scalingFactor": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/market"
      }
    },
    "/api/v1/ping": {
      "get": {
        "operationId": "ping",
        "summary": "Ping the service to keep a trading session alive. Call it at least once every 10 minutes when idle.",
        "description": "Confirmed on the official reference, which says to ping at least once every 10 minutes to keep the session alive. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                },
                "example": {
                  "status": "OK"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/ping"
      }
    },
    "/api/v1/positions": {
      "get": {
        "operationId": "positions",
        "summary": "All open positions on the active account, each with position and market details.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositionsResponse"
                },
                "example": {
                  "positions": [
                    {
                      "position": {
                        "contractSize": 1,
                        "createdDate": "2026-09-18T10:00:00.000",
                        "createdDateUTC": "2026-09-18T09:00:00.000",
                        "dealId": "MOCK-DEAL-0001",
                        "dealReference": "p_MOCK-DEAL-0001",
                        "workingOrderId": "MOCK-ORDER-0001",
                        "size": 1,
                        "leverage": 10,
                        "upl": -0.05,
                        "direction": "BUY",
                        "level": 30.14,
                        "currency": "USD",
                        "guaranteedStop": false
                      },
                      "market": {
                        "instrumentName": "Silver",
                        "expiry": "-",
                        "epic": "SILVER",
                        "instrumentType": "COMMODITIES",
                        "marketStatus": "TRADEABLE",
                        "lotSize": 1,
                        "high": 30.5,
                        "low": 29.8,
                        "percentageChange": 0.51,
                        "netChange": 0.15,
                        "bid": 30.12,
                        "offer": 30.14,
                        "updateTime": "2026-09-18T10:15:00.000",
                        "updateTimeUTC": "2026-09-18T09:15:00.000",
                        "delayTime": 0,
                        "streamingPricesAvailable": true,
                        "scalingFactor": 1
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/positions"
      },
      "post": {
        "operationId": "post-positions",
        "summary": "Open a position at market. The response is only a dealReference: confirm the result with GET /api/v1/confirms/{dealReference}.",
        "description": "Confirmed on the official reference. An order is created first, so the dealReference has an o_ prefix. A 200 does not always mean the position opened. Limit: 1 request per 0.1 seconds for orders, and 1000 an hour on demo. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "direction": {
                    "type": "string",
                    "description": "BUY or SELL."
                  },
                  "epic": {
                    "type": "string",
                    "description": "Instrument epic, for example from GET /api/v1/markets."
                  },
                  "size": {
                    "type": "number",
                    "description": "Deal size."
                  },
                  "guaranteedStop": {
                    "type": "boolean",
                    "description": "True for a guaranteed stop. Then set stopLevel, stopDistance or stopAmount. Not allowed with trailingStop or in hedging mode."
                  },
                  "trailingStop": {
                    "type": "boolean",
                    "description": "True for a trailing stop. Then set stopDistance. Not allowed with guaranteedStop."
                  },
                  "stopLevel": {
                    "type": "number",
                    "description": "Price at which the stop loss triggers."
                  },
                  "stopDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the stop loss. Required when trailingStop is true."
                  },
                  "stopAmount": {
                    "type": "number",
                    "description": "Loss amount at which the stop loss triggers."
                  },
                  "profitLevel": {
                    "type": "number",
                    "description": "Price at which the take profit triggers."
                  },
                  "profitDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the take profit."
                  },
                  "profitAmount": {
                    "type": "number",
                    "description": "Profit amount at which the take profit triggers."
                  }
                },
                "required": [
                  "direction",
                  "epic",
                  "size"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "o_MOCK-REF-0001"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/post-positions"
      }
    },
    "/api/v1/positions/{dealId}": {
      "delete": {
        "operationId": "delete-position",
        "summary": "Close an open position by dealId. Confirm the close with GET /api/v1/confirms/{dealReference}.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "Deal ID of the position to close. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "p_MOCK-DEAL-0001"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/delete-position"
      },
      "get": {
        "operationId": "position",
        "summary": "One open position by its dealId.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "Permanent deal ID of the position, from GET /api/v1/positions or the affectedDeals in a confirm. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PositionWithMarket"
                },
                "example": {
                  "position": {
                    "contractSize": 1,
                    "createdDate": "2026-09-18T10:00:00.000",
                    "createdDateUTC": "2026-09-18T09:00:00.000",
                    "dealId": "MOCK-DEAL-0001",
                    "dealReference": "p_MOCK-DEAL-0001",
                    "size": 1,
                    "leverage": 10,
                    "upl": -0.05,
                    "direction": "BUY",
                    "level": 30.14,
                    "currency": "USD",
                    "guaranteedStop": false
                  },
                  "market": {
                    "instrumentName": "Silver",
                    "expiry": "-",
                    "epic": "SILVER",
                    "instrumentType": "COMMODITIES",
                    "marketStatus": "TRADEABLE",
                    "lotSize": 1,
                    "high": 30.5,
                    "low": 29.8,
                    "percentageChange": 0.51,
                    "netChange": 0.15,
                    "bid": 30.12,
                    "offer": 30.14,
                    "updateTime": "2026-09-18T10:15:00.000",
                    "updateTimeUTC": "2026-09-18T09:15:00.000",
                    "delayTime": 0,
                    "streamingPricesAvailable": true,
                    "scalingFactor": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/position"
      },
      "put": {
        "operationId": "put-position",
        "summary": "Amend an open position: move or add its stop loss and take profit, or switch to a guaranteed or trailing stop. Confirm with GET /api/v1/confirms/{dealReference}.",
        "description": "Listed as Update position in Capital.com's official Postman collection (opened on the date shown), with its body parameters and examples. The reference at open-api.capital.com documents this call too, with the same body fields, each marked as not required. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Positions"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "Permanent deal ID of the position to amend. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "guaranteedStop": {
                    "type": "boolean",
                    "description": "True for a guaranteed stop. Then set stopLevel, stopDistance or stopAmount. Not allowed with trailingStop or in hedging mode."
                  },
                  "trailingStop": {
                    "type": "boolean",
                    "description": "True for a trailing stop. Then set stopDistance. Not allowed with guaranteedStop."
                  },
                  "stopLevel": {
                    "type": "number",
                    "description": "Price at which the stop loss triggers."
                  },
                  "stopDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the stop loss. Required when trailingStop is true."
                  },
                  "stopAmount": {
                    "type": "number",
                    "description": "Loss amount at which the stop loss triggers."
                  },
                  "profitLevel": {
                    "type": "number",
                    "description": "Price at which the take profit triggers."
                  },
                  "profitDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the take profit."
                  },
                  "profitAmount": {
                    "type": "number",
                    "description": "Profit amount at which the take profit triggers."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "p_MOCK-DEAL-0001"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/put-position"
      }
    },
    "/api/v1/prices/{epic}": {
      "get": {
        "operationId": "prices",
        "summary": "Historical bid and ask candles for one epic. By default, minute prices for the last 10 minutes.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. The max parameter defaults to 10 and is capped at 1000. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Markets"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "epic",
            "in": "path",
            "required": true,
            "description": "Instrument epic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "required": false,
            "description": "MINUTE, MINUTE_5, MINUTE_15, MINUTE_30, HOUR, HOUR_4, DAY or WEEK.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max",
            "in": "query",
            "required": false,
            "description": "Number of candles. Default 10, maximum 1000.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start date, format YYYY-MM-DDTHH:MM:SS, filtered on snapshotTimeUTC.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End date, format YYYY-MM-DDTHH:MM:SS, filtered on snapshotTimeUTC.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricesResponse"
                },
                "example": {
                  "prices": [
                    {
                      "snapshotTime": "2026-09-18T10:00:00",
                      "snapshotTimeUTC": "2026-09-18T09:00:00",
                      "openPrice": {
                        "bid": 30.1,
                        "ask": 30.12
                      },
                      "closePrice": {
                        "bid": 30.12,
                        "ask": 30.14
                      },
                      "highPrice": {
                        "bid": 30.2,
                        "ask": 30.22
                      },
                      "lowPrice": {
                        "bid": 30.05,
                        "ask": 30.07
                      },
                      "lastTradedVolume": 123
                    }
                  ],
                  "instrumentType": "COMMODITIES"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/prices"
      }
    },
    "/api/v1/session": {
      "delete": {
        "operationId": "delete-session",
        "summary": "Log out of the current session. The CST and X-SECURITY-TOKEN tokens stop working.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                },
                "example": {
                  "status": "SUCCESS"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/delete-session"
      },
      "get": {
        "operationId": "session",
        "summary": "Read the current session: client ID, active account, locale, currency and the streaming endpoint.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetails"
                },
                "example": {
                  "clientId": "MOCK-CLIENT-01",
                  "accountId": "MOCK-ACCOUNT-001",
                  "timezoneOffset": 1,
                  "locale": "en",
                  "currency": "USD",
                  "streamEndpoint": "wss://api-streaming-capital.backend-capital.com/"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/session"
      },
      "post": {
        "operationId": "post-session",
        "summary": "Log in with your API key, login identifier and API key password. The CST and X-SECURITY-TOKEN tokens come back in the response headers.",
        "description": "Confirmed on the official reference. Limited to 1 request per second per API key. Tokens stay valid for 10 minutes after last use. You need 2FA switched on before you can generate an API key. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "type": "string",
                    "description": "Your Capital.com login identifier. Placeholder only: never enter it on this site."
                  },
                  "password": {
                    "type": "string",
                    "description": "The custom password you set for the API key. Placeholder only: never enter it on this site."
                  },
                  "encryptedPassword": {
                    "type": "boolean",
                    "description": "True only if you encrypted the password with the key from GET /api/v1/session/encryptionKey. Default false."
                  }
                },
                "required": [
                  "identifier",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionCreated"
                },
                "example": {
                  "accountType": "CFD",
                  "accountInfo": {
                    "balance": 1000,
                    "deposit": 1000,
                    "profitLoss": 0,
                    "available": 1000
                  },
                  "currencyIsoCode": "USD",
                  "currencySymbol": "$",
                  "currentAccountId": "MOCK-ACCOUNT-001",
                  "streamingHost": "wss://api-streaming-capital.backend-capital.com/",
                  "accounts": [
                    {
                      "accountId": "MOCK-ACCOUNT-001",
                      "accountName": "Mock USD",
                      "preferred": true,
                      "accountType": "CFD"
                    }
                  ],
                  "clientId": "MOCK-CLIENT-01",
                  "timezoneOffset": 1,
                  "hasActiveDemoAccounts": true,
                  "hasActiveLiveAccounts": false,
                  "trailingStopsEnabled": false
                }
              }
            },
            "headers": {
              "CST": {
                "description": "Access token. Send it on every later request.",
                "schema": {
                  "type": "string"
                }
              },
              "X-SECURITY-TOKEN": {
                "description": "Account token. Send it on every later request.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {
            "X-CAP-API-KEY": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/post-session"
      },
      "put": {
        "operationId": "put-session",
        "summary": "Switch the session to another of your financial accounts. Later calls then act on that account.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on a request with a body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "description": "Identifier of the account to switch to, from GET /api/v1/accounts."
                  }
                },
                "required": [
                  "accountId"
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "trailingStopsEnabled": false,
                  "dealingEnabled": true,
                  "hasActiveDemoAccounts": true,
                  "hasActiveLiveAccounts": false
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/put-session"
      }
    },
    "/api/v1/session/encryptionKey": {
      "get": {
        "operationId": "session-encryption-key",
        "summary": "Fetch the key and timestamp used to send the API key password in encrypted form when starting a session. Only the encrypted login route needs it.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, the header and the example response. The reference does not flag the header as required. Its authentication section says the API key goes in X-CAP-API-KEY, which is why it is recorded as required.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "encryptionKey": "MOCK-BASE64-KEY",
                  "timeStamp": 1789718400000
                }
              }
            }
          }
        },
        "security": [
          {
            "X-CAP-API-KEY": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/session-encryption-key"
      }
    },
    "/api/v1/time": {
      "get": {
        "operationId": "time",
        "summary": "The server's current time as a millisecond timestamp. The reference says no authentication is needed, so it doubles as a connectivity test.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path and the example response. The reference states that this call needs no authentication.",
        "tags": [
          "General"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "serverTime": 1789718400000
                }
              }
            }
          }
        },
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/time"
      }
    },
    "/api/v1/watchlists": {
      "get": {
        "operationId": "watchlists",
        "summary": "Every watchlist on your account. Open one with GET /api/v1/watchlists/{watchlistId}.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistsResponse"
                },
                "example": {
                  "watchlists": [
                    {
                      "id": "MOCK-WL-001",
                      "name": "Mock list",
                      "editable": true,
                      "deleteable": true,
                      "defaultSystemWatchlist": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/watchlists"
      },
      "post": {
        "operationId": "post-watchlists",
        "summary": "Create a watchlist with a name and, if you wish, a first set of markets.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on a request with a body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the watchlist, 1 to 20 characters."
                  },
                  "epics": {
                    "type": "array",
                    "description": "Epics of the markets to put in the new watchlist."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "watchlistId": "MOCK-WL-002",
                  "status": "SUCCESS"
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/post-watchlists"
      }
    },
    "/api/v1/watchlists/{watchlistId}": {
      "delete": {
        "operationId": "delete-watchlist-by-id",
        "summary": "Delete a watchlist. The list itself is removed, not the markets or any position in them.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "watchlistId",
            "in": "path",
            "required": true,
            "description": "Watchlist identifier, from GET /api/v1/watchlists.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "status": "SUCCESS"
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/delete-watchlist-by-id"
      },
      "get": {
        "operationId": "watchlist-by-id",
        "summary": "The markets in one watchlist, each with its epic, name, status and current bid and offer.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "watchlistId",
            "in": "path",
            "required": true,
            "description": "Watchlist identifier, from GET /api/v1/watchlists.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "markets": [
                    {
                      "epic": "MOCKMKT",
                      "instrumentName": "Mock market",
                      "symbol": "Mock",
                      "instrumentType": "COMMODITIES",
                      "marketStatus": "TRADEABLE",
                      "expiry": "-",
                      "lotSize": 1,
                      "bid": 22.041,
                      "offer": 22.061,
                      "high": 22.098,
                      "low": 21.926,
                      "netChange": -0.627,
                      "percentageChange": -0.27,
                      "updateTime": "2026-09-18T08:00:00.000",
                      "updateTimeUTC": "2026-09-18T08:00:00.000",
                      "delayTime": 0,
                      "streamingPricesAvailable": true,
                      "scalingFactor": 1
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/watchlist-by-id"
      },
      "put": {
        "operationId": "put-watchlist-by-id",
        "summary": "Add one market to an existing watchlist, by its epic.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "description": "Send application/json on a request with a body.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "watchlistId",
            "in": "path",
            "required": true,
            "description": "Watchlist identifier, from GET /api/v1/watchlists.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "epic": {
                    "type": "string",
                    "description": "Epic of the market to add."
                  }
                },
                "required": [
                  "epic"
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "status": "SUCCESS"
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/put-watchlist-by-id"
      }
    },
    "/api/v1/watchlists/{watchlistId}/{epic}": {
      "delete": {
        "operationId": "delete-watchlist-epic",
        "summary": "Take one market out of a watchlist. The watchlist and its other markets stay as they are.",
        "description": "Read on Capital.com's own reference at open-api.capital.com on 12 Oct 2026: method, path, parameters and the example response. The reference does not flag the two session headers as required on each call. Its introduction says they should be passed on every request after login, which is why they are recorded as required.",
        "tags": [
          "Watchlists"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "watchlistId",
            "in": "path",
            "required": true,
            "description": "Watchlist identifier, from GET /api/v1/watchlists.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "epic",
            "in": "path",
            "required": true,
            "description": "Epic of the market to remove.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "A mock reply held on this site's record. The values are invented and the record holds no status code for it.",
            "content": {
              "application/json": {
                "example": {
                  "_mock": true,
                  "status": "SUCCESS"
                }
              }
            }
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/delete-watchlist-epic"
      }
    },
    "/api/v1/workingorders": {
      "get": {
        "operationId": "working-orders",
        "summary": "All open limit and stop orders on the active account.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Working orders"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkingOrdersResponse"
                },
                "example": {
                  "workingOrders": [
                    {
                      "workingOrderData": {
                        "dealId": "MOCK-ORDER-0002",
                        "direction": "BUY",
                        "epic": "SILVER",
                        "orderSize": 1,
                        "orderLevel": 20,
                        "timeInForce": "GOOD_TILL_DATE",
                        "goodTillDate": "2026-12-31T22:00:00.000",
                        "goodTillDateUTC": "2026-12-31T21:00:00.000",
                        "createdDate": "2026-09-18T10:00:00.000",
                        "createdDateUTC": "2026-09-18T09:00:00.000",
                        "guaranteedStop": false,
                        "orderType": "LIMIT",
                        "currencyCode": "USD"
                      },
                      "marketData": {
                        "instrumentName": "Silver",
                        "expiry": "-",
                        "epic": "SILVER",
                        "instrumentType": "COMMODITIES",
                        "marketStatus": "TRADEABLE",
                        "lotSize": 1,
                        "high": 30.5,
                        "low": 29.8,
                        "percentageChange": 0.51,
                        "netChange": 0.15,
                        "bid": 30.12,
                        "offer": 30.14,
                        "updateTime": "2026-09-18T10:15:00.000",
                        "updateTimeUTC": "2026-09-18T09:15:00.000",
                        "delayTime": 0,
                        "streamingPricesAvailable": true,
                        "scalingFactor": 1
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/working-orders"
      },
      "post": {
        "operationId": "post-working-orders",
        "summary": "Create a LIMIT or STOP order at a price level, optionally with a cancellation date, stop loss and take profit.",
        "description": "Confirmed on the official reference. Limit: 1 request per 0.1 seconds for orders, and 1000 an hour on demo. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Working orders"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "direction": {
                    "type": "string",
                    "description": "BUY or SELL."
                  },
                  "epic": {
                    "type": "string",
                    "description": "Instrument epic, for example from GET /api/v1/markets."
                  },
                  "size": {
                    "type": "number",
                    "description": "Deal size."
                  },
                  "level": {
                    "type": "number",
                    "description": "Order price."
                  },
                  "type": {
                    "type": "string",
                    "description": "LIMIT or STOP."
                  },
                  "goodTillDate": {
                    "type": "string",
                    "description": "Cancellation date in UTC, format YYYY-MM-DDTHH:MM:SS. Leave out for good till cancelled."
                  },
                  "guaranteedStop": {
                    "type": "boolean",
                    "description": "True for a guaranteed stop. Then set stopLevel, stopDistance or stopAmount. Not allowed with trailingStop or in hedging mode."
                  },
                  "trailingStop": {
                    "type": "boolean",
                    "description": "True for a trailing stop. Then set stopDistance. Not allowed with guaranteedStop."
                  },
                  "stopLevel": {
                    "type": "number",
                    "description": "Price at which the stop loss triggers."
                  },
                  "stopDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the stop loss. Required when trailingStop is true."
                  },
                  "stopAmount": {
                    "type": "number",
                    "description": "Loss amount at which the stop loss triggers."
                  },
                  "profitLevel": {
                    "type": "number",
                    "description": "Price at which the take profit triggers."
                  },
                  "profitDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the take profit."
                  },
                  "profitAmount": {
                    "type": "number",
                    "description": "Profit amount at which the take profit triggers."
                  }
                },
                "required": [
                  "direction",
                  "epic",
                  "size",
                  "level",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "o_MOCK-REF-0002"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/post-working-orders"
      }
    },
    "/api/v1/workingorders/{dealId}": {
      "delete": {
        "operationId": "delete-working-order",
        "summary": "Cancel an open limit or stop order by its dealId.",
        "description": "Listed on the official reference at open-api.capital.com (opened on the date shown). Parameters and example fields from Capital.com's official Postman collection. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Working orders"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "Deal ID of the working order. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "o_MOCK-REF-0003"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/delete-working-order"
      },
      "put": {
        "operationId": "put-working-order",
        "summary": "Amend a LIMIT or STOP working order: its price level, cancellation date, stop loss or take profit.",
        "description": "Listed as Update working order in Capital.com's official Postman collection (opened on the date shown), with its body parameters and examples. The reference at open-api.capital.com documents this call too, with the same body fields, each marked as not required. Method, path and request parameters were re-read on open-api.capital.com on 12 Oct 2026 and agree with this record; the mock reply was not compared field by field.",
        "tags": [
          "Working orders"
        ],
        "externalDocs": {
          "description": "Capital.com's own reference for this operation",
          "url": "https://open-api.capital.com/"
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "description": "Permanent deal ID of the working order to amend. Mock value shown.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "level": {
                    "type": "number",
                    "description": "Order price."
                  },
                  "goodTillDate": {
                    "type": "string",
                    "description": "Cancellation date in UTC, format YYYY-MM-DDTHH:MM:SS. Leave out for good till cancelled."
                  },
                  "guaranteedStop": {
                    "type": "boolean",
                    "description": "True for a guaranteed stop. Then set stopLevel, stopDistance or stopAmount. Not allowed with trailingStop or in hedging mode."
                  },
                  "trailingStop": {
                    "type": "boolean",
                    "description": "True for a trailing stop. Then set stopDistance. Not allowed with guaranteedStop."
                  },
                  "stopLevel": {
                    "type": "number",
                    "description": "Price at which the stop loss triggers."
                  },
                  "stopDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the stop loss. Required when trailingStop is true."
                  },
                  "stopAmount": {
                    "type": "number",
                    "description": "Loss amount at which the stop loss triggers."
                  },
                  "profitLevel": {
                    "type": "number",
                    "description": "Price at which the take profit triggers."
                  },
                  "profitDistance": {
                    "type": "number",
                    "description": "Distance from the current price to the take profit."
                  },
                  "profitAmount": {
                    "type": "number",
                    "description": "Profit amount at which the take profit triggers."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealReference"
                },
                "example": {
                  "dealReference": "o_MOCK-REF-0002"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedGlobal"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequestsGlobal"
          }
        },
        "security": [
          {
            "CST": [],
            "X-SECURITY-TOKEN": []
          }
        ],
        "x-source": "https://open-api.capital.com/",
        "x-checked": "2026-10-12",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/capital-com/endpoints/put-working-order"
      }
    }
  },
  "components": {
    "schemas": {
      "AccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "preferred": {
            "type": "boolean"
          },
          "balance": {
            "$ref": "#/components/schemas/AccountBalance"
          },
          "currency": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        }
      },
      "AccountBalance": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "number"
          },
          "deposit": {
            "type": "number"
          },
          "profitLoss": {
            "type": "number"
          },
          "available": {
            "type": "number"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error body. Capital.com's official Postman collection shows every error as a JSON object with one errorCode string.",
        "properties": {
          "errorCode": {
            "type": "string",
            "examples": [
              "error.not-found.epic"
            ]
          }
        },
        "required": [
          "errorCode"
        ],
        "x-verified": true,
        "x-source": "https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json"
      },
      "ClientSentiment": {
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string"
          },
          "longPositionPercentage": {
            "type": "number"
          },
          "shortPositionPercentage": {
            "type": "number"
          }
        }
      },
      "Confirm": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "dealStatus": {
            "type": "string"
          },
          "epic": {
            "type": "string"
          },
          "dealReference": {
            "type": "string"
          },
          "dealId": {
            "type": "string"
          },
          "affectedDeals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dealId": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          },
          "level": {
            "type": "number"
          },
          "size": {
            "type": "number"
          },
          "direction": {
            "type": "string"
          },
          "guaranteedStop": {
            "type": "boolean"
          },
          "trailingStop": {
            "type": "boolean"
          }
        }
      },
      "ActivityResponse": {
        "type": "object",
        "properties": {
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Activity"
            }
          }
        }
      },
      "Activity": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "dateUTC": {
            "type": "string"
          },
          "epic": {
            "type": "string"
          },
          "dealId": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "TransactionsResponse": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            }
          }
        }
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "dateUtc": {
            "type": "string"
          },
          "instrumentName": {
            "type": "string"
          },
          "transactionType": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "size": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "MarketsResponse": {
        "type": "object",
        "properties": {
          "markets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketSnapshot"
            }
          }
        }
      },
      "MarketSnapshot": {
        "type": "object",
        "properties": {
          "instrumentName": {
            "type": "string"
          },
          "expiry": {
            "type": "string"
          },
          "epic": {
            "type": "string"
          },
          "instrumentType": {
            "type": "string"
          },
          "marketStatus": {
            "type": "string"
          },
          "lotSize": {
            "type": "number"
          },
          "high": {
            "type": "number"
          },
          "low": {
            "type": "number"
          },
          "percentageChange": {
            "type": "number"
          },
          "netChange": {
            "type": "number"
          },
          "bid": {
            "type": "number"
          },
          "offer": {
            "type": "number"
          },
          "updateTime": {
            "type": "string"
          },
          "updateTimeUTC": {
            "type": "string"
          },
          "delayTime": {
            "type": "number"
          },
          "streamingPricesAvailable": {
            "type": "boolean"
          },
          "scalingFactor": {
            "type": "number"
          }
        }
      },
      "MarketDetails": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "object",
            "properties": {
              "epic": {
                "type": "string"
              },
              "expiry": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "lotSize": {
                "type": "number"
              },
              "type": {
                "type": "string"
              },
              "controlledRiskAllowed": {
                "type": "boolean"
              },
              "streamingPricesAvailable": {
                "type": "boolean"
              },
              "currency": {
                "type": "string"
              },
              "marginFactor": {
                "type": "number"
              },
              "marginFactorUnit": {
                "type": "string"
              }
            }
          },
          "dealingRules": {
            "type": "object",
            "properties": {
              "minDealSize": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  }
                }
              },
              "minNormalStopOrLimitDistance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  }
                }
              },
              "maxStopOrLimitDistance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "snapshot": {
            "type": "object",
            "properties": {
              "marketStatus": {
                "type": "string"
              },
              "bid": {
                "type": "number"
              },
              "offer": {
                "type": "number"
              },
              "decimalPlacesFactor": {
                "type": "number"
              },
              "scalingFactor": {
                "type": "number"
              }
            }
          }
        }
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "examples": [
              "SUCCESS",
              "OK"
            ]
          }
        }
      },
      "PositionsResponse": {
        "type": "object",
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PositionWithMarket"
            }
          }
        }
      },
      "PositionWithMarket": {
        "type": "object",
        "properties": {
          "position": {
            "$ref": "#/components/schemas/Position"
          },
          "market": {
            "$ref": "#/components/schemas/MarketSnapshot"
          }
        }
      },
      "Position": {
        "type": "object",
        "properties": {
          "contractSize": {
            "type": "number"
          },
          "createdDate": {
            "type": "string"
          },
          "createdDateUTC": {
            "type": "string"
          },
          "dealId": {
            "type": "string"
          },
          "dealReference": {
            "type": "string"
          },
          "size": {
            "type": "number"
          },
          "leverage": {
            "type": "number"
          },
          "upl": {
            "type": "number"
          },
          "direction": {
            "type": "string"
          },
          "level": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "guaranteedStop": {
            "type": "boolean"
          }
        }
      },
      "DealReference": {
        "type": "object",
        "description": "Reference to confirm with GET /api/v1/confirms/{dealReference}.",
        "properties": {
          "dealReference": {
            "type": "string"
          }
        },
        "required": [
          "dealReference"
        ]
      },
      "PricesResponse": {
        "type": "object",
        "properties": {
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Candle"
            }
          },
          "instrumentType": {
            "type": "string"
          }
        }
      },
      "Candle": {
        "type": "object",
        "properties": {
          "snapshotTime": {
            "type": "string"
          },
          "snapshotTimeUTC": {
            "type": "string"
          },
          "openPrice": {
            "$ref": "#/components/schemas/BidAsk"
          },
          "closePrice": {
            "$ref": "#/components/schemas/BidAsk"
          },
          "highPrice": {
            "$ref": "#/components/schemas/BidAsk"
          },
          "lowPrice": {
            "$ref": "#/components/schemas/BidAsk"
          },
          "lastTradedVolume": {
            "type": "number"
          }
        }
      },
      "BidAsk": {
        "type": "object",
        "properties": {
          "bid": {
            "type": "number"
          },
          "ask": {
            "type": "number"
          }
        }
      },
      "SessionDetails": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "timezoneOffset": {
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "streamEndpoint": {
            "type": "string"
          }
        }
      },
      "SessionCreated": {
        "type": "object",
        "properties": {
          "accountType": {
            "type": "string"
          },
          "accountInfo": {
            "$ref": "#/components/schemas/AccountBalance"
          },
          "currencyIsoCode": {
            "type": "string"
          },
          "currencySymbol": {
            "type": "string"
          },
          "currentAccountId": {
            "type": "string"
          },
          "streamingHost": {
            "type": "string"
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "type": "string"
                },
                "accountName": {
                  "type": "string"
                },
                "preferred": {
                  "type": "boolean"
                },
                "accountType": {
                  "type": "string"
                }
              }
            }
          },
          "clientId": {
            "type": "string"
          },
          "timezoneOffset": {
            "type": "integer"
          },
          "hasActiveDemoAccounts": {
            "type": "boolean"
          },
          "hasActiveLiveAccounts": {
            "type": "boolean"
          },
          "trailingStopsEnabled": {
            "type": "boolean"
          }
        }
      },
      "WatchlistsResponse": {
        "type": "object",
        "properties": {
          "watchlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Watchlist"
            }
          }
        }
      },
      "Watchlist": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "editable": {
            "type": "boolean"
          },
          "deleteable": {
            "type": "boolean"
          },
          "defaultSystemWatchlist": {
            "type": "boolean"
          }
        }
      },
      "WorkingOrdersResponse": {
        "type": "object",
        "properties": {
          "workingOrders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "workingOrderData": {
                  "$ref": "#/components/schemas/WorkingOrderData"
                },
                "marketData": {
                  "$ref": "#/components/schemas/MarketSnapshot"
                }
              }
            }
          }
        }
      },
      "WorkingOrderData": {
        "type": "object",
        "properties": {
          "dealId": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "epic": {
            "type": "string"
          },
          "orderSize": {
            "type": "number"
          },
          "orderLevel": {
            "type": "number"
          },
          "timeInForce": {
            "type": "string"
          },
          "goodTillDate": {
            "type": "string"
          },
          "goodTillDateUTC": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "createdDateUTC": {
            "type": "string"
          },
          "guaranteedStop": {
            "type": "boolean"
          },
          "orderType": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "UnauthorizedGlobal": {
        "description": "Session tokens missing, wrong or expired. Every call except POST /session needs CST and X-SECURITY-TOKEN, and a session ends after 10 minutes without a request. This endpoint's own docs do not show a 401 example, so the status code is inferred from the global rule.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://open-api.capital.com/"
      },
      "TooManyRequestsGlobal": {
        "description": "Over the request limit. The docs apply 10 requests a second per user to every REST call, and 1 request per 0.1 seconds to opening positions and creating orders. This endpoint's own docs do not show a 429 example. Example errorCode from POST /session: error.too-many.requests.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": false,
        "x-source": "https://open-api.capital.com/"
      },
      "NotFound": {
        "description": "The deal, epic, watchlist or reference does not exist. Example errorCode: error.not-found.dealId.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json"
      },
      "BadRequest": {
        "description": "Bad request. The body carries an errorCode such as error.invalid.resolution.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json"
      },
      "Unauthorized": {
        "description": "Credentials or session tokens are missing, wrong or expired. Example errorCode: error.invalid.details.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json"
      },
      "TooManyRequests": {
        "description": "Over the request limit. Example errorCode: error.too-many.requests. Limits: 10 requests a second per user, 1 a second per API key on POST /session.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        },
        "x-verified": true,
        "x-source": "https://github.com/capital-com-sv/capital-api-postman/blob/main/capital.collection.json"
      }
    },
    "securitySchemes": {
      "CST": {
        "type": "apiKey",
        "in": "header",
        "name": "CST",
        "description": "A header the Capital.com endpoint records list on requests. Read its value from your own environment. Never paste it into a web page or a chat."
      },
      "X-SECURITY-TOKEN": {
        "type": "apiKey",
        "in": "header",
        "name": "X-SECURITY-TOKEN",
        "description": "A header the Capital.com endpoint records list on requests. Read its value from your own environment. Never paste it into a web page or a chat."
      },
      "X-CAP-API-KEY": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CAP-API-KEY",
        "description": "A header the Capital.com endpoint records list on requests. Read its value from your own environment. Never paste it into a web page or a chat."
      }
    }
  }
}