Programmatic Access to Create Personal Access Tokens / API Tokens

Hi there

I’ve trawled through the REST API doc but can’t find anything.

Does anyone know if there’s an API or even a 3rd party add-on that would allow us to programmatically create an API token or personal access token for our users, please?

Thanks,

Paul

@PaulSorauer,

I confirm there is not an API for generating API tokens. However, OAuth allows users to authorize an app without going through the effort of manually creating API tokens. Could OAuth work for your scenario?

1 Like

Hello,
I have the same doubt.
With OAuth, can I get the token programmatically instead of going to the frontend to get the token to configure in the application?
In short, is there any way to get the token through a line of code?

Thanks
Jorge

Welcome to the Atlassian developer community @JorgeDavid,

Yes. That’s a pretty good summary of what OAuth does. The one caveat is that OAuth tokens are not like the API tokens in that they use a different Authorization header than basic. In other words, they are both tokens but they are different.