Commit through REST API


I am developing an app based on Stash API, and I noticed that Bitbucket has this feature where you can edit a code or a document online and submit the commit directly to the repo. I want to add that feature in my application so I was wondering if we can do that through the Stash core API, any example will be helpful.


3 answers

There is, but it makes it on a branch, and pull request to merge in the online edit change.

Hi Rad,

There is no existing REST API that allows you to do this, but you have a couple of options:

  • Extract the API that the Stash Realtime Editor Plugin uses and deploy it to your Stash instance, then use it from your external app.
  • Use Git instead of the REST API. Either invoke native git from your app or something like libgit2 to clone the repository, commit and push back to Stash. 

If you take the second approach, you have the advantage of having a portable app that could work with Bitbucket and other hosting services too smile Hope this helps!




Thank you Larry,

I was actually not looking for a plugin but how to do this using the API, because my app is not part of stash, I am extracting code via api and display then using Codemirror instance, and I want to be able to commit back to stash on modification. basically same thing as this plugin but I would like to learn the process from the REST API point of view (and if this is possible) 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

27,615 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you