How to check if a logged in user is a new user in bitbucket?

I am adding a feature to my plugin where I need to check if a user is a new user. For Jira and confluence, I am able to find the related API which are loginCount method of LoginInfo.java and getPreviousSuccessfulLoginDate method of HistoricalLoginInfo.java respectively. Similarly, I am not able to find any related API in the bitbucket to check if a user is a new user. Any pointers will really be helpful.

Try to use

com.atlassian.bitbucket.user.UserAdminService#getUserDetails(com.atlassian.bitbucket.user.ApplicationUser)

Docs