Error messages

TWS error 321: request validation failed

Quick answer

Error 321 means a request did not pass validation. Read the accompanying text to find the field involved. Check the actual sent request rather than guessing from the number alone.

Educational software guidance. Trading involves risk. Read the financial and information disclaimers.

Step by step

  1. 1 Save the full app message first. To check a recorded TWS API log, open Help → Troubleshooting → Diagnostics → API Logs. Select its date and choose View Logs. If the list is empty, enable API logging before the next event.
  2. 2 Copy the complete message and its request or order ID from the app log.
  3. 3 Identify whether the request concerns an order, contract, or data query.
  4. 4 Compare the named field with the matching TWS product or order ticket.
  5. 5 Correct only the field or combination described by the message. If the app generated it internally, give support the redacted request.
  6. 6 Try the corrected request in a controlled paper workflow and check the next response.

A practical example

Suppose a data request leaves out a date field and the error names that field. This is a clue about the request, not proof of a bad network. Keep the full text and the request ID together. An order at the same time may have its own ID and a different result. Match the message to the action before you try to fix it.

Illustrative scenario, not a record of a trade placed during this review.

Screen reference

TWS View Logs dialog with View Logs, Export Logs and Export Today Logs buttons
This session has no recorded API logs in the list, so export buttons are disabled. Enable API logging before the event you need to capture. No log was exported or uploaded for this screenshot. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
Help, Troubleshooting, Diagnostics menu leading to API Logs
In this build, follow Help → Troubleshooting → Diagnostics → API Logs. Upload Diagnostics is a different action. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
TWS Market Data Connections with farm purpose and status, plus API client columns
The observed services are connected and the API client list is empty. Use this panel to read current status; it does not reproduce a disconnect or prove an app handshake completed. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
TWS stock Description showing SMART route, NASDAQ primary exchange, currency, contract ID, minimum tick and frozen data status
This stock is an example of the fields to compare. SMART routing and Primary Exchange are separate fields. The observed feed is Frozen and the market is closed; this is not a live-price or trading recommendation. Captured in TWS paper mode on 3 October 2026. Open the image for full size.
How to confirm the result The named validation failure should disappear without introducing a different product or order instruction.

Mistake to avoid

A 321 on a data request does not prove that an order was rejected. Match the request ID to the action.

Common questions

Can I fix 321 by changing the port?

Only a connection issue belongs to port troubleshooting; validation means the request reached a validation stage.

What should I send support?

The full message, request type, ID, contract, and time, without tokens or passwords.

Financial and information disclaimers

Financial disclaimer

These guides explain software. They are for education, not financial, investment, tax, or legal advice. No example is a suggestion to buy or sell a product or use a trading strategy. Trading can lose money, including all funds you put at risk. With margin, futures, short sales, or some options, losses can exceed your starting funds. Automation can fail, send duplicate orders, or act late. Stops do not guarantee a fill or a price. Review your orders and positions, and seek advice from a qualified professional for your own needs. Paper trades, examples, and past results do not predict live results or promise a profit.

Information disclaimer

This is general help based on the sources and check date shown on the page. Screens, settings, fees, data access, and product support can change or differ by app version, account, country, and broker. The content may contain errors or become out of date; accuracy, completeness, and continuous service are not guaranteed. Check current broker and app instructions before acting. Screenshots show where controls are; they do not prove that an order test passed. This guide does not replace broker terms or risk notices. References to IBKR and TradingView identify their products and do not imply their endorsement of this guide.

IBKR risk disclosures · IBKR paper-trading limits · SEC guidance on automated investment tools

PickMyTrade help · Independent guidance for Trader Workstation and the desktop integration. TWS images show paper trading. Other applications are named in the image captions. Settings and availability can vary by version and account.

Automate TradingView alerts to Interactive Brokers

See the IBKR integration