Skip to content

Retrieve the latest revision for each branch of a project

Chelsea Boling edited this page Apr 10, 2023 · 2 revisions

You can achieve this by running the following endpoint:

curl 'https://app.fossa.com/api/projects/<encoded-project-locator>?ref_type=branch' \
--header 'Authorization: Bearer <fossa-full-access-token>' | jq '.references[] | select(.type == "branch")'

The output should look like the following:

...,
{
  "id": integer-id,
  "type": "branch",
  "name": "name-of-branch",
  "revision_id": "project-locator$revision-id",
  "project_id": "project-locator"
},
...