Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

API doesn't work for me

Vasile Purdila
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2025

Hi,

I've created an API token with the following scopes:

Read

read:account
read:me
read:repository:bitbucket
read:pullrequest:bitbucket
read:project:bitbucket
read:pipeline:bitbucket
read:permission:bitbucket
read:package:bitbucket
read:issue:bitbucket
read:gpg-key:bitbucket

 

And trying to access this endpoint:

curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/mycompany/myrepo/pullrequests/742/diff' \
--header 'Authorization: Bearer XXX'

 

I'm getting this error:

{"type": "error", "error": {"message": "Token is invalid, expired, or not supported for this endpoint."}}

 

Any idea what might be wrong?

Thanks.

1 answer

1 vote
Charlie Misonne
Community Champion
November 14, 2025

Hi Vaslie?

I'm assuming you are not using the OAuth2 flow here?

On Using API tokens | Bitbucket Cloud | Atlassian Support you can find an example on how to authenticate for API calls using a token.

You should use the combination of username and token instead of using a token only.

  1. Encode <email>:<token> combination as base64
  2. Use this header:
    "Authorization: Basic <base64 string>"

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events