I don’t believe it’s an expired token issue because the login is successful, I make a few api calls for accounts, orders, positions, but when I try to liquidate I get a 401.
I did a quick test and if I set admin: true, then I get the same 401 error. Setting admin: false resolves the issue for me.
The issue is that even though it works, it never returns an orderId… so you cannot track the filled price to update the profit on the trade without extra effort.
PositionLog / fillPair will allow you to reconcile the profits based on the contractId