You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have an access token with all permission, however, I cannot merge a pull request via REST API with this token. The error prompt is as follows.
> Merging a pull request requires write access to the destination branch
The REST API totally follows the official documents.
In addition, I have verified my repo's branch restriction which is no any rule.
Hi @CT Wu and welcome to the community!
Could you please provide the following info, so we can better help you?
1) Is this a PR between two branches in the same repo? Or is it a PR from a forked repo to the parent of the fork?
2) What kind of token are you using?
Hi @CT Wu,
Thank you for the info. There was a bug preventing a merge via API using a repository access token, we had a public bug report about this here:
The bug was fixed a few hours ago.
Could you please try running the API call again now and let me know if it works?
Hi @Theodora Boudale ,
I'm facing the exact same issue.
I'm trying to hit the following curl:
curl --location --request POST 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repo>/pullrequests/1493/merge' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
I have created the access_token from Repository settings > Access tokens for this repo, on Bitbucket Cloud website. All the permissions are checked except Delete repo.
I'm getting the following error response:
I will reply to the other post you created here: