Token is invalid or not supported for this endpoint when listing user pullrequests

I’m receiving an Unauthorized error with message “Token is invalid or not supported for this endpoint” when I call the List pull requests for a user endpoint.

My token has all the scopes selected. Any idea what is happening?

Thanks

Hi @RubnOlivares,

Welcome to the Atlassian Developer Community!

The List pull requests for a user (/2.0/pullrequests/{selected_user}) does not support Access Tokens as authentication method. This is the case for all cross workspace end point.

The alternative that you could consider is to use an App password instead. I’ve tried it and can confirm it returns the pull requests.

Here is an example calling the endpoint with a curl and the app password as authentication method:

curl https://api.bitbucket.org/2.0/pullrequests/<username> \
    --user '<username>:<app-password>' \
    --header 'Content-Type: application/json' 

Thanks,
Caterina

2 Likes

Hi @ccurti,

You’re right, it does work that way. Many thanks for the help!

Cheers,
Rubén

Hi, im trying to download artifacts from the pipeline using API but im also getting Token is invalid or not supported for this endpoint even if i have assign admin privileges just for the test.
I’ve tried this approach as well but no luck… Am i missing something? Any help?@ccurti

@AleksandarLoncar and you are using App password as an authentication method?

In that case, try to reach out to customer support and they can help double-check what’s happening!