### GET /ws
Source: https://api.ibkr.com/gw/api/v3/api-docs
Open websocket.
```markdown
### Parameters
- **Connection** (string (Upgrade), header, required)
- **Upgrade** (string (websocket), header, required)
- **api** (string, cookie, required): 32-character Web API session cookie value. (example: "c8fh17fnjr01hfnrh39rhfh8shd1hd93")
- **oauth_token** (string, query, required): 8-character OAuth access token. (example: "a1b2c3d4")
### Responses
#### 101 - Successful request to switch protocols.
Successful request to switch protocols.
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/ws?oauth_token=a1b2c3d4"
```
```
--------------------------------
### GET /fyi/notifications
Source: https://api.ibkr.com/gw/api/v3/api-docs
Get a list of available notifications.
```markdown
### Parameters
- **max** (integer (int32), query, required) (example: 10)
- **include** (unknown, query, optional)
- **exclude** (unknown, query, optional)
- **id** (unknown, query, optional)
### Responses
#### 200 - Successfully enabled or disabled your email notifications.
**notifications**
- Array of object
- **R** (string): Return if the notification was read or not. Value Format: 0: Disabled; 1: Enabled.
- **D** (string): Notification date as an epoch string.
- **MS** (string): Title of notification.
- **MD** (string): Content of notification.
- **ID** (string): Unique way to reference the notification.
- **HT** (integer (int32)): HT (example: 0)
- **FC** (string): FYI code, we can use it to find whether the disclaimer is accepted or not in settings
#### 400 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
#### 401 - response
#### 500 - response
**errorOnlyResponse**
- **error** (string): error reason
#### 503 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/fyi/notifications?max=10&include=value&exclude=value&id=value"
```
```
--------------------------------
### GET /gw/api/v1/client-instructions/{clientInstructionId}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Retrieve status of request by clientInstructionId.
**Scope**: `instructions.read`
**Security Policy**: `HTTPS`
```markdown
### Parameters
- **client-id** (string, path, required): The client's clientId (example: "abc123")
- **clientInstructionId** (integer (int32), path, required): The target instruction id. (example: -1988905739)
### Responses
#### 200 - Returns the status of an instruction.
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|REJECTED|PROCESSED)) (required) (example: "PENDING") ("PENDING"|"REJECTED"|"PROCESSED")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
- **error** (object)
- **errorCode** (string) (required)
- **errorMessage** (string) (required)
#### 208 - Client tried to reuse the same instructionId for more than one transaction. Returning the status for the first registered transaction under given instructionId (when there were no duplicates yet). Reconcile based on instructionSetId
**InstructionResponse**
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 404 - Returns a Problem detail instance representing a not found request.
**NoSuchInstructionResponse**
- **type** (string) (required) (example: "/simple")
- **title** (string) (required) (example: "Not found")
- **status** (integer (int32)) (required) (example: 404)
- **detail** (string) (example: "No such instruction found")
#### 500 - Unable to process request due to an Internal Error. Please try again later.
**InternalServerErrorResponse**
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/gw/api/v1/client-instructions/{clientInstructionId}"
```
```
--------------------------------
### GET /gw/api/v1/instruction-sets/{instructionSetId}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Retrieve status of all requests associated with instructionSetId.
**Scope**: `instructions.read`
**Security Policy**: `HTTPS`
```markdown
### Parameters
- **client-id** (string, path, required): The client's clientId (example: "abc123")
- **instructionSetId** (integer (int32), path, required): The target instruction set id. (example: -1988905739)
### Responses
#### 200 - Returns the status multiple instructions.
**BulkMultiStatusResponse**
- **status** (integer (int32)) (required) (example: 207)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResults** (array)
#### 404 - Returns a Problem detail instance representing a not found request.
**NoSuchInstructionSetResponse**
- **type** (string) (required) (example: "/simple")
- **title** (string) (required) (example: "Not found")
- **status** (integer (int32)) (required) (example: 404)
- **detail** (string) (example: "No such instruction set found")
- **instructionSetId** (integer (int32)) (required) (example: 8389943)
#### 500 - Unable to process request due to an Internal Error. Please try again later.
**InternalServerErrorResponse**
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/gw/api/v1/instruction-sets/{instructionSetId}"
```
```
--------------------------------
### GET /portfolio/{accountId}/positions/{pageId}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Get all positions in an account.
```markdown
### Parameters
- **accountId** (string, path, required) (example: "DU123456")
- **pageId** (integer (int32), path, required) (example: 1)
- **model** (unknown, query, optional)
- **sort** (unknown, query, optional) (example: "name")
- **direction** (unknown, query, optional) (example: "a")
- **waitForSecDef** (boolean, query, optional)
### Responses
#### 200 - positions
- Array of object
- **acctId** (string): IB accountId of an account with a position in the requested conid.
- **allExchanges** (string): Comma separated all exchanges on which the instrument trades.
- **assetClass** (string): Asset class of the requested instrument.
- **avgCost** (number): The account's average cost for its position.
- **avgPrice** (number): The account's average price for its position.
- **baseAvgCost** (number): Average cost in the account's base currency.
- **baseAvgPrice** (number): Average price in the account's base currency.
- **baseMktPrice** (number): Market price of instrument in the account's base currency.
- **baseMktValue** (number): Market value of the position in the account's base currency.
- **baseRealizedPnl** (number): Realized PnL for the instrument in the account's base currency.
- **baseUnrealizedPnl** (number): Unrealized PnL for the instrument in the account's base currency.
- **chineseName** (string): Chinese name of the instrument.
- **conExchMap** (array)
- **conid** (integer (int32)): IB contract ID for the instrument.
- **contractDesc** (string): Human-readable description of the instrument.
- **countryCode** (string): Country in which the instrument is issued.
- **currency** (string): Currency in which the instrument trades.
- **displayRule** (object): Object defining minimum increments used in displaying market data for the instrument.
- **displayRuleStep** (array (object)): Array containing objects corresponding to display rule increments.
Array items:
- **decimalDigits** (integer (int32)): Number of decimal digits to display.
- **lowerEdge** (number): Lower edge from which the display rule is effective.
- **wholeDigits** (integer (int32)): Number of integer digits to display.
- **magnification** (integer (int32)): Magnifier applied to pricing, if applicable.
- **exchs** (object)
- **exerciseStyle** (string): Style of exercise for options.
- **expiry** (string): Expiration of instrument, if applicable.
- **fullName** (string): Full display name of the instrument.
- **group** (string): Industry sub-categorization of the instrument.
- **hasOptions** (boolean): Indicates whether instrument has options contracts available for trading at IB.
- **incrementRules** (array (object)): Array containing increment rules used when pricing orders for the instrument.
Array items:
- **increment** (number): The pricing increment.
- **lowerEdge** (number): Lower edge from which the price increment rule is effective.
- **isEventContract** (boolean): Indicates whether the instrument is an Event Contract.
- **isUS** (boolean): Indicates whether the instrument is issued in the US.
- **lastTradingDay** (string): Last day of trading in the instrument, if applicable. Formatted `YYYYMMDD`.
- **listingExchange** (string): The exchange on which the instrument is listed, or the primary exchange recognized by IB for the instrument.
- **mktPrice** (number): Current market price of the instrument, in the instrument's currency.
- **mktValue** (number): Current market value of the account's position in the instrument, in the instrument's currency.
- **model** (string): Name of the model portfolio in which the account is invested that contributes this position.
- **multiplier** (number): Instrument's multiplier, if applicable.
- **name** (string): Formal name of the entity or asset to which the instrument relates.
- **pageSize** (integer (int32)): Maximum number of accounts that can be returned in a single request.
- **position** (number): Size of position in units of instrument.
- **putOrCall** (string (P|C)): The right of an options contract, if applicable. ("P"|"C")
- **realizedPnl** (number): Realized PnL for the instrument in the instrument's currency.
- **sector** (string): Industry sector categorization of the instrument.
- **sectorGroup** (string): Industry sub-categorization of the instrument.
- **strike** (string): Strike price, if applicable. Returned as string.
- **ticker** (string): Symbol associated with the instrument.
- **time** (integer (int32)): Time taken to retrieve position data in milliseconds.
- **type** (string): Description of instrument, used to differentiate classes, if applicable.
- **undConid** (integer (int32)): Contract ID of underlying instrument, if applicable.
- **unrealizedPnl** (number): Unrealized PnL for the instrument in the account.
#### 400 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
#### 401 - response
#### 500 - response
**errorOnlyResponse**
- **error** (string): error reason
#### 503 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/portfolio/{accountId}/positions/{pageId}?model=value&sort=name&direction=a&waitForSecDef=true"
```
```
--------------------------------
### API Overview: IB REST API
Source: https://api.ibkr.com/gw/api/v3/api-docs
The IB REST API reference documentation
```yaml
# IB REST API
# Version: 2.23.0
The IB REST API reference documentation
# Base URL: https://api.ibkr.com
```
--------------------------------
### GET /portfolio/{accountId}/meta
Source: https://api.ibkr.com/gw/api/v3/api-docs
Get a single account's attributes and capabilities.
```markdown
### Parameters
- **accountId** (string, path, required) (example: "DU123456")
### Responses
#### 200 - An account's attributes
**accountAttributes**
- **PrepaidCrypto-P** (boolean): Indicates whether account has a prepaid crypto segment (Crypto Plus) with PAXOS.
- **PrepaidCrypto-Z** (boolean): Indicates whether account has a prepaid crypto segment (Crypto Plus) with ZEROHASH.
- **accountAlias** (string): User-defined alias assigned to the account for easy identification.
- **accountId** (string): Indicates the identifying number for the account.
- **accountStatus** (integer (int32)): Unix epoch timestamp of account opening.
- **accountTitle** (string): A name assigned to the account, typically the account holder name or business entity.
- **accountVan** (string): The account's virtual account number, or otherwise its IB accountId if no VAN is set.
- **acctCustType** (string): Identifies the type of client with which the account is associated, such as an individual or LLC.
- **brokerageAccess** (boolean): Indicates whether account can receive live orders (do not mix with paper trading).
- **businessType** (string (IB_SALES|IB_PROSERVE)): A descriptor of the nature of the account, reflecting the responsible group within IB. ("IB_SALES"|"IB_PROSERVE")
- **category** (string): Designated account category. Only used in non-standard account structures.
- **clearingStatus** (string (O|P|N|A|R|C)): Status of the account with respect to clearing at IB. O is open, P pending, N new, A abandoned, C closed, R rejected. ("O"|"P"|"N"|"A"|"R"|"C")
- **covestor** (boolean): Indicates a Covestor account.
- **currency** (string (USD)): Base currency of the account. ("USD")
- **desc** (string): Internal human-readable description of the account.
- **displayName** (string): Displayed name of the account in UI. Will reflect either the accountId or accountAlias, if set.
- **faClient** (boolean): Indicates that the account is managed by a financial advisor.
- **ibEntity** (string (IBLLC-US|IB-CAN|IB-UK|IB-IE)): IB business entity under which the account resides. ("IBLLC-US"|"IB-CAN"|"IB-UK"|"IB-IE")
- **id** (string): The account's IB accountId.
- **noClientTrading** (boolean): Indicates that trading by the client is disabled in the account.
- **parent** (object): Describes account relations in partitioned or multiplexed (segemented) account structures.
- **accountId** (string): Account ID of the parent account in a multiplex account structure.
- **isMChild** (boolean): Indicates that the given account is a multiplex child account.
- **isMParent** (boolean): Indicates that the given account is itself a multiplex parent account.
- **isMultiplex** (boolean): Indicates that the account is a multiplex account.
- **mmc** (array): Money manager client.
- **trackVirtualFXPortfolio** (boolean): Indicates that virtual forex positions are tracked in the account.
- **tradingType** (string (STKNOPT)): Internal identifier used by IB to reflect the trading permissions of the account. ("STKNOPT")
- **type** (string (DEMO)): Indicates whether the account exists in production, paper, or demo environments. ("DEMO")
#### 401 - response
#### 500 - response
**errorOnlyResponse**
- **error** (string): error reason
#### 503 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/portfolio/{accountId}/meta"
```
```
--------------------------------
### POST /gw/api/v1/instructions/query
Source: https://api.ibkr.com/gw/api/v3/api-docs
Query list of recent transactions (up to 30 days) based on accountId.
**Scope**: `instructions.read`
**Security Policy**: `Signed JWT`
```markdown
### Parameters
- **client-id** (string, path, required): The client's clientId (example: "abc123")
### Request Body
**Content-Type:** application/json
### Responses
#### 202 - Accepts request to create a new instruction asynchronously
**AsynchronousInstructionResponse**
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 400 - Returns a Problem detail instance representing a bad request.
**MissingRequiredParameterResponse**
- **type** (string) (required) (example: "/invalid-argument")
- **title** (string) (required) (example: "Bad Request")
- **status** (integer (int32)) (required) (example: 400)
- **invalidArguments** (array (object))
Array items:
- **field** (string) (required) (example: "accountId")
- **description** (string) (example: "Missing required parameter")
#### 403 - Returns a Problem detail instance representing a forbidden request.
**ForbiddenInstructionResponse**
- **type** (string) (required) (example: "/invalid-argument")
- **title** (string) (required) (example: "Bad Request")
- **status** (integer (int32)) (required) (example: 400)
- **detail** (string) (required) (example: "Input is not a JSON Object or doesn't contain all expected fields")
- **instructionSetId** (integer (int32)) (required) (example: 8389943)
- **instructionResult** (object) (required)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 422 - Returns a Problem detail instance representing a business error.
**BusinessRejectResponse**
#### 500 - Returns a Problem detail instance representing an internal server error.
**InternalServerErrorResponse**
### Example Usage
```bash
curl -X POST "https://api.ibkr.com/gw/api/v1/instructions/query" \
-H "Content-Type: application/json" \
-d '"value"'
```
```
--------------------------------
### GET /portfolio/{accountid}/position/{conid}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Get position for a given instrument in a single account.
```markdown
### Parameters
- **accountId** (string, path, required) (example: "DU123456")
- **conid** (integer (int32), path, required) (example: 265598)
### Responses
#### 200 - Position details by conid
**individualPositionArray**
- Array of object
- **acctId** (string): IB accountId of an account with a position in the requested conid.
- **allExchanges** (string): Comma separated all exchanges on which the instrument trades.
- **assetClass** (string): Asset class of the requested instrument.
- **avgCost** (number): The account's average cost for its position.
- **avgPrice** (number): The account's average price for its position.
- **baseAvgCost** (number): Average cost in the account's base currency.
- **baseAvgPrice** (number): Average price in the account's base currency.
- **baseMktPrice** (number): Market price of instrument in the account's base currency.
- **baseMktValue** (number): Market value of the position in the account's base currency.
- **baseRealizedPnl** (number): Realized PnL for the instrument in the account's base currency.
- **baseUnrealizedPnl** (number): Unrealized PnL for the instrument in the account's base currency.
- **chineseName** (string): Chinese name of the instrument.
- **conExchMap** (array)
- **conid** (integer (int32)): IB contract ID for the instrument.
- **contractDesc** (string): Human-readable description of the instrument.
- **countryCode** (string): Country in which the instrument is issued.
- **currency** (string): Currency in which the instrument trades.
- **displayRule** (object): Object defining minimum increments used in displaying market data for the instrument.
- **displayRuleStep** (array (object)): Array containing objects corresponding to display rule increments.
Array items:
- **decimalDigits** (integer (int32)): Number of decimal digits to display.
- **lowerEdge** (number): Lower edge from which the display rule is effective.
- **wholeDigits** (integer (int32)): Number of integer digits to display.
- **magnification** (integer (int32)): Magnifier applied to pricing, if applicable.
- **exchs** (object)
- **exerciseStyle** (string): Style of exercise for options.
- **expiry** (string): Expiration of instrument, if applicable.
- **fullName** (string): Full display name of the instrument.
- **group** (string): Industry sub-categorization of the instrument.
- **hasOptions** (boolean): Indicates whether instrument has options contracts available for trading at IB.
- **incrementRules** (array (object)): Array containing increment rules used when pricing orders for the instrument.
Array items:
- **increment** (number): The pricing increment.
- **lowerEdge** (number): Lower edge from which the price increment rule is effective.
- **isEventContract** (boolean): Indicates whether the instrument is an Event Contract.
- **isUS** (boolean): Indicates whether the instrument is issued in the US.
- **lastTradingDay** (string): Last day of trading in the instrument, if applicable. Formatted `YYYYMMDD`.
- **listingExchange** (string): The exchange on which the instrument is listed, or the primary exchange recognized by IB for the instrument.
- **mktPrice** (number): Current market price of the instrument, in the instrument's currency.
- **mktValue** (number): Current market value of the account's position in the instrument, in the instrument's currency.
- **model** (string): Name of the model portfolio in which the account is invested that contributes this position.
- **multiplier** (number): Instrument's multiplier, if applicable.
- **name** (string): Formal name of the entity or asset to which the instrument relates.
- **pageSize** (integer (int32)): Maximum number of accounts that can be returned in a single request.
- **position** (number): Size of position in units of instrument.
- **putOrCall** (string (P|C)): The right of an options contract, if applicable. ("P"|"C")
- **realizedPnl** (number): Realized PnL for the instrument in the instrument's currency.
- **sector** (string): Industry sector categorization of the instrument.
- **sectorGroup** (string): Industry sub-categorization of the instrument.
- **strike** (string): Strike price, if applicable. Returned as string.
- **ticker** (string): Symbol associated with the instrument.
- **time** (integer (int32)): Time taken to retrieve position data in milliseconds.
- **type** (string): Description of instrument, used to differentiate classes, if applicable.
- **undConid** (integer (int32)): Contract ID of underlying instrument, if applicable.
- **unrealizedPnl** (number): Unrealized PnL for the instrument in the account.
#### 400 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
#### 401 - response
#### 500 - response
**errorOnlyResponse**
- **error** (string): error reason
#### 503 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/portfolio/{accountid}/position/{conid}"
```
```
--------------------------------
### GET /portfolio/positions/{conid}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Get positions in accounts for a given instrument (no secDef await control)
```markdown
### Parameters
- **conid** (integer (int32), path, required) (example: 8314)
### Responses
#### 200 - Object containing positions in the requested conid broken out by account.
#### 400 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
#### 401 - response
#### 500 - response
**errorOnlyResponse**
- **error** (string): error reason
#### 503 - response
**errorResponse**
- **error** (string): error reason
- **statusCode** (string): mimic response status code
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/portfolio/positions/{conid}"
```
```
--------------------------------
### GET /gw/api/v1/instructions/{instructionId}
Source: https://api.ibkr.com/gw/api/v3/api-docs
Retrieve status of request by instructionId
**Scope**: `instructions.read`
**Security Policy**: `HTTPS`
```markdown
### Parameters
- **client-id** (string, path, required): The client's clientId (example: "abc123")
- **instructionId** (integer (int32), path, required): The target instruction id. (example: -1988905739)
### Responses
#### 200 - Returns the status of an instruction.
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|REJECTED|PROCESSED)) (required) (example: "PENDING") ("PENDING"|"REJECTED"|"PROCESSED")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
- **error** (object)
- **errorCode** (string) (required)
- **errorMessage** (string) (required)
#### 208 - Client tried to reuse the same instructionId for more than one transaction. Returning the status for the first registered transaction under given instructionId (when there were no duplicates yet). Reconcile based on instructionSetId
**InstructionResponse**
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 404 - Returns a Problem detail instance representing a not found request.
**NoSuchInstructionResponse**
- **type** (string) (required) (example: "/simple")
- **title** (string) (required) (example: "Not found")
- **status** (integer (int32)) (required) (example: 404)
- **detail** (string) (example: "No such instruction found")
#### 500 - Unable to process request due to an Internal Error. Please try again later.
**InternalServerErrorResponse**
### Example Usage
```bash
curl -X GET "https://api.ibkr.com/gw/api/v1/instructions/{instructionId}"
```
```
--------------------------------
### POST /gw/api/v1/bank-instructions/query
Source: https://api.ibkr.com/gw/api/v3/api-docs
View active bank instructions for an accountId.
**Scope**: `bank-instructions.read`
**Security Policy**: `Signed JWT`
```markdown
### Parameters
- **client-id** (string, path, required): The client's clientId (example: "abc123")
### Request Body
**Content-Type:** application/json
### Responses
#### 201 - Instruction successfully created and processed synchronously
- **status** (number) (required) (example: 202)
- **instructionSetId** (number) (required) (example: -1988905739)
- **instructionResult** (object)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 400 - Returns a Problem detail instance representing a bad request.
**MissingRequiredParameterResponse**
- **type** (string) (required) (example: "/invalid-argument")
- **title** (string) (required) (example: "Bad Request")
- **status** (integer (int32)) (required) (example: 400)
- **invalidArguments** (array (object))
Array items:
- **field** (string) (required) (example: "accountId")
- **description** (string) (example: "Missing required parameter")
#### 403 - Returns a Problem detail instance representing a forbidden request.
**ForbiddenInstructionResponse**
- **type** (string) (required) (example: "/invalid-argument")
- **title** (string) (required) (example: "Bad Request")
- **status** (integer (int32)) (required) (example: 400)
- **detail** (string) (required) (example: "Input is not a JSON Object or doesn't contain all expected fields")
- **instructionSetId** (integer (int32)) (required) (example: 8389943)
- **instructionResult** (object) (required)
- **clientInstructionId** (number) (required) (example: 1012983)
- **instructionType** (string (ACH_INSTRUCTION|CANCEL_INSTRUCTION|COMPLEX_ASSET_TRANSFER|DELETE_BANK_INSTRUCTION|DEPOSIT|DWAC|EXTERNAL_POSITION_TRANSFER|FOP|QUERY_RECENT_INSTRUCTIONS|QUERY_WITHDRAWABLE_FUNDS|INTERNAL_POSITION_TRANSFER|INTERNAL_CASH_TRANSFER|MICRO_AMOUNT|PREDEFINED_DESTINATION_INSTRUCTION|TRADITIONAL_BANK_INSTRUCTION_VERIFICATION|WITHDRAWAL|QUERY_IRA_CONTRIBUTIONS|EDDA_INSTRUCTION|QUERY_RECENT_RECURRING_EVENTS|QUERY_RECURRING_INSTRUCTIONS|QUERY_ACCOUNT_BALANCES|QUERY_BANK_INSTRUCTION|QUERY_WITHDRAWABLE_CASH_EQUITY)) (required) (example: "INTERNAL_CASH_TRANSFER") ("ACH_INSTRUCTION"|"CANCEL_INSTRUCTION"|"COMPLEX_ASSET_TRANSFER"|"DELETE_BANK_INSTRUCTION"|"DEPOSIT"|"DWAC"|"EXTERNAL_POSITION_TRANSFER"|"FOP"|"QUERY_RECENT_INSTRUCTIONS"|"QUERY_WITHDRAWABLE_FUNDS"|"INTERNAL_POSITION_TRANSFER"|"INTERNAL_CASH_TRANSFER"|"MICRO_AMOUNT"|"PREDEFINED_DESTINATION_INSTRUCTION"|"TRADITIONAL_BANK_INSTRUCTION_VERIFICATION"|"WITHDRAWAL"|"QUERY_IRA_CONTRIBUTIONS"|"EDDA_INSTRUCTION"|"QUERY_RECENT_RECURRING_EVENTS"|"QUERY_RECURRING_INSTRUCTIONS"|"QUERY_ACCOUNT_BALANCES"|"QUERY_BANK_INSTRUCTION"|"QUERY_WITHDRAWABLE_CASH_EQUITY")
- **instructionStatus** (string (PENDING|PROCESSED|REJECTED|PENDING_VERIFICATION)) (required) (example: "PENDING") ("PENDING"|"PROCESSED"|"REJECTED"|"PENDING_VERIFICATION")
- **instructionId** (number) (required) (example: 45123654)
- **ibReferenceId** (number) (example: 23456745)
- **description** (string) (example: "Please poll for status after 10 minutes")
#### 422 - Returns a Problem detail instance representing a business error.
**BusinessRejectResponse**
#### 500 - Returns a Problem detail instance representing an internal server error.
**InternalServerErrorResponse**
### Example Usage
```bash
curl -X POST "https://api.ibkr.com/gw/api/v1/bank-instructions/query" \
-H "Content-Type: application/json" \
-d '"value"'
```
```