Changing request URL in middleware

I am trying to build a dynamic upstream response. I want to change the upstream call based on information in a key meta or the api config_data.

Question is can i do that in a Pre middleware hook, or virtual endpoint and can i change the destination of the call on the fly?

Hi Kariuki, thanks for your question.
Did you look at Tyk 2.8: Feel The Force - Tyk API Gateway ? Look under “looping”, that should solve your challenge, yes? more details in the release notes: Tyk Gateway v2.8