Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I am trying to follow the documentation on Personal Access Tokens. It tells me to go to Manage account > Account settings > Personal access tokens. However, when I visit Account settings, I see headers for: Account settings, Bitbucket profile settings, Preferences.
I have tried using App passwords, and I have tried creating API tokens through my Atlassian account. In both situations, I see the following error message despite having had just created each token:
> Access token expired. Use your refresh token to obtain a new access token.
I have tried using GrahamCampbell/Laravel-Bitbucket as well as Guzzle with Authorization header set to Bearer <ACCESS-TOKEN>. How can I make REST API requests with a Bitbucket personal access token?
Hey Morgan,
It sounds like you're using Bitbucket Cloud. The documentation you're looking at is for Bitbucket Server, our self-hosted/on-premise code hosting solution. Bitbucket Server has a different focus, so some of its features work differently.
To make API requests to Bitbucket Cloud, you can either use your normal account password (if you're not using 2 factor authentication), or else use an App password.
The message you're receiving sounds like it's related to using OAuth, not using an app password. I would suggest manually querying the API using an app password to confirm that the app password is working, like so:
curl -u <your-username>:<your-app-password> https://api.bitbucket.org/2.0/repositories
This should return a paginated list of public repositories, which will confirm the app password is working.
Assuming this works I'd suggest going to the vendor of whatever tool you're using that produces the access token error, as it sounds like an OAuth issue unrelated to generating app passwords that may be related to the third party tool itself.
Cheers,
Dave
Thanks! App passwords work great for my use case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.