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 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 Copy the complete message and its request or order ID from the app log.
- 3 Identify whether the request concerns an order, contract, or data query.
- 4 Compare the named field with the matching TWS product or order ticket.
- 5 Correct only the field or combination described by the message. If the app generated it internally, give support the redacted request.
- 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.
Screen reference




Mistake to avoid
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.