Using Istio to migrate between applications

I’ve been researching various reverse proxy/API gateway/service mesh tools to find something that would aid the migration between two versions of an API.

Customers will be migrated one-by-one so the first requirement is that I’m able to route to the correct backend based on the customer’s API key. Ideally this would be an external service call (since keys can be refreshed/rotated) that can be cached for some period of time in Istio.

The second requirement is that should a customer be migrated, if they receive a 404 from the new application I would like to reissue the same request to the other backend. I had a look at the various retry/circuit breaker options in Istio but couldn’t see any way to do dynamic routing on a per request basis, based on a HTTP response code.

Can anyone confirm if Istio supports these two features?