/api/repos/{user}/{repo}/builds/latest doesn't return expected results

I notice that /api/repos/{user}/{repo}/builds returns all builds for that repo, regardless of branch (as long as the branch is a target in .drone.yml, of course).

However, when I attempt to get the latest build via /api/repos/{user}/{repo}/builds/latest, I notice that the API returns the latest build from master no matter what.

I deduced that I can add a branch query parameter, but shouldn’t /api/repos/{user}/{repo}/builds/latest return the latest build, regardless of which branch it was on?

the endpoint returns the latest build for the default branch (similar to how badges work) and is therefore behaving as designed.

Got it; thanks for the clarification. Is there a way to do what I’m asking – get the latest build from any branch – without getting all builds and cutting from the top?

using /api/repos/{user}/{repo}/builds?per_page=1 should work.

Confirmed. Thank you!