
SamY.57083 (Customer) asked a question.
Is there any way to programmatically get an API token? The docs seem to indicate the Tokens endpoint is deprecated, but they only link to a page describing the manual way to get a token from the web UI. An initial manual step to get a token wouldn't be terrible, but there's no way to "rotate" tokens automatically (i.e. issue a new one to replace the old one). Just having a static, highly privileged token sitting around forever (even in some kind of secrets vault) makes me pretty uncomfortable.

It appears Okta are working on some OAuth based scoping permissions for their API's
Hello Sam,
At the moment, a public endpoint for generating API tokens is not something we support. Yet, I would see a way of doing this in a programmatic manner, but this will require for you to use the Okta UI and the browser console to obtain the information you need.
Also, in order for this to work, you will need to have an authenticated session, and the Token will inherit the permissions of the authenticated account.
Again, I must underline the fact that this is not something we support or will offer support on, but simply an idea of a workaround to the outcome you are trying to achieve.
Thank you,
Stefan Pescaru
Technical Support Engineer
Okta Global Customer Care