{
  "openapi": "3.1.0",
  "info": {
    "title": "Interactive Brokers API (independent, unofficial description by Broker API Hub)",
    "version": "2026-09-18",
    "description": "An independent, unofficial description of the Interactive Brokers API, built by Broker API Hub from Interactive Brokers's public documentation. It is not Interactive Brokers's own specification, and Broker API Hub is not affiliated with or endorsed by Interactive Brokers.\n\nIt is generated from 23 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/ibkr.\n\nResponse schemas: 23 of the 23 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\nWhere this file and Interactive Brokers'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, Interactive Brokers API OpenAPI description, openbrokerapi.com/specs/ibkr.json, newest check 2026-09-18",
    "x-generated": "2026-09-18",
    "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/ibkr",
    "x-base-addresses": {
      "live": "https://localhost:5000/v1/api (Client Portal Gateway)",
      "oauth": "https://api.ibkr.com/v1/api"
    },
    "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": "Interactive Brokers's own documentation",
    "url": "https://www.interactivebrokers.com/docs/tws-api/doc/introduction"
  },
  "servers": [
    {
      "url": "https://api.ibkr.com/v1/api",
      "description": "Recorded on the Interactive Brokers record as \"oauth\"."
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Contracts"
    },
    {
      "name": "Market data"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Session"
    },
    {
      "name": "Trades"
    }
  ],
  "paths": {
    "/iserver/account/{accountId}/order/{orderId}": {
      "delete": {
        "operationId": "cancel-order",
        "summary": "Cancels an existing order that has not filled.",
        "description": "Request was submitted means IBKR received the cancel, not that the order is cancelled. Check the live orders list.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/cancel-open-order"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "The IB assigned order ID of the order.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "manualIndicator",
            "in": "query",
            "required": false,
            "description": "For US futures orders: whether the order was placed by a person or automatically.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelResponse"
                },
                "example": {
                  "msg": "Request was submitted",
                  "order_id": 100000001,
                  "conid": "-1",
                  "account": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/cancel-open-order",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/cancel-order"
      },
      "post": {
        "operationId": "modify-order",
        "summary": "Changes an existing order that has not filled. Send the whole ticket with the new values.",
        "description": "IBKR's reference uses POST, not PUT, for this call. The reply can be a question to confirm, as with a new order.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/modify-open-order"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "The IB order ID, from the order response or the live orders list.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conid": {
                    "type": "integer",
                    "description": "IB contract ID."
                  },
                  "orderType": {
                    "type": "string",
                    "description": "IB order type identifier."
                  },
                  "side": {
                    "type": "string",
                    "description": "BUY or SELL."
                  },
                  "tif": {
                    "type": "string",
                    "description": "Time in force."
                  },
                  "quantity": {
                    "type": "number",
                    "description": "Order quantity."
                  },
                  "price": {
                    "type": "number",
                    "description": "Order price."
                  },
                  "auxPrice": {
                    "type": "number",
                    "description": "Second price, used by some order types."
                  },
                  "manualIndicator": {
                    "type": "boolean",
                    "description": "Required for US futures orders."
                  }
                },
                "required": [
                  "conid",
                  "orderType",
                  "side",
                  "tif",
                  "quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                },
                "example": [
                  {
                    "order_id": "MOCK-ORDER-0001",
                    "order_status": "PreSubmitted",
                    "encrypt_message": "1"
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/modify-open-order",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/modify-order"
      }
    },
    "/iserver/account/{accountId}/orders": {
      "post": {
        "operationId": "place-order",
        "summary": "Submits an order ticket, a bracket or an OCA group. The reply is either the order ID or a question you must confirm with POST /iserver/reply/{replyId}.",
        "description": "The 200 body is one of four shapes: a list with order_id, order_status and encrypt_message; a list of reply messages with id, message, isSuppressed and messageIds; an object with error; or an advanced order reject. The order ticket fields are listed on IBKR's Modify Open Order reference page and used in IBKR's Placing Orders lesson; the Submit New Order page itself shows the orders array without expanding it.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/submit-new-order"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "orders": {
                    "type": "array",
                    "description": "Array of order ticket objects. IBKR: only one order ticket may be submitted per request, unless constructing a bracket."
                  },
                  "orders[].conid": {
                    "type": "integer",
                    "description": "IB contract ID of the instrument. Find it with GET /iserver/secdef/search."
                  },
                  "orders[].orderType": {
                    "type": "string",
                    "description": "IB order type identifier. IBKR's Placing Orders lesson uses STP in its example."
                  },
                  "orders[].side": {
                    "type": "string",
                    "description": "BUY or SELL."
                  },
                  "orders[].tif": {
                    "type": "string",
                    "description": "Time in force, such as DAY."
                  },
                  "orders[].quantity": {
                    "type": "number",
                    "description": "Order quantity."
                  },
                  "orders[].price": {
                    "type": "number",
                    "description": "Order price. For the STP example it is the stop price."
                  },
                  "orders[].cOID": {
                    "type": "string",
                    "description": "Your own client order ID, 64 characters at most."
                  }
                },
                "required": [
                  "orders[].conid",
                  "orders[].orderType",
                  "orders[].side",
                  "orders[].tif",
                  "orders[].quantity"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                },
                "example": [
                  {
                    "order_id": "MOCK-ORDER-0001",
                    "order_status": "Submitted",
                    "encrypt_message": "1"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/submit-new-order",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/place-order"
      }
    },
    "/iserver/account/{accountId}/orders/whatif": {
      "post": {
        "operationId": "order-whatif",
        "summary": "Projects the effect of an order before you send it: cost, change to equity, initial and maintenance margin, and position.",
        "description": "Nothing is sent to the market. IBKR lists amount, equity, initial, maintenance and position as objects; the keys inside them in our mock are invented, so check them against a real preview.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/preview-margin-impact"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "orders": {
                    "type": "array",
                    "description": "Array of order ticket objects. IBKR: only one order ticket may be submitted per request, unless constructing a bracket."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatIfResponse"
                },
                "example": {
                  "amount": {
                    "amount": "1,850.00 USD",
                    "commission": "1.00 USD",
                    "total": "1,851.00 USD"
                  },
                  "equity": {
                    "current": "10,000",
                    "change": "-1",
                    "after": "9,999"
                  },
                  "initial": {
                    "current": "2,000",
                    "change": "0",
                    "after": "2,000"
                  },
                  "maintenance": {
                    "current": "1,500",
                    "change": "0",
                    "after": "1,500"
                  },
                  "position": {
                    "current": "10",
                    "change": "-10",
                    "after": "0"
                  },
                  "warn": null,
                  "error": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/preview-margin-impact",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/order-whatif"
      }
    },
    "/iserver/account/order/status/{orderId}": {
      "get": {
        "operationId": "order-status",
        "summary": "Status of one order from the current brokerage session: side, type, size, filled amount and account.",
        "description": "Only orders from the current brokerage session.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-order-status"
        },
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "Order identifier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderStatus"
                },
                "example": {
                  "order_id": 100000001,
                  "conid": 265598,
                  "conidex": "265598",
                  "symbol": "AAPL",
                  "side": "S",
                  "order_status": "PreSubmitted",
                  "order_type": "STOP",
                  "total_size": "10.0",
                  "cum_fill": "0.0",
                  "account": "MOCK-ACCOUNT-001",
                  "currency": "USD",
                  "listing_exchange": "NASDAQ.NMS"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-order-status",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/order-status"
      }
    },
    "/iserver/account/orders": {
      "get": {
        "operationId": "live-orders",
        "summary": "Open orders, plus orders filled or cancelled during the current brokerage session.",
        "description": "Only orders from the current brokerage session appear.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-open-orders"
        },
        "parameters": [
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "description": "Comma separated order status values to filter by.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "description": "Clears IBKR's order cache and gets an updated view from the brokerage backend.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveOrders"
                },
                "example": {
                  "orders": [
                    {
                      "acct": "MOCK-ACCOUNT-001",
                      "conid": "265598",
                      "orderId": 100000001,
                      "ticker": "AAPL",
                      "side": "SELL",
                      "status": "PreSubmitted",
                      "orderType": "Stop",
                      "totalSize": "10.0",
                      "filledQuantity": "0.0",
                      "remainingQuantity": "10.0",
                      "price": "185"
                    }
                  ],
                  "snapshot": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-open-orders",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/live-orders"
      }
    },
    "/iserver/account/pnl/partitioned": {
      "get": {
        "operationId": "pnl-partitioned",
        "summary": "Updated profit and loss for the selected account, keyed by account and segment. The first request returns an empty upnl object.",
        "description": "Call it once to start the data, then again for values.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-accounts/get-pnl"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PnlPartitioned"
                },
                "example": {
                  "upnl": {
                    "MOCK-ACCOUNT-001.Core": {
                      "rowType": 1,
                      "dpl": 12.5,
                      "nl": 10000,
                      "upl": 120.5,
                      "el": 8500,
                      "mv": 2500
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-accounts/get-pnl",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/pnl-partitioned"
      }
    },
    "/iserver/account/trades": {
      "get": {
        "operationId": "trades",
        "summary": "Executions from the last 7 days at most, with symbol, side, size, price, commission and time.",
        "description": "7 days is the maximum IBKR's page gives.",
        "tags": [
          "Trades"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-trade-history"
        },
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Number of prior days to include, 7 at most.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Trade"
                  }
                },
                "example": [
                  {
                    "execution_id": "MOCK-EXEC-0001",
                    "symbol": "AAPL",
                    "side": "B",
                    "order_description": "Bot 10 @ 185.00 on NASDAQ",
                    "trade_time": "20260918-14:30:00",
                    "trade_time_r": 1789741800000,
                    "size": 10,
                    "price": "185.00",
                    "commission": "1.00",
                    "conid": "265598",
                    "account": "MOCK-ACCOUNT-001",
                    "sec_type": "STK"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/get-trade-history",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/trades"
      }
    },
    "/iserver/accounts": {
      "get": {
        "operationId": "iserver-accounts",
        "summary": "The accounts you can trade, their aliases and the currently selected account. IBKR says to call it before the market data snapshot.",
        "description": "isPaper tells you whether you logged in with a paper account.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-accounts/get-brokerage-accounts"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IserverAccounts"
                },
                "example": {
                  "accounts": [
                    "MOCK-ACCOUNT-001"
                  ],
                  "acctProps": {
                    "MOCK-ACCOUNT-001": {}
                  },
                  "aliases": {
                    "MOCK-ACCOUNT-001": "MOCK-ACCOUNT-001"
                  },
                  "allowFeatures": {},
                  "chartPeriods": {},
                  "groups": [],
                  "profiles": [],
                  "selectedAccount": "MOCK-ACCOUNT-001",
                  "serverInfo": {
                    "serverName": "MOCK-SERVER",
                    "serverVersion": "MOCK-BUILD"
                  },
                  "sessionId": "MOCK-SESSION-0001",
                  "isPaper": true,
                  "isFT": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-accounts/get-brokerage-accounts",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/iserver-accounts"
      }
    },
    "/iserver/auth/ssodh/init": {
      "post": {
        "operationId": "ssodh-init",
        "summary": "Starts the brokerage session. IBKR documents it for OAuth users after the access token and live session token steps.",
        "description": "compete true disconnects your other brokerage sessions to prioritise this one.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/initialize-session"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "publish": {
                    "type": "boolean",
                    "description": "Publish the brokerage session token at the same time. IBKR says setting true is the preferred way."
                  },
                  "compete": {
                    "type": "boolean",
                    "description": "Whether other brokerage sessions should be disconnected to prioritise this connection."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthStatus"
                },
                "example": {
                  "authenticated": true,
                  "established": true,
                  "competing": false,
                  "connected": true,
                  "message": "",
                  "MAC": "00:00:00:00:00:00",
                  "serverInfo": {
                    "serverName": "MOCK-SERVER",
                    "serverVersion": "MOCK-BUILD"
                  },
                  "fail": ""
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/initialize-session",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/ssodh-init"
      }
    },
    "/iserver/auth/status": {
      "post": {
        "operationId": "auth-status",
        "summary": "Whether your brokerage session is authenticated, fully established and free of a competing session. Call it after you log in through the gateway.",
        "description": "IBKR's reference lists this as POST. established shows the session is fully set up and ready to handle requests.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/get-brokerage-status"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthStatus"
                },
                "example": {
                  "authenticated": true,
                  "established": true,
                  "competing": false,
                  "connected": true,
                  "message": "",
                  "MAC": "00:00:00:00:00:00",
                  "serverInfo": {
                    "serverName": "MOCK-SERVER",
                    "serverVersion": "MOCK-BUILD"
                  },
                  "fail": ""
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/get-brokerage-status",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/auth-status"
      }
    },
    "/iserver/contract/{conid}/info": {
      "get": {
        "operationId": "contract-info",
        "summary": "Full contract details for a conid: symbol, instrument type, currency, exchange, trading class and whether it can be smart routed.",
        "tags": [
          "Contracts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-instrument-info"
        },
        "parameters": [
          {
            "name": "conid",
            "in": "path",
            "required": true,
            "description": "Contract identifier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractInfo"
                },
                "example": {
                  "con_id": 265598,
                  "symbol": "AAPL",
                  "company_name": "APPLE INC",
                  "instrument_type": "STK",
                  "currency": "USD",
                  "exchange": "NASDAQ",
                  "valid_exchanges": "SMART,NASDAQ",
                  "trading_class": "NMS",
                  "local_symbol": "AAPL",
                  "smart_available": true,
                  "r_t_h": true,
                  "category": "Computers",
                  "industry": "Technology",
                  "cfi_code": "",
                  "cusip": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-instrument-info",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/contract-info"
      }
    },
    "/iserver/marketdata/history": {
      "get": {
        "operationId": "marketdata-history",
        "summary": "OHLC bars for a contract over a period, with bar size, start time, data source and outside hours option.",
        "description": "Each bar has o, h, l, c, v and t, a Unix time in milliseconds.",
        "tags": [
          "Market data"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-market-data/get-md-history"
        },
        "parameters": [
          {
            "name": "conid",
            "in": "query",
            "required": true,
            "description": "IB contract ID of the instrument.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": true,
            "description": "Length of the request, in min, h, d, w, m or y. Default 1d.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bar",
            "in": "query",
            "required": true,
            "description": "Bar size, in S, min, h, d, w or m. Default 1min.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "description": "Exchange, or SMART, to request data from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outsideRth",
            "in": "query",
            "required": false,
            "description": "Include data outside regular trading hours. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "startTime",
            "in": "query",
            "required": false,
            "description": "Format YYYYMMDD-hh:mm:ss.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "-1 (default): data ends at the current time. 1: data begins at startTime.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Last (default), Bid_Ask or Midpoint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                },
                "example": {
                  "symbol": "AAPL",
                  "text": "APPLE INC",
                  "timePeriod": "1w",
                  "barLength": 86400,
                  "startTime": "20260911-13:30:00",
                  "points": 1,
                  "priceFactor": 100,
                  "volumeFactor": 100,
                  "outsideRth": false,
                  "mktDataDelay": 0,
                  "serverId": "MOCK-0001",
                  "data": [
                    {
                      "o": 188.5,
                      "h": 191.2,
                      "l": 187.9,
                      "c": 190,
                      "v": 0,
                      "t": 1789725600000
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-market-data/get-md-history",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/marketdata-history"
      }
    },
    "/iserver/marketdata/snapshot": {
      "get": {
        "operationId": "marketdata-snapshot",
        "summary": "Top of book values for one or more contracts, such as last (31), bid (84) and ask (86). The first request only starts the data.",
        "description": "IBKR: a pre-flight request must be made before any data comes back, /iserver/accounts must be called first, and for derivatives /iserver/secdef/search first. The lesson shows the first reply carrying only _updated, conidEx and conid; the numbered keys in our mock follow the fields you asked for.",
        "tags": [
          "Market data"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-market-data/get-md-snapshot"
        },
        "parameters": [
          {
            "name": "conids",
            "in": "query",
            "required": true,
            "description": "Contract IDs, comma separated.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "description": "Tick IDs, comma separated, 50 at most. 31 last price, 55 symbol, 84 bid, 86 ask, 70 high, 71 low, 7295 open.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SnapshotItem"
                  }
                },
                "example": [
                  {
                    "31": "190.00",
                    "84": "189.99",
                    "86": "190.01",
                    "_updated": 1789725600000,
                    "conidEx": "265598",
                    "conid": 265598
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://ibkrcampus.com/campus/trading-lessons/requesting-market-data/",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/marketdata-snapshot"
      }
    },
    "/iserver/reply/{replyId}": {
      "post": {
        "operationId": "order-reply",
        "summary": "Answers a warning that came back from an order submission and continues with the order. The answer can bring another question.",
        "description": "The 200 body can also be another reply message, an error object, or orderReplyNotFound when the reply ID does not exist.",
        "tags": [
          "Orders"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/confirm-order-reply"
        },
        "parameters": [
          {
            "name": "replyId",
            "in": "path",
            "required": true,
            "description": "The UUID of the reply message, from the order submission response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirmed": {
                    "type": "boolean",
                    "description": "true answers the question in the affirmative and proceeds with the order."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                },
                "example": [
                  {
                    "order_id": "MOCK-ORDER-0001",
                    "order_status": "PreSubmitted",
                    "encrypt_message": "1"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-orders/confirm-order-reply",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/order-reply"
      }
    },
    "/iserver/secdef/info": {
      "get": {
        "operationId": "secdef-info",
        "summary": "Attributes of an instrument, mainly for derivatives: ticker, exchanges, currency, maturity, right and strike.",
        "description": "The reference page marks every query parameter optional; IBKR's Campus page says month, strike and right are required for options.",
        "tags": [
          "Contracts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-contract-info"
        },
        "parameters": [
          {
            "name": "conid",
            "in": "query",
            "required": false,
            "description": "Contract ID. The Campus page describes it as the contract identifier of the underlying.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sectype",
            "in": "query",
            "required": false,
            "description": "Security type of the requested contract.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Expiration month, for derivatives.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "description": "Exchange to return information for.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "strike",
            "in": "query",
            "required": false,
            "description": "Strike price, for options.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "right",
            "in": "query",
            "required": false,
            "description": "C for call options, P for put options.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SecdefInfo"
                  }
                },
                "example": [
                  {
                    "conid": 100000001,
                    "ticker": "AAPL",
                    "secType": "OPT",
                    "listingExchange": "SMART",
                    "exchange": "SMART",
                    "companyName": "APPLE INC",
                    "currency": "USD",
                    "validExchanges": "SMART,CBOE",
                    "maturityDate": "20270115",
                    "right": "C",
                    "strike": 200
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-contract-info",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/secdef-info"
      }
    },
    "/iserver/secdef/search": {
      "get": {
        "operationId": "secdef-search",
        "summary": "Finds contracts for a symbol and returns their contract IDs (conid), which every market data and order call needs.",
        "description": "265598 is the AAPL contract ID IBKR uses in its own lessons.",
        "tags": [
          "Contracts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-contract-symbols"
        },
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Search symbol.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secType",
            "in": "query",
            "required": false,
            "description": "STK, IND or BOND. Defaults to STK.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Listed on the reference page without a description. IBKR's Campus page says it sets whether symbol is a company name rather than a ticker.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SecdefSearchResult"
                  }
                },
                "example": [
                  {
                    "conid": "265598",
                    "companyHeader": "APPLE INC - NASDAQ",
                    "companyName": "APPLE INC",
                    "symbol": "AAPL",
                    "description": "NASDAQ",
                    "sections": [
                      {
                        "secType": "STK"
                      }
                    ]
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-contracts/get-contract-symbols",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/secdef-search"
      }
    },
    "/logout": {
      "post": {
        "operationId": "logout",
        "summary": "Logs you out of the gateway session. Any further call needs a new login, and IBKR says to discard client side cookies.",
        "description": "status confirms the logout was performed.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/logout"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoutResponse"
                },
                "example": {
                  "status": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/logout",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/logout"
      }
    },
    "/portfolio/{accountId}/ledger": {
      "get": {
        "operationId": "portfolio-ledger",
        "summary": "Cash balance, net liquidation and profit and loss for each currency the account holds, plus a BASE total.",
        "description": "Keys are currency codes such as USD, plus BASE for the account's base currency.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-portfolio-ledger"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ledger"
                },
                "example": {
                  "BASE": {
                    "cashbalance": 7500,
                    "netliquidationvalue": 10000,
                    "unrealizedpnl": 120.5,
                    "realizedpnl": 0,
                    "stockmarketvalue": 2500,
                    "exchangerate": 1,
                    "timestamp": 1789725600
                  },
                  "USD": {
                    "cashbalance": 0,
                    "netliquidationvalue": 3200,
                    "unrealizedpnl": 160,
                    "realizedpnl": 0,
                    "stockmarketvalue": 3200,
                    "exchangerate": 0.78,
                    "timestamp": 1789725600
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-portfolio-ledger",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/portfolio-ledger"
      }
    },
    "/portfolio/{accountId}/positions/{pageId}": {
      "get": {
        "operationId": "portfolio-positions",
        "summary": "All positions in an account, one page at a time, with size, market price, market value and unrealised profit and loss.",
        "description": "IBKR's reference also has an uncached positions endpoint and a call to invalidate the positions cache.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-paginated-positions"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "description": "Page number of the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Field to sort by. Listed on IBKR's page without a description.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Sort direction. Listed on IBKR's page without a description.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "waitForSecDef",
            "in": "query",
            "required": false,
            "description": "Listed on IBKR's page without a description.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Position"
                  }
                },
                "example": [
                  {
                    "acctId": "MOCK-ACCOUNT-001",
                    "conid": 265598,
                    "ticker": "AAPL",
                    "assetClass": "STK",
                    "currency": "USD",
                    "position": 10,
                    "mktPrice": 190,
                    "mktValue": 1900,
                    "unrealizedPnl": 50
                  }
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-paginated-positions",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/portfolio-positions"
      }
    },
    "/portfolio/{accountId}/summary": {
      "get": {
        "operationId": "portfolio-summary",
        "summary": "Account values such as net liquidation, available funds, buying power and margin, by segment where it applies.",
        "description": "Every field is an object. IBKR's page marks money fields as amount and text fields as value; the other keys inside each object are not listed there, so our mock uses only those.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-portfolio-summary"
        },
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "description": "Your IBKR account ID. The code reads it from the IBKR_ACCOUNT_ID environment variable. Never type it into this site.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioSummary"
                },
                "example": {
                  "accountcode": {
                    "value": "MOCK-ACCOUNT-001"
                  },
                  "accountready": {
                    "value": "true"
                  },
                  "netliquidation": {
                    "amount": 10000,
                    "currency": "GBP"
                  },
                  "availablefunds": {
                    "amount": 8000,
                    "currency": "GBP"
                  },
                  "buyingpower": {
                    "amount": 32000,
                    "currency": "GBP"
                  },
                  "excessliquidity": {
                    "amount": 8500,
                    "currency": "GBP"
                  },
                  "initmarginreq": {
                    "amount": 2000,
                    "currency": "GBP"
                  },
                  "maintmarginreq": {
                    "amount": 1500,
                    "currency": "GBP"
                  },
                  "grosspositionvalue": {
                    "amount": 2500,
                    "currency": "GBP"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-portfolio-summary",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/portfolio-summary"
      }
    },
    "/portfolio/accounts": {
      "get": {
        "operationId": "portfolio-accounts",
        "summary": "Your accounts with ID, title, base currency and type, for the portfolio endpoints.",
        "description": "type shows whether the account is production, paper or demo.",
        "tags": [
          "Accounts"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-all-accounts"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PortfolioAccount"
                  }
                },
                "example": [
                  {
                    "id": "MOCK-ACCOUNT-001",
                    "accountId": "MOCK-ACCOUNT-001",
                    "accountVan": "MOCK-ACCOUNT-001",
                    "accountTitle": "Mock Account",
                    "displayName": "MOCK-ACCOUNT-001",
                    "accountAlias": null,
                    "currency": "GBP",
                    "type": "DEMO",
                    "tradingType": "STKNOPT",
                    "faclient": false,
                    "covestor": false,
                    "brokerageAccess": true,
                    "noClientTrading": false
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-portfolio/get-all-accounts",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/portfolio-accounts"
      }
    },
    "/tickle": {
      "post": {
        "operationId": "tickle",
        "summary": "Pings the server so the session does not time out. IBKR expects a call about every 60 seconds.",
        "description": "The reference page and IBKR's Ping the server page both show POST /tickle, and the second says to call it approximately every 60 seconds. The pacing page lists GET /tickle at 1 request a second. The field is spelled collission in IBKR's example; the reference schema spells it collision.",
        "tags": [
          "Session"
        ],
        "externalDocs": {
          "description": "Interactive Brokers's own reference for this operation",
          "url": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/get-session-token"
        },
        "responses": {
          "200": {
            "description": "Success. Example is mock data, not real account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TickleResponse"
                },
                "example": {
                  "session": "MOCK-SESSION-0001",
                  "ssoExpires": 460311,
                  "collission": false,
                  "userId": 10000001,
                  "hmds": {
                    "error": "no bridge"
                  },
                  "iserver": {
                    "authStatus": {
                      "authenticated": true,
                      "competing": false,
                      "connected": true,
                      "message": "",
                      "MAC": "00:00:00:00:00:00",
                      "serverInfo": {
                        "serverName": "MOCK-SERVER",
                        "serverVersion": "MOCK-BUILD"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "security": [
          {},
          {
            "Authorization": []
          }
        ],
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/trading-session/get-session-token",
        "x-checked": "2026-09-18",
        "x-version": "v1",
        "x-carried": "responses",
        "x-page": "https://openbrokerapi.com/brokers/ibkr/endpoints/tickle"
      }
    }
  },
  "components": {
    "schemas": {
      "CancelResponse": {
        "type": "object",
        "properties": {
          "msg": {
            "type": "string"
          },
          "order_id": {
            "type": "integer"
          },
          "conid": {
            "type": "string"
          },
          "account": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "OrderResponse": {
        "oneOf": [
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderSubmitSuccess"
            }
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderReplyMessage"
            }
          },
          {
            "$ref": "#/components/schemas/Error"
          }
        ],
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "OrderSubmitSuccess": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string"
          },
          "order_status": {
            "type": "string"
          },
          "encrypt_message": {
            "type": "string"
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "OrderReplyMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Reply ID to confirm with POST /iserver/reply/{replyId}."
          },
          "message": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isSuppressed": {
            "type": "boolean"
          },
          "messageIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "x-source": "https://www.interactivebrokers.com/docs/web-api/v1/endpoints/orders/place-order",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human readable error text."
          }
        },
        "description": "Error object. IBKR's order pages show orderSubmitError as an object with one error string; other endpoints do not publish an error body.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/v1/endpoints/orders/place-order"
      },
      "WhatIfResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "object"
          },
          "equity": {
            "type": "object"
          },
          "initial": {
            "type": "object"
          },
          "maintenance": {
            "type": "object"
          },
          "position": {
            "type": "object"
          },
          "warn": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "OrderStatus": {
        "type": "object",
        "properties": {
          "sub_type": {
            "type": "null"
          },
          "request_id": {
            "type": "string"
          },
          "server_id": {
            "type": "string"
          },
          "order_id": {
            "type": "integer"
          },
          "conidex": {
            "type": "string"
          },
          "conid": {
            "type": "integer"
          },
          "symbol": {
            "type": "string"
          },
          "side": {
            "type": "string"
          },
          "order_status": {
            "type": "string"
          },
          "order_type": {
            "type": "string"
          },
          "total_size": {
            "type": "string"
          },
          "cum_fill": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "listing_exchange": {
            "type": "string"
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "order-status",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "LiveOrders": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiveOrder"
            }
          },
          "snapshot": {
            "type": "boolean"
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "LiveOrder": {
        "type": "object",
        "properties": {
          "acct": {
            "type": "string"
          },
          "conid": {
            "type": "string"
          },
          "orderId": {
            "type": "integer"
          },
          "ticker": {
            "type": "string"
          },
          "side": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "orderType": {
            "type": "string"
          },
          "totalSize": {
            "type": "string"
          },
          "filledQuantity": {
            "type": "string"
          },
          "remainingQuantity": {
            "type": "string"
          },
          "price": {
            "type": "string"
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "order-data",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "PnlPartitioned": {
        "type": "object",
        "properties": {
          "upnl": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "rowType": {
                  "type": "integer"
                },
                "dpl": {
                  "type": "number"
                },
                "nl": {
                  "type": "number"
                },
                "upl": {
                  "type": "number"
                },
                "el": {
                  "type": "number"
                },
                "mv": {
                  "type": "number"
                }
              }
            }
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "Trade": {
        "type": "object",
        "properties": {
          "execution_id": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "side": {
            "type": "string"
          },
          "order_description": {
            "type": "string"
          },
          "trade_time": {
            "type": "string"
          },
          "trade_time_r": {
            "type": "integer"
          },
          "size": {
            "type": "number"
          },
          "price": {
            "type": "string"
          },
          "commission": {
            "type": "string"
          },
          "conid": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "sec_type": {
            "type": "string"
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "trade",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "IserverAccounts": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "acctProps": {
            "type": "object"
          },
          "aliases": {
            "type": "object"
          },
          "allowFeatures": {
            "type": "object"
          },
          "chartPeriods": {
            "type": "object"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "profiles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selectedAccount": {
            "type": "string"
          },
          "serverInfo": {
            "type": "object",
            "properties": {
              "serverName": {
                "type": "string"
              },
              "serverVersion": {
                "type": "string"
              }
            }
          },
          "sessionId": {
            "type": "string"
          },
          "isPaper": {
            "type": "boolean"
          },
          "isFT": {
            "type": "boolean"
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "AuthStatus": {
        "type": "object",
        "properties": {
          "authenticated": {
            "type": "boolean",
            "description": "Whether the brokerage session is authenticated."
          },
          "established": {
            "type": "boolean",
            "description": "Whether the brokerage session is fully established and ready to handle requests."
          },
          "competing": {
            "type": "boolean",
            "description": "Whether a competing brokerage session exists in another connection."
          },
          "connected": {
            "type": "boolean",
            "description": "Whether you are connected to the gateway."
          },
          "message": {
            "type": "string"
          },
          "MAC": {
            "type": "string"
          },
          "serverInfo": {
            "type": "object",
            "properties": {
              "serverName": {
                "type": "string"
              },
              "serverVersion": {
                "type": "string"
              }
            }
          },
          "hardware_info": {
            "type": "string",
            "description": "Client Portal use only."
          },
          "fail": {
            "type": "string",
            "description": "Reason for failing to retrieve authentication status."
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "authStatus",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "ContractInfo": {
        "type": "object",
        "properties": {
          "con_id": {
            "type": "integer"
          },
          "symbol": {
            "type": "string"
          },
          "company_name": {
            "type": "string"
          },
          "instrument_type": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "exchange": {
            "type": "string"
          },
          "valid_exchanges": {
            "type": "string"
          },
          "trading_class": {
            "type": "string"
          },
          "local_symbol": {
            "type": "string"
          },
          "underlying_con_id": {
            "type": "integer"
          },
          "smart_available": {
            "type": "boolean"
          },
          "r_t_h": {
            "type": "boolean"
          },
          "allow_sell_long": {
            "type": "boolean"
          },
          "is_zero_commission_security": {
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "industry": {
            "type": "string"
          },
          "cfi_code": {
            "type": "string"
          },
          "cusip": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "contract",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "HistoryResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "timePeriod": {
            "type": "string"
          },
          "barLength": {
            "type": "integer"
          },
          "startTime": {
            "type": "string"
          },
          "chartPanStartTime": {
            "type": "string"
          },
          "direction": {
            "type": "integer"
          },
          "high": {
            "type": "string"
          },
          "low": {
            "type": "string"
          },
          "points": {
            "type": "integer"
          },
          "priceFactor": {
            "type": "integer"
          },
          "volumeFactor": {
            "type": "integer"
          },
          "priceDisplayRule": {
            "type": "integer"
          },
          "priceDisplayValue": {
            "type": "string"
          },
          "negativeCapable": {
            "type": "boolean"
          },
          "mdAvailability": {
            "type": "string"
          },
          "mktDataDelay": {
            "type": "integer"
          },
          "messageVersion": {
            "type": "integer"
          },
          "outsideRth": {
            "type": "boolean"
          },
          "serverId": {
            "type": "string"
          },
          "travelTime": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryBar"
            }
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "HistoryBar": {
        "type": "object",
        "properties": {
          "o": {
            "type": "number"
          },
          "h": {
            "type": "number"
          },
          "l": {
            "type": "number"
          },
          "c": {
            "type": "number"
          },
          "v": {
            "type": "number"
          },
          "t": {
            "type": "integer",
            "description": "Unix time in milliseconds."
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "history-data",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "SnapshotItem": {
        "type": "object",
        "properties": {
          "conid": {
            "type": "integer"
          },
          "conidEx": {
            "type": "string"
          },
          "_updated": {
            "type": "integer"
          }
        },
        "additionalProperties": {
          "type": "string",
          "description": "Keys are the tick IDs you asked for, such as 31 last, 84 bid and 86 ask."
        },
        "description": "The first reply usually carries only _updated, conidEx and conid (IBKR's Requesting Market Data lesson).",
        "x-source": "https://ibkrcampus.com/campus/trading-lessons/requesting-market-data/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "SecdefInfo": {
        "type": "object",
        "properties": {
          "conid": {
            "type": "integer"
          },
          "ticker": {
            "type": "string"
          },
          "secType": {
            "type": "string"
          },
          "listingExchange": {
            "type": "string"
          },
          "exchange": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "validExchanges": {
            "type": "string"
          },
          "priceRendering": {
            "type": [
              "string",
              "null"
            ]
          },
          "maturityDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "right": {
            "type": "string",
            "enum": [
              "C",
              "P"
            ]
          },
          "strike": {
            "type": "number"
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "secdef-info",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "SecdefSearchResult": {
        "type": "object",
        "properties": {
          "conid": {
            "type": "string"
          },
          "companyHeader": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "restricted": {
            "type": [
              "string",
              "null"
            ]
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "secType": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "secdef",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "LogoutResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "description": "Confirms the logout was performed."
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "Ledger": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/LedgerCurrency"
        },
        "description": "Keyed by currency code, plus BASE.",
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "ledger",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "LedgerCurrency": {
        "type": "object",
        "properties": {
          "cashbalance": {
            "type": "number"
          },
          "netliquidationvalue": {
            "type": "number"
          },
          "unrealizedpnl": {
            "type": "number"
          },
          "realizedpnl": {
            "type": "number"
          },
          "stockmarketvalue": {
            "type": "number"
          },
          "futuremarketvalue": {
            "type": "number"
          },
          "stockoptionmarketvalue": {
            "type": "number"
          },
          "exchangerate": {
            "type": "number"
          },
          "timestamp": {
            "type": "number"
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "Position": {
        "type": "object",
        "properties": {
          "acctId": {
            "type": "string"
          },
          "conid": {
            "type": "integer"
          },
          "ticker": {
            "type": "string"
          },
          "assetClass": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "position": {
            "type": "number"
          },
          "mktPrice": {
            "type": "number"
          },
          "mktValue": {
            "type": "number"
          },
          "unrealizedPnl": {
            "type": "number"
          }
        },
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-verified": true,
        "x-checked": "2026-10-04",
        "x-vendor-definition": "position",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "PortfolioSummary": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/SummaryValue"
        },
        "description": "Keys include accountcode, accountready, accounttype, netliquidation, availablefunds, buyingpower, excessliquidity, initmarginreq, maintmarginreq and grosspositionvalue, many with -c and -s segment variants.",
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "SummaryValue": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "value": {
            "type": "string"
          }
        },
        "description": "Each summary field is an object. IBKR's page marks money fields as amount and text fields as value; other keys are not listed.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/api/doc.json",
        "x-checked": "2026-10-04",
        "x-vendor-definition": "summary",
        "x-source-note": "Interactive Brokers' own Swagger 2.0 document, read 4 Oct 2026. It carries no date, declares host localhost:5000 over http and swagger 2.0, title Client Portal Web API, version 1.0.0, basePath /v1/api, and it describes the Client Portal Gateway surface. It has no /iserver/auth/ssodh/init and no /iserver/account/pnl/partitioned, so it is the vendor's document but not a complete authority for the current API."
      },
      "PortfolioAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "accountVan": {
            "type": "string"
          },
          "accountTitle": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "accountAlias": {
            "type": [
              "string",
              "null"
            ]
          },
          "accountStatus": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "tradingType": {
            "type": "string"
          },
          "businessType": {
            "type": "string"
          },
          "ibEntity": {
            "type": "string"
          },
          "faclient": {
            "type": "boolean"
          },
          "clearingStatus": {
            "type": "string"
          },
          "covestor": {
            "type": "boolean"
          },
          "noClientTrading": {
            "type": "boolean"
          },
          "trackVirtualFXPortfolio": {
            "type": "boolean"
          },
          "acctCustType": {
            "type": "string"
          },
          "desc": {
            "type": "string"
          },
          "brokerageAccess": {
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "parent": {
            "type": "object"
          },
          "PrepaidCrypto-Z": {
            "type": "boolean"
          },
          "PrepaidCrypto-P": {
            "type": "boolean"
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      },
      "TickleResponse": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string"
          },
          "ssoExpires": {
            "type": "integer"
          },
          "collision": {
            "type": "boolean",
            "description": "Spelled collission in IBKR's example response."
          },
          "userId": {
            "type": "integer"
          },
          "hmds": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          },
          "iserver": {
            "type": "object",
            "properties": {
              "authStatus": {
                "$ref": "#/components/schemas/AuthStatus"
              }
            }
          }
        },
        "x-source": "https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/",
        "x-verified": false,
        "x-checked": "2026-10-04",
        "x-source-note": "The vendor's Swagger document at interactivebrokers.com/api/doc.json names no definition for this object, so the fields here are this site's reading of the Campus Client Portal API page, which carries no publication date. interactivebrokers.github.io/cpwebapi serves no content to a reader without JavaScript and cannot be cited."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request. IBKR's reference lists it as Bad Request Error for this endpoint.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/"
      },
      "Unauthorized": {
        "description": "No authenticated brokerage session, or a missing or expired bearer token. IBKR's reference lists 401 Unauthorized Error on every endpoint page we opened. Log in again through the gateway.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/"
      },
      "TooManyRequests": {
        "description": "Over the pacing limit: 10 requests a second per authenticated username overall, lower for some endpoints. Violator IP addresses may be put in a penalty box for 10 minutes.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/trading/usage-and-availability/pacing-limitations"
      },
      "ServerError": {
        "description": "Internal Server Error, as listed on IBKR's reference page.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/"
      },
      "ServiceUnavailable": {
        "description": "Service Unavailable Error, as listed on IBKR's reference page.",
        "x-verified": true,
        "x-source": "https://www.interactivebrokers.com/docs/web-api/api-reference/trading/"
      }
    },
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "A header the Interactive Brokers endpoint records list on requests. Read its value from your own environment. Never paste it into a web page or a chat."
      }
    }
  }
}