Cancelling a super order through API

The documentation does not explicitly state which leg should be treated as the main leg.

The API docs mention:

“Note: Cancelling main order ID cancels all legs.”

However, it is unclear which leg should be passed as order-leg to cancel the entire order. Is the ENTRY_LEG considered the main leg?

Additionally, I would like clarification on partial fills:
If the order is partially filled and I cancel using the entry leg, will the trailing stop-loss / target / SL legs continue to function correctly for the remaining filled quantity?

Yes. ENTRY_LEG is the main leg. It is always recommended to have your internal (algo bot) checks (auto cancellation system of pending legs) as part of your RMS as multi-leg orders sometimes malfunction in the web interface itself, so there is no guarantee that it will work always.