{"files":{"SKILL.md":"---\nname: client-portal-web-api\ndescription: \"Client Portal Web API skill. Use when working with Client Portal Web for fyi, trsrv, ws. Covers 83 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Client Portal Web API\nAPI version: 1.0.0\n\n## Auth\nNo authentication required.\n\n## Base URL\nhttp://localhost:5000/v1/api\n\n## Setup\n1. No auth setup needed\n2. GET /fyi/unreadnumber -- verify access\n3. POST /fyi/settings/{typecode} -- create first settings\n\n## Endpoints\n\n83 endpoints across 12 groups. See references/api-spec.lap for full details.\n\n### fyi\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /fyi/unreadnumber | Get unread number of fyis. The HTTP method POST is also supported. |\n| GET | /fyi/settings | Get a list of subscriptions |\n| POST | /fyi/settings/{typecode} | Enable/Disable certain subscription |\n| GET | /fyi/disclaimer/{typecode} | Get disclaimer for a certain kind of fyi |\n| PUT | /fyi/disclaimer/{typecode} | Mark disclaimer read |\n| GET | /fyi/deliveryoptions | Get delivery options |\n| PUT | /fyi/deliveryoptions/email | Enable/Disable email option |\n| POST | /fyi/deliveryoptions/device | Enable/Disable device option |\n| DELETE | /fyi/deliveryoptions/{deviceId} | Delete a device |\n| GET | /fyi/notifications | Get a list of notifications |\n| GET | /fyi/notifications/more | Get more notifications based on a certain one |\n| PUT | /fyi/notifications/{notificationId} | Get a list of notifications |\n\n### trsrv\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /trsrv/secdef | Secdef by Conid |\n| GET | /trsrv/secdef/schedule | Get trading schedule for symbol |\n| GET | /trsrv/futures | Security Futures by Symbol |\n| GET | /trsrv/stocks | Security Stocks by Symbol |\n\n### ws\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /ws | Websocket Endpoint |\n\n### tickle\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /tickle | Ping the server to keep the session open |\n\n### logout\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /logout | Ends the current session |\n\n### ccp\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /ccp/auth/init | Start CCP Session |\n| POST | /ccp/auth/response | Complete CCP Session |\n| GET | /ccp/status | CCP Status |\n| GET | /ccp/account | Brokerage Accounts |\n| GET | /ccp/positions | Positions |\n| GET | /ccp/orders | Order Status |\n| POST | /ccp/order | Submit Order |\n| DELETE | /ccp/order | Delete Order |\n| PUT | /ccp/order | Update Order |\n| GET | /ccp/trades | Trades |\n\n### hmds\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /hmds/history | Market Data History (Beta) |\n| POST | /hmds/scanner | Run Scanner (Beta) |\n\n### sso\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /sso/validate | Validate SSO |\n\n### md\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /md/snapshot | Market Data Snapshot (Beta) |\n\n### pa\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /pa/performance | Account Performance |\n| POST | /pa/summary | Account Balance's Summary (Deprecated) |\n| POST | /pa/transactions | Position's Transaction History |\n\n### portfolio\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /portfolio/accounts | Portfolio Accounts |\n| GET | /portfolio/subaccounts | List of Sub-Accounts |\n| GET | /portfolio/subaccounts2 | List of Sub-Accounts (Large Accounts) |\n| GET | /portfolio/{accountId}/meta | Account Information |\n| GET | /portfolio/{accountId}/allocation | Account Allocation |\n| POST | /portfolio/allocation | Account Alloction (All Accounts) |\n| GET | /portfolio/{accountId}/positions/{pageId} | Portfolio Positions |\n| GET | /portfolio/{accountId}/position/{conid} | Position by Conid |\n| POST | /portfolio/{accountId}/positions/invalidate | Invalidates the backend cache of the Portfolio |\n| GET | /portfolio/{accountId}/summary | Account Summary |\n| GET | /portfolio/{accountId}/ledger | Account Ledger |\n| GET | /portfolio/positions/{conid} | Positions by Conid |\n\n### iserver\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /iserver/auth/status | Authentication Status |\n| POST | /iserver/reauthenticate | Tries to re-authenticate to Brokerage |\n| GET | /iserver/account/trades | List of Trades for the selected account |\n| GET | /iserver/accounts | Brokerage Accounts |\n| POST | /iserver/account | Switch Account |\n| POST | /iserver/account/{accountId}/alert | Create or modify alert |\n| GET | /iserver/account/:accountId/alerts | Get a list of available alerts |\n| POST | /iserver/account/:accountId/alert/activate | Activate or deactivate an alert |\n| DELETE | /iserver/account/:accountId/alert/:alertId | Delete an alert |\n| GET | /iserver/account/alert/:id | Get details of an alert |\n| GET | /iserver/account/mta | Get MTA alert |\n| GET | /iserver/account/orders | Live Orders |\n| POST | /iserver/account/{accountId}/order | Place Order (Deprecated) |\n| POST | /iserver/account/{accountId}/orders | Place Orders |\n| POST | /iserver/account/orders/{faGroup} | Place Orders for FA |\n| POST | /iserver/reply/{replyid} | Place Order Reply |\n| POST | /iserver/account/{accountId}/order/whatif | Preview Order (Deprecated) |\n| POST | /iserver/account/{accountId}/orders/whatif | Preview Orders |\n| GET | /iserver/account/order/status/{orderId} | Order Status |\n| POST | /iserver/account/{accountId}/order/{orderId} | Modify Order |\n| DELETE | /iserver/account/{accountId}/order/{orderId} | Cancel Order |\n| GET | /iserver/marketdata/snapshot | Market Data |\n| GET | /iserver/marketdata/{conid}/unsubscribe | Market Data Cancel (Single) |\n| GET | /iserver/marketdata/unsubscribeall | Market Data Cancel (All) |\n| GET | /iserver/marketdata/history | Market Data History |\n| GET | /iserver/contract/{conid}/info | Contract Details |\n| POST | /iserver/secdef/search | Search by Symbol or Name |\n| GET | /iserver/secdef/strikes | Search Strikes |\n| GET | /iserver/secdef/info | Secdef Info |\n| GET | /iserver/contract/{conid}/algos | IB Algo Params |\n| POST | /iserver/contract/rules | Contract Rules |\n| GET | /iserver/contract/{conid}/info-and-rules | Info and Rules |\n| GET | /iserver/scanner/params | Scanner Parameters |\n| POST | /iserver/scanner/run | Scanner Run |\n| GET | /iserver/account/pnl/partitioned | PnL for the selected account |\n\n## Common Questions\n\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all unreadnumber?\" -> GET /fyi/unreadnumber\n- \"List all settings?\" -> GET /fyi/settings\n- \"Get disclaimer details?\" -> GET /fyi/disclaimer/{typecode}\n- \"Update a disclaimer?\" -> PUT /fyi/disclaimer/{typecode}\n- \"List all deliveryoptions?\" -> GET /fyi/deliveryoptions\n- \"Create a device?\" -> POST /fyi/deliveryoptions/device\n- \"Delete a deliveryoption?\" -> DELETE /fyi/deliveryoptions/{deviceId}\n- \"List all notifications?\" -> GET /fyi/notifications\n- \"List all more?\" -> GET /fyi/notifications/more\n- \"Update a notification?\" -> PUT /fyi/notifications/{notificationId}\n- \"Create a secdef?\" -> POST /trsrv/secdef\n- \"List all schedule?\" -> GET /trsrv/secdef/schedule\n- \"List all futures?\" -> GET /trsrv/futures\n- \"List all stocks?\" -> GET /trsrv/stocks\n- \"Create a w?\" -> POST /ws\n- \"Create a tickle?\" -> POST /tickle\n- \"Create a logout?\" -> POST /logout\n- \"Create a init?\" -> POST /ccp/auth/init\n- \"List all history?\" -> GET /hmds/history\n- \"Create a response?\" -> POST /ccp/auth/response\n- \"List all status?\" -> GET /ccp/status\n- \"List all account?\" -> GET /ccp/account\n- \"List all positions?\" -> GET /ccp/positions\n- \"List all orders?\" -> GET /ccp/orders\n- \"Create a order?\" -> POST /ccp/order\n- \"List all trades?\" -> GET /ccp/trades\n- \"List all validate?\" -> GET /sso/validate\n- \"Create a scanner?\" -> POST /hmds/scanner\n- \"List all snapshot?\" -> GET /md/snapshot\n- \"Create a performance?\" -> POST /pa/performance\n- \"Create a summary?\" -> POST /pa/summary\n- \"Create a transaction?\" -> POST /pa/transactions\n- \"List all accounts?\" -> GET /portfolio/accounts\n- \"List all subaccounts?\" -> GET /portfolio/subaccounts\n- \"List all subaccounts2?\" -> GET /portfolio/subaccounts2\n- \"List all meta?\" -> GET /portfolio/{accountId}/meta\n- \"List all allocation?\" -> GET /portfolio/{accountId}/allocation\n- \"Create a allocation?\" -> POST /portfolio/allocation\n- \"Get position details?\" -> GET /portfolio/{accountId}/positions/{pageId}\n- \"Get position details?\" -> GET /portfolio/{accountId}/position/{conid}\n- \"Create a invalidate?\" -> POST /portfolio/{accountId}/positions/invalidate\n- \"List all summary?\" -> GET /portfolio/{accountId}/summary\n- \"List all ledger?\" -> GET /portfolio/{accountId}/ledger\n- \"Get position details?\" -> GET /portfolio/positions/{conid}\n- \"Create a status?\" -> POST /iserver/auth/status\n- \"Create a reauthenticate?\" -> POST /iserver/reauthenticate\n- \"List all trades?\" -> GET /iserver/account/trades\n- \"List all accounts?\" -> GET /iserver/accounts\n- \"Create a account?\" -> POST /iserver/account\n- \"Create a alert?\" -> POST /iserver/account/{accountId}/alert\n- \"List all alerts?\" -> GET /iserver/account/:accountId/alerts\n- \"Create a activate?\" -> POST /iserver/account/:accountId/alert/activate\n- \"List all :id?\" -> GET /iserver/account/alert/:id\n- \"List all mta?\" -> GET /iserver/account/mta\n- \"List all orders?\" -> GET /iserver/account/orders\n- \"Create a order?\" -> POST /iserver/account/{accountId}/order\n- \"Create a order?\" -> POST /iserver/account/{accountId}/orders\n- \"Create a whatif?\" -> POST /iserver/account/{accountId}/order/whatif\n- \"Create a whatif?\" -> POST /iserver/account/{accountId}/orders/whatif\n- \"Get status details?\" -> GET /iserver/account/order/status/{orderId}\n- \"Delete a order?\" -> DELETE /iserver/account/{accountId}/order/{orderId}\n- \"List all snapshot?\" -> GET /iserver/marketdata/snapshot\n- \"List all unsubscribe?\" -> GET /iserver/marketdata/{conid}/unsubscribe\n- \"List all unsubscribeall?\" -> GET /iserver/marketdata/unsubscribeall\n- \"List all history?\" -> GET /iserver/marketdata/history\n- \"List all info?\" -> GET /iserver/contract/{conid}/info\n- \"Create a search?\" -> POST /iserver/secdef/search\n- \"List all strikes?\" -> GET /iserver/secdef/strikes\n- \"List all info?\" -> GET /iserver/secdef/info\n- \"List all algos?\" -> GET /iserver/contract/{conid}/algos\n- \"Create a rule?\" -> POST /iserver/contract/rules\n- \"List all info-and-rules?\" -> GET /iserver/contract/{conid}/info-and-rules\n- \"List all params?\" -> GET /iserver/scanner/params\n- \"Create a run?\" -> POST /iserver/scanner/run\n- \"List all partitioned?\" -> GET /iserver/account/pnl/partitioned\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- List endpoints may support pagination; check for limit, offset, or cursor params\n- Create/update endpoints typically return the created/updated object\n\n## CLI\n\n```bash\n# Update this spec to the latest version\nnpx @lap-platform/lapsh get client-portal-web-api -o references/api-spec.lap\n\n# Search for related APIs\nnpx @lap-platform/lapsh search client-portal-web-api\n```\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Client Portal Web API\n@base http://localhost:5000/v1/api\n@version 1.0.0\n@endpoints 83\n@hint download_for_search\n@toc fyi(12), trsrv(4), ws(1), tickle(1), logout(1), ccp(10), hmds(2), sso(1), md(1), pa(3), portfolio(12), iserver(35)\n\n@group fyi\n@endpoint GET /fyi/unreadnumber\n@desc Get unread number of fyis. The HTTP method POST is also supported.\n@returns(200) An object\n\n@endpoint GET /fyi/settings\n@desc Get a list of subscriptions\n@returns(200) An array\n\n@endpoint POST /fyi/settings/{typecode}\n@desc Enable/Disable certain subscription\n@required {typecode: any # fyi code, body: map}\n@returns(200) 200 means successful\n\n@endpoint GET /fyi/disclaimer/{typecode}\n@desc Get disclaimer for a certain kind of fyi\n@required {typecode: any # fyi code, for example --M8, EA}\n@returns(200) receives the disclaimer message\n\n@endpoint PUT /fyi/disclaimer/{typecode}\n@desc Mark disclaimer read\n@required {typecode: any # fyi code, for example --M8, EA}\n@returns(200) 200 means successful\n\n@endpoint GET /fyi/deliveryoptions\n@desc Get delivery options\n@returns(200) An object\n\n@endpoint PUT /fyi/deliveryoptions/email\n@desc Enable/Disable email option\n@required {enabled: any # true/false}\n@returns(200) 200 means successful\n\n@endpoint POST /fyi/deliveryoptions/device\n@desc Enable/Disable device option\n@required {body: map # device info}\n@returns(200) 200 means successful\n\n@endpoint DELETE /fyi/deliveryoptions/{deviceId}\n@desc Delete a device\n@required {deviceId: any # device ID}\n@returns(200) 200 means successful\n\n@endpoint GET /fyi/notifications\n@desc Get a list of notifications\n@required {max: any # max number of fyis in response}\n@optional {exclude: any # if set, don't set include, include: any # if set, don't set exclude}\n@returns(200) An array\n\n@endpoint GET /fyi/notifications/more\n@desc Get more notifications based on a certain one\n@required {id: any # id of last notification in the list}\n@returns(200) An array\n\n@endpoint PUT /fyi/notifications/{notificationId}\n@desc Get a list of notifications\n@required {notificationId: any # mark a notification read}\n@returns(200) when 200 receives, it means successful\n\n@endgroup\n\n@group trsrv\n@endpoint POST /trsrv/secdef\n@desc Secdef by Conid\n@required {body: map # request body}\n@returns(200) returns an array of secdef info\n\n@endpoint GET /trsrv/secdef/schedule\n@desc Get trading schedule for symbol\n@required {assetClass: any # specify the asset class of the contract. Available values-- Stock: STK, Option: OPT, Future: FUT, Contract For Difference: CFD, Warrant: WAR, Forex: SWP, Mutual Fund: FND, Bond: BND, Inter-Commodity Spreads: ICS, symbol: any # Underlying Symbol for specified contract, for example 'AAPL' for US Stock - Apple Inc.}\n@optional {exchange: any # Native exchange for contract, for example 'NASDAQ' for US Stock - Apple Inc., exchangeFilter: any # Response only returns trading schedule for specified exchange}\n@returns(200) Returns an object\n\n@endpoint GET /trsrv/futures\n@desc Security Futures by Symbol\n@required {symbols: any # list of case-sensitive symbols separated by comma}\n@returns(200) returns an object with symbol and and array of its future contracts\n@errors {500: error while processing the request}\n\n@endpoint GET /trsrv/stocks\n@desc Security Stocks by Symbol\n@required {symbols: any # list of upper-sensitive symbols separated by comma}\n@returns(200) returns an object with symbols\n@errors {500: error while processing the request}\n\n@endgroup\n\n@group ws\n@endpoint POST /ws\n@desc Websocket Endpoint\n@returns(200) confirms session is open\n\n@endgroup\n\n@group tickle\n@endpoint POST /tickle\n@desc Ping the server to keep the session open\n@returns(200) confirms session is open\n\n@endgroup\n\n@group logout\n@endpoint POST /logout\n@desc Ends the current session\n@returns(200) returned status indicates if user is logged in\n\n@endgroup\n\n@group ccp\n@endpoint POST /ccp/auth/init\n@desc Start CCP Session\n@optional {compete: any # Allow competing CCP session to run, locale: any # Concatenate value for language and region, set to \"en_US\", mac: any # Local MAC Address, machineId: any # Local machine ID, username: any # Login user, set to dash \"-\"}\n@returns(200) Returns challenge for connection\n@errors {401: Access denied, 500: System error}\n\n@endgroup\n\n@group hmds\n@endpoint GET /hmds/history\n@desc Market Data History (Beta)\n@required {conid: any # contract id, period: any # Time period for history request.    * min: Minutes   * h: Hours   * d: Days   * w: Weeks   * m: Months   * y: Years}\n@optional {bar: any # Duration of time for each candlestick bar.   * min: Minutes   * h: Hours   * d: Days   * w: Weeks   * m: Months, outsideRth: any # For contracts that support it, will determine if history data includes outside of regular trading hours.}\n@returns(200) Valid result\n@errors {400: Bad request}\n\n@endgroup\n\n@group ccp\n@endpoint POST /ccp/auth/response\n@desc Complete CCP Session\n@optional {auth: map}\n@returns(200) Valid result\n@errors {401: Access denied, 500: System error}\n\n@endpoint GET /ccp/status\n@desc CCP Status\n@returns(200) Valid result\n@errors {401: Access denied, 500: System error}\n\n@endpoint GET /ccp/account\n@desc Brokerage Accounts\n@returns(200) An array of accounts\n\n@endpoint GET /ccp/positions\n@desc Positions\n@returns(200) Valid result\n@errors {401: Access denied, 500: System error}\n\n@endpoint GET /ccp/orders\n@desc Order Status\n@required {acct: any # User Account}\n@optional {cancelled: any # Return only Rejected or Cancelled orders since today midnight}\n@returns(200) An Object\n@errors {400: Bad request, 401: Access denied, 500: System error}\n\n@endpoint POST /ccp/order\n@desc Submit Order\n@required {acct: any # User Account, conid: any # Contract identifier from IBKR's database., ccy: any # Contract Currency, exchange: any # Exchange, qty: any # Order Quantity}\n@optional {type: any # Order Price; required if order type is limit, side: any # Side, price: any # Order Price; required if order type is limit, tif: any # Time in Force}\n@returns(200) An Object\n@errors {400: Bad Request, 401: Access denied, 500: System error, for example when connection to CCP failed}\n\n@endpoint DELETE /ccp/order\n@desc Delete Order\n@required {acct: any # Account Number, id: any # Order Identifier of original submit order}\n@returns(200) An Object\n@errors {401: Access denied, 500: System error, for example when connection to CCP failed}\n\n@endpoint PUT /ccp/order\n@desc Update Order\n@required {acct: any # User Account, id: any # Order ID to be modified}\n@returns(200) An Object\n@errors {401: Access denied, 500: System error, for example when connection to CCP failed}\n\n@endpoint GET /ccp/trades\n@desc Trades\n@optional {from: any # From Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..), to: any # To Date (YYYYMMDD-HH:mm:ss) or offset (-1,-2,-3..). To value should be bigger than from value.}\n@returns(200) An Object\n@errors {400: Bad request, 401: Access denied, 500: System error}\n\n@endgroup\n\n@group sso\n@endpoint GET /sso/validate\n@desc Validate SSO\n@returns(200) An Object\n@errors {401: Authentication failed, 500: System failed}\n\n@endgroup\n\n@group hmds\n@endpoint POST /hmds/scanner\n@desc Run Scanner (Beta)\n@required {body: map # request body}\n@returns(200) Valid result\n@errors {400: Bad request}\n\n@endgroup\n\n@group md\n@endpoint GET /md/snapshot\n@desc Market Data Snapshot (Beta)\n@required {conids: any # List of conids comma separated. Optional exchange and instrument type can be specified.   * conid: IBKR Contract Identifier   * exchange: Exchange or venue   * instrType: Instrument Type supported values: CS (Stocks), OPT (Options), FUT (Futures), FOP (Future Options), WAR (Warrants), BOND (Bonds), FUND (Mutual Funds), CASH (Forex), CFD (Contract for difference), IND (Index)}\n@optional {fields: any # list of fields separated by comma}\n@returns(200) An Object\n@errors {401: Authentication failed, 500: System failed}\n\n@endgroup\n\n@group pa\n@endpoint POST /pa/performance\n@desc Account Performance\n@required {body: map # an array of account ids}\n@returns(200) returns an object\n\n@endpoint POST /pa/summary\n@desc Account Balance's Summary (Deprecated)\n@required {body: map # an array of account ids}\n@returns(200) returns an object\n\n@endpoint POST /pa/transactions\n@desc Position's Transaction History\n@required {body: map}\n@returns(200) returns an object\n\n@endgroup\n\n@group portfolio\n@endpoint GET /portfolio/accounts\n@desc Portfolio Accounts\n@returns(200) An array\n\n@endpoint GET /portfolio/subaccounts\n@desc List of Sub-Accounts\n@returns(200) An array\n\n@endpoint GET /portfolio/subaccounts2\n@desc List of Sub-Accounts (Large Accounts)\n@required {page: any}\n@returns(200) An object containing an array\n\n@endpoint GET /portfolio/{accountId}/meta\n@desc Account Information\n@required {accountId: any # account id}\n@returns(200) An object\n\n@endpoint GET /portfolio/{accountId}/allocation\n@desc Account Allocation\n@required {accountId: any # account id}\n@returns(200) returns an object of three different allocations\n\n@endpoint POST /portfolio/allocation\n@desc Account Alloction (All Accounts)\n@required {body: map # accounts info}\n@returns(200) returns an object of three different allocations\n\n@endpoint GET /portfolio/{accountId}/positions/{pageId}\n@desc Portfolio Positions\n@required {accountId: any # account id, pageId: any # page id}\n@optional {model: any # optional, sort: any # declare the table to be sorted by which column, direction: any # in which order, a means ascending - d means descending, period: any # period for pnl column, can be 1D, 7D, 1M...}\n@returns(200) returns a list of positions in the portfolio\n\n@endpoint GET /portfolio/{accountId}/position/{conid}\n@desc Position by Conid\n@required {accountId: any # account id, conid: any # contract id}\n@returns(200) returns a list containing only one position for the conid\n\n@endpoint POST /portfolio/{accountId}/positions/invalidate\n@desc Invalidates the backend cache of the Portfolio\n@required {accountId: any # account id}\n@returns(200) Means successful\n\n@endpoint GET /portfolio/{accountId}/summary\n@desc Account Summary\n@required {accountId: any # account id}\n@returns(200) returns an object containing account summary. The object contains multiple properties. A property is sufficed with -c if its provides commodity value, -s if it provides security value and -c if its UKL segment value\n\n@endpoint GET /portfolio/{accountId}/ledger\n@desc Account Ledger\n@required {accountId: any # account id}\n@returns(200) 200 means successful\n\n@endpoint GET /portfolio/positions/{conid}\n@desc Positions by Conid\n@required {conid: any # contract id}\n@returns(200) returns an object containing account and its position information\n\n@endgroup\n\n@group iserver\n@endpoint POST /iserver/auth/status\n@desc Authentication Status\n@returns(200) Authentication Status\n\n@endpoint POST /iserver/reauthenticate\n@desc Tries to re-authenticate to Brokerage\n@returns(200) Authentication Status\n\n@endpoint GET /iserver/account/trades\n@desc List of Trades for the selected account\n@returns(200) An array of trades\n\n@endpoint GET /iserver/accounts\n@desc Brokerage Accounts\n@returns(200) An array of accounts\n\n@endpoint POST /iserver/account\n@desc Switch Account\n@required {body: map # account id}\n@returns(200) an object containing updated account ID\n\n@endpoint POST /iserver/account/{accountId}/alert\n@desc Create or modify alert\n@required {accountId: any # account id, body: map # alert info}\n@returns(200) returns an object\n\n@endpoint GET /iserver/account/:accountId/alerts\n@desc Get a list of available alerts\n@required {accountId: any # account id}\n@returns(200) returns an array of objects\n\n@endpoint POST /iserver/account/:accountId/alert/activate\n@desc Activate or deactivate an alert\n@required {accountId: any # account id, body: map # order request info}\n@returns(200) returns an object\n\n@endpoint DELETE /iserver/account/:accountId/alert/:alertId\n@desc Delete an alert\n@required {accountId: any # account id, alertId: any # alert id}\n@returns(200) returns an object\n\n@endpoint GET /iserver/account/alert/:id\n@desc Get details of an alert\n@required {id: any # alert id}\n@returns(200) returns an object\n\n@endpoint GET /iserver/account/mta\n@desc Get MTA alert\n@returns(200) returns an object\n\n@endpoint GET /iserver/account/orders\n@desc Live Orders\n@optional {Filters: any # list of filters separated by comma}\n@returns(200) An object contains two arrays\n\n@endpoint POST /iserver/account/{accountId}/order\n@desc Place Order (Deprecated)\n@required {accountId: any # account id, body: map # order request info}\n@returns(200) returns an array\n\n@endpoint POST /iserver/account/{accountId}/orders\n@desc Place Orders\n@required {accountId: any # account id, body: map # order request info}\n@returns(200) returns an array\n\n@endpoint POST /iserver/account/orders/{faGroup}\n@desc Place Orders for FA\n@required {faGroup: any # financial advisor group, body: map # order request info}\n@returns(200) returns an array\n\n@endpoint POST /iserver/reply/{replyid}\n@desc Place Order Reply\n@required {replyid: any # Please use the \"id\" from the response of \"Place Order\" endpoint, body: map # Answer to question}\n@returns(200) Order is submitted successfully, returns an array contains one object\n@errors {400: When you send \"confirmed-false\" in the request, you will receive this}\n\n@endpoint POST /iserver/account/{accountId}/order/whatif\n@desc Preview Order (Deprecated)\n@required {accountId: any # account id, body: map # order info}\n@returns(200) returns an object\n\n@endpoint POST /iserver/account/{accountId}/orders/whatif\n@desc Preview Orders\n@required {accountId: any # account id, body: map # order info}\n@returns(200) returns an object\n\n@endpoint GET /iserver/account/order/status/{orderId}\n@desc Order Status\n@required {orderId: any # Customer order id, use /iservers/account/orders endpoint to query orderId.}\n@returns(200) returns an object\n\n@endpoint POST /iserver/account/{accountId}/order/{orderId}\n@desc Modify Order\n@required {accountId: any # account id, or fa group if modifying a group order, orderId: any # Customer order id, use /iservers/account/orders endpoint to query orderId., body: map # modify-order request}\n@returns(200) returns an array\n\n@endpoint DELETE /iserver/account/{accountId}/order/{orderId}\n@desc Cancel Order\n@required {accountId: any # account id, or fa group if deleting a group order, orderId: any # Customer order id, use /iservers/account/orders endpoint to query orderId.}\n@returns(200) returns an object with order id, message, conid and account id\n\n@endpoint GET /iserver/marketdata/snapshot\n@desc Market Data\n@required {conids: any # list of conids separated by comma}\n@optional {since: any # time period since which updates are required. uses epoch time with milliseconds., fields: any # list of fields separated by comma}\n@returns(200) Returns an array of objects\n@errors {400: sent when accounts are not queried before sending this request}\n\n@endpoint GET /iserver/marketdata/{conid}/unsubscribe\n@desc Market Data Cancel (Single)\n@required {conid: any # contract id}\n@returns(200) confirms market data for conid is cancelled\n@errors {500: cancel failed}\n\n@endpoint GET /iserver/marketdata/unsubscribeall\n@desc Market Data Cancel (All)\n@returns(200) confirms market data is cancelled\n\n@endpoint GET /iserver/marketdata/history\n@desc Market Data History\n@required {conid: any # contract id, period: any # available time period-- {1-30}min, {1-8}h, {1-1000}d, {1-792}w, {1-182}m, {1-15}y}\n@optional {exchange: any # Exchange of the conid (e.g. ISLAND, NYSE, etc.). Default value is empty which corresponds to primary exchange of the conid., bar: any # possible value-- 1min, 2min, 3min, 5min, 10min, 15min, 30min, 1h, 2h, 3h, 4h, 8h, 1d, 1w, 1m, outsideRth: any # For contracts that support it, will determine if historical data includes outside of regular trading hours.}\n@returns(200) Returns an object\n@errors {429: Too many requests, 500: System Error}\n\n@endpoint GET /iserver/contract/{conid}/info\n@desc Contract Details\n@required {conid: any # contract id}\n@returns(200) returns an object\n\n@endpoint POST /iserver/secdef/search\n@desc Search by Symbol or Name\n@required {symbol: map # Symbol or Company Name to be searched}\n@returns(200) returns an array of results\n@errors {500: error while processing the request}\n\n@endpoint GET /iserver/secdef/strikes\n@desc Search Strikes\n@required {conid: any # contract id of the underlying contract, sectype: any # OPT/WAR, month: any # contract month}\n@optional {exchange: any # optional, default is SMART}\n@returns(200) returns an object contains call/put strike prices\n@errors {500: error while processing the request}\n\n@endpoint GET /iserver/secdef/info\n@desc Secdef Info\n@required {conid: any # underlying contract id, sectype: any # FUT/OPT/WAR/CASH/CFD}\n@optional {month: any # contract month, only required for FUT/OPT/WAR in the format MMMYY, example JAN00, exchange: any # optional, default is SMART, strike: any # optional, only required for OPT/WAR, right: any # C for call, P for put}\n@returns(200) returns an array of objects\n@errors {500: error while processing the request}\n\n@endpoint GET /iserver/contract/{conid}/algos\n@desc IB Algo Params\n@required {conid: any # IBKR contract identifier}\n@optional {algos: any # List of algo ids delimited by \";\" to filter by. Max of 8 algos ids can be specified., addDescription: any # Whether or not to add algo descriptions to response. Set to 1 for yes, 0 for no., addParams: any # Whether or not to show algo parameters.  Set to 1 for yes, 0 for no.}\n@returns(200) returns an array of algos\n\n@endpoint POST /iserver/contract/rules\n@desc Contract Rules\n@required {conid: map}\n@returns(200) returns an array\n\n@endpoint GET /iserver/contract/{conid}/info-and-rules\n@desc Info and Rules\n@required {conid: any # IBKR contract identifier, isBuy: any # Side of the market rules apply too. Set to **true** for Buy Orders, set to **false** for Sell Orders}\n@returns(200) returns an array\n\n@endpoint GET /iserver/scanner/params\n@desc Scanner Parameters\n@returns(200) An object contains lists\n\n@endpoint POST /iserver/scanner/run\n@desc Scanner Run\n@required {body: map # scanner-params request}\n@returns(200) returns an array\n\n@endpoint GET /iserver/account/pnl/partitioned\n@desc PnL for the selected account\n@returns(200) An object containing account and model(s) pnl\n\n@endgroup\n\n@end\n"}}