If you can manually create this "multi-leg" order in TWS, there is a good chance you can do it via the API.
In short, you are looking for a special kind of order type that will be run at IB. If you look at the order types supported by IB on their website I don't think this is one of them - but you knew that already. I haven't checked myself, just going from memory.
So, to answer your question, I believe the answer is no.
You could set up this arrangement by the API though but it would necessarily mean being connected all of the time to listen for when the first order gets filled i.e you can't leave the contingent order at the broker to be automatically triggered by the fill on the first order - it has to be triggered client-side via the API or TWS.