Create app password via API route

Hi,

is there any possibility to create app password via API? I can do it manually through user settings, security and manually generate a token. It’s impractical when we generate the user automatically. We would like the user to also generate a QR code automatically and just scan the code in our system without having to enter a name and password.