Issue #8672 open

Is there any API to make a commit? (BB-9954)

created an issue

Is there any API to make a commit? I mean some way to send a repo a diff using rest api to apply it on the top of some branch.

Comments (83)

  1. Marcus Bertrand [Atlassian] staff
    • changed status to open

    We've actually created one for online editing but it is undocumented. We'll keep this issue open for the day we will add this to the 2.0 API. You can discover how it works by watching the requests to the Online Editor. However, we will certainly change the behavior of this API and we wouldn't recommend using it at this time except for experimental purposes.

  2. Juha Kuitunen

    I'm speaking on behalf of Bitbeaker (open source Bitbucket client for Android). Every now and then users are requesting support for making a commit and it would be nice to someday be able to make that possible. So, big + to commit API! :)

  3. Marcus Zanona

    After some testing using the internal file editor as Marcus Bertrand [Atlassian] recommended, I got to this point which may help a few of you :)

    //JSON Request Payload:
        "branch": "master",
        "files": [
                "path": "",
                "content": "Instructions Here"
                "path": "",
                "content": "#New file here"
        "message": "Update README and File content",
        "parents": ["7b3f851d7864ba958656de64bbbc1e82ae1b49fd"],
        "repository": {"full_name": "user/repo"},
        "timestamp": "2014-11-19T09:20:05.338Z",
        "transient": false


    • branch field not declared creates a "None" branch
    • parents field requires only one commit_id
    • repository field doesn't seem to be necessary
    • timestamp field doesn't seem to be necessary
    • transient field omitted is the same as false, while true, creates a hidden branch (apparently with the name of the commit_id)

    I still missed a functionality where I can define the encoding type of a file like utf-8 or base64 so we can also add binaries or images. Hopefully this is something that is on their roadmap.

    The really great thing about this API which I think it should definitely stay when it is publicly released is possibility to add multiple files to a commit by having a files parameters as an array. On both Github or Gitlab, it is necessary through their API to do a lot of work before making this happen.

    So, awesome job there Bitbucket :D

  4. nhoughto

    the internal api won't work with OAuth style integration, meaning 3rd parties can't use it, even if they were willing to accept using an unsupported internal API..

    We are looking at this to allow an Integration for mock services on Sandbox, but won't work without OAuth! =(

  5. Chris Rose

    +1 for this, could use it in POEditor, would greatly simplify our workflow if we could have external tools update assets in a repository and use that to kick off a CI process

  6. Log in to comment