Does the TWS API allow IBKR ATS routing for orders?

Yes. To route an order to IBKRATS via the API, you need to set the IBApi::Contract::Exchange field to "IBKRATS" and IBApi::Order::NotHeld to True. 

Note: The order must have the NotHeld field set to True, or you may receive a rejection with the reason: "IBKRATS order must be a not-held". When IBKR ATS orders are submitted via TWS, this field is set automatically.

Find out more in the TWS API Users' Guide. 

Powered by IBot
Can I place orders over the weekend?
What does the message "Your account has a minimum of 15 orders working on either the buy or sell side for this particular contract" mean?
How do I send an order to IBKR ATS?
Can I route orders to my existing broker from the IBKR OMS?