I have API's that I need to call with a session token. It's similar to your issue, I do this with a workflow variable and just set it with a codeblock. If you know the variable name botpress autocode will generate the code just say workflow.authToken = responsejson.token
If you want it to persist with the user you can set it as a user variable it's just user instead of workflow.