@Aleksandar Panchevski I believe you're able to acheive this using the PAT REST API. Please follow the steps in this documentation: Manage personal access tokens (PATs) using REST API
With the PAT Lifecycle Management API, you can easily manage the PATs associated with your organizations using automated processes. This rich set of APIs enables you to manage the PATs you own, allowing you to create new personal access tokens and renew or expire existing personal access tokens.
To use the API, you must authenticate with an Azure AD token. Learn more on how to do this in the following authentication section.
In order to do so, a few prerequisites must be met:
- You must have an Azure AD tenant with an active Azure subscription.
- Depending on your tenant's security policies, your application may need to be granted permissions to access resources in the organization. At this moment, the only way to proceed with using this app in this tenant is to ask an admin to grant permission to the app before you can use it.