We had a related use case, were we needed to get the user login id from the JWT and pass it to the API.
We made a small change to the JWT plugin to do this.
Your use case should be kind of similar and if not maybe the code will help you anyway.
There is a down side to doing this. Because the plugin is not in a separate project, you have to fork and modify the main king project.