The two header API function calls are perfectly possible to call at any time during a transfer, both from inside and outside of callbacks. It is however important to remember that the API will of course only return information about the state of the headers at the exact moment it is called, which might not be the final status if you call it while the transfer is still in progress.