What is the purpose of case 2? Why should that call go through API GW? Sure, the callback is related to a request that came through GW but the async response does not need to. – API GW isn’t responsible for managing access to that external client.
If you really want this to go through the GW, you’ll want to keep the original host somewhere in the modified URL as a parameter (encoded). And when the application makes the call to GW, the GW uses that parameter to forward the call.
Lots of security things to be concerned about there, so be careful.
[Edit] API GW supports this directly, so no need to do any custom wrapping/replacement of the callbackUrl (a conventional name defined by OpenAPI). Personally, I still wouldn’t do this. I understand that some may see value in tracking the callback but at this point, I don’t see a compelling case for it.
#API-Gateway#API-Management#webMethods