Get developer profile from developer's API key to redirect request based on dev's org

I want to setup developer portal for 3rd parties and their request to my API will be routed based on the organization which is included in developer’s profile

For ex. dev1 from org_1 will be redirected to http://my.api/org_1/services/test
and dev2 from org_2 will be redirected to http://my.api/org_2/services/test

I use URL rewrite to change the target url to redirect user with their key meta-data to
but it does not work.

Can anyone help to tell me how to get developer organization in url rewrite?

I afraid that currently you can’t access nested field like this, only first level $tyk_meta variables are available.

As a workaround I may suggest adding key created event, which process key, and adds “Organization” object to root tyk_meta level. Or maybe in your case it is enough to manually go through keys.

Hope it helps!