Example for defining PATH to single file with LAST-MODIFIED GET call?



This should be so straightforward, but having a hard time determining how to define the path to one file in the root directory that I want to pull the last commit from. The only hit I can get is for everything from the branch - which I don’t want …

i.e. last-modified?at=

Any help would be greatly appreciated!


The rest docs show that you need to do a GET request to https://{bitbucket_url}/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}?at={commitId}

If you were trying to get the path for a file called README.md in the root of your git repository, then the url would be:

If you were trying to get the file some_folder/some_file then the URL would be:

Hope that helps,


Thanks for replying Kristy. Does it have to have a commit id? That is the info i’m trying to pull from this call in the first place, so confused by that. I still can’t get a hit even with the valid commit id on this file. Still only able to retrieve everything from the branch with the call above last-modified?at=myBranch

I’m able to successfully use the browse GET and PUT to update a file, but that of course requires a commit id.


I ended up just pulling all files from the root level and parsed for the one I need.


I believe that you can use a ref (i.e. branch or tag) for the at field too.
If it’s still not working, can you please provide an example of the request you’re making? Can you also please expand on what you’re trying to do?