Authorizing to Dashboard REST Api

This is slight more of a follow up to Blacklisting JWT token - #3 by lmlynik

I know that going through the dashboard we can obtain the user key with which we can call the Dashboard REST Api. How can I get the secret or just authorise to the API without using a browser.

I need it both for the case which is in the aforementioned topic and I need to get information about policies in TYK so I can include said policy Ids in our tokens.