Retrieve file commit history with stash rest api

I use the stash rest api a lot with our server instance of Bitbucket v6.4.0. What I’m being asked to do now is, for a specified branch, retrieve the commit history for file(s) to determine the most recent commit a file was included in. I can’t seem to locate anything like this at https://docs.atlassian.com/DAC/rest/stash/3.11.3/stash-rest.html

In short I expect to supply the filename as a parameter and get back a list of commit objects.

Is there a way to do this?

I figured it out. It was basically http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits
with a path and until.
Like happens so often, I figured this out observing network calls while using the stash UI.

this seems to list all commits to the repo, but is there a way to see all commits for a specific file?

1 Like

@drewkeenan, use the following: https://{stashUrl}/rest/api/latest/projects/{projectId}/repos/{repositoryId}/commits?path={filePath}