Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there any way to add label to pull request via rest api? Edited


I can add a comment to pull request using rest api like this

curl -u "username:password" -H 'Content-type: application/json' -X POST -d '{"text":"mycomment"}'

Is there anyway to add a label to pull request ?


1 answer

1 accepted

2 votes
Answer accepted
Daniel Eads Atlassian Team Dec 12, 2018

Hi Amulya,

Bitbucket Server doesn't currently have labels for pull requests. You can get them by using a plugin like the free Pull Request Labels one, but this doesn't provide an API endpoint.

We do have an open feature request to add pull request labels natively in Bitbucket Server. Presumably that would come with an API endpoint. If that's important to you, I suggest watching and voting on that issue!


Thank you Daniel for your reply. 

Any update from Bitbucket on this?

Daniel Eads Atlassian Team Dec 03, 2019

Hey @Sanjay Pant !

The suggestion ticket is still listed as gathering interest. For more information about how Atlassian prioritizes feature requests made on, check out this Community post. Keeping an eye on the ticket directly by watching it is the best way to stay up to date on the latest information. For your convenience in receiving this reply for email, here's a link to that feature request again:


Like Sanjay Pant likes this

If you use the Free Pull Request Labels by Reconquest there is a rest endpoint you just need to do a little digging to work it out (I couldn't find anything in the docs), here is what I've managed to work out;


To Read Labels

Method: GET


Authorization: Bearer XYZ

URL: http://<insert_host>/rest/io.reconquest.bitbucket.labels/1.0/<insert_project>/<insert_repo>/pull-requests/1

Response: { "labels": [ "TEST_LABEL" ] }


To Write Labels

Method: POST


Authorization: Bearer XYZ

X-Atlassian-Token: no-check

URL: http://<insert_host>/rest/io.reconquest.bitbucket.labels/1.0/<insert_project>/<insert_repo>/pull-requests/1

Post Data (x-www-form-urlencoded):


Response: { "success": true}


Hopefully useful... 

@Mark Bailie can you share how you are able to get these API? I'm trying to do a delete through the API as there is a UI bug for that add-on where the delete button is bled out/hidden to the side of the screen due to a very long label

@Azfar Masut I just took at look at what the UI was doing in the Web Inspector. I've had a very quick look at deletes and this is what I can see, fair warning though I've done absolutely no testing around this at all;


Method: DELETE


Authorization: Bearer XYZ




The HTTP response code then returns 200 for success. You'll probably need to play around with that to make it work, but it looks like it's the bones of what's needed :)

Like Azfar Masut likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...

121 views 0 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you