What the connection does
Kontavio reads your Interactive Brokers (IBKR) account through the Flex Web Service. This is read-only access: Kontavio sees positions, cash and net liquidation value, but it cannot trade or move money.
Each sync takes over the current state of your account:
- Positions with quantity, cost basis and price from the Open Positions section
- Cash per currency from the Cash Report
- the net liquidation value (NAV). Interest and dividends IBKR has already accrued show up as their own line, "Accruals and other (IBKR)". That way the total matches the NAV at IBKR.
Positions in another currency, such as a US stock in USD, are converted into the portfolio currency at the rate IBKR itself uses. The price in the trading currency is shown in small print under the converted price.
What counts is the current state, not the history: positions that came to IBKR by a transfer show up just as correctly as ones you bought there.
Requirements
- Premium plan (portfolios are part of Premium)
- Access to the IBKR portal
Step 1: Create a Flex Query in IBKR
- Log in to the IBKR portal and open Performance & Reports → Flex Queries.
- Click + next to Activity Flex Query to create a new query. Give it a name, for example "Kontavio".
- Select these sections, each with Select All for the fields:
- Open Positions, with the option Summary
- Cash Report
- Net Asset Value (NAV) in Base
- Under Delivery Configuration, set the format to XML and the Period to Last Business Day.
- Under General Configuration, keep the date format yyyyMMdd.
- Save the query. The list now shows its Query ID, a number. You need it in a moment.
Several accounts at IBKR? Limit the query to the account that belongs to this portfolio. Kontavio refuses a query that covers several accounts.
Step 2: Generate a Flex token
- On the same page, open the Flex Web Service Configuration.
- Enable the Flex Web Service if it is still off.
- Generate a new token. Pick a long validity and leave the IP restriction empty. With an IP restriction, Kontavio cannot fetch the statement.
- Copy the token.
Treat the token like a password: whoever has it can read the statements of your Flex Queries. Enter it only in Kontavio, never in an email or a chat.
Step 3: Connect in Kontavio
- Open the portfolio and click Connect IBKR.
- Enter the Flex token and the Query ID. If the portfolio still lists another broker, leave "Set the broker of this portfolio to Interactive Brokers" ticked.
- Click Connect and check. IBKR now generates the statement, which takes up to 30 seconds.
- You see a preview with all positions, the cash and the total value.
- If the portfolio already has holdings you entered by hand, decide here what happens to them:
- Replace (recommended): the manual holdings are deleted and only IBKR's data counts.
- Keep: they stay and count as well. That only fits if they are not held at IBKR.
- Click Take over.
Kontavio stores the token encrypted and never shows it again.
After connecting
- Kontavio syncs the account automatically once a day. Sync now fetches the current state right away.
- Above the positions you see when the last sync ran and which day the prices are from. With "Last Business Day" that is the last trading day.
- Positions from IBKR carry the IBKR tag. Their prices come from the sync, and Refresh prices leaves them out.
- A value you enter by hand with Set value only lasts until the next sync.
- Holdings you add by hand after the first sync stay untouched by later syncs.
- The cost basis of positions in another currency is converted at the current rate, so gain and loss show the price movement without the currency effect.
Change or disconnect
- Change access: enter a new token or another query ID, for example when the token has expired.
- Disconnect: the token is deleted. The positions stay as of the last sync.
When something goes wrong
| Message | What to do |
|---|---|
| The Flex token has expired | Generate a new token in the IBKR portal and enter it via Change access. |
| IBKR does not know this token or query ID | Compare token and query ID with the IBKR portal. The query ID is digits only. |
| Token restricted to certain IP addresses | Remove the IP restriction from the token or generate a new token without one. |
| No "Open Positions" section | Edit the query and add Open Positions. |
| Legacy Flex Query | Create an Activity Flex Query (step 1). |
| Too many requests, or the statement was not ready in time | Wait a minute and sync again. |