How to handle 301 Moved Permanently (Redirect URL in apigee from target server)

@Atanu Mazumdar , I am missing something here, Client → Target → Target Response → 301 Response Header → Client → Clinet does Redirect.

What you are saying is ,

Client → Target → Target Response → 301 Response Header → Make an API call to the redirect URL → Get Response → Send to client ? Is it what you are expecting ?

It should be simple, Just execute a service callout on condition if target response is 301 & grab the url from response headers. And then send response from service callout to client. It’s called mashup & it’s available out of the box. Refer here for flow variables, Refer here for conditional execution of policy, Refer here for service callout.