I created an API key in Bitbucket as indicated in the Sourcetree documentation with scopes as indicated.
Then in Sourcetree I wanted to change my account (with existing username) over to API Token. I entered my correct e-mail below the dropdown and set my existing username in the dialog that follows. But then the API key is not recognized and error 'Failed to get user details, You do not have permission to access URL etc. request returns with status Unauthorized.
The only way to let the API token be accepted is when I set the username to my e-mail address. But then of course no repository actions will work anymore.
Removing old entries in Credential Manager (I am doing this on Windows) did not solve the problem.
How to solve this, now unable to use Sourcetree ;-[