Retrieving the latest revision
Retrieve the latest revision for each branch of a project via the API.
1 min readUpdated Jul 10, 2026
Overview
This recipe shows how to retrieve the latest revision for each branch of a project.
Listing a project's branches
Send a GET request to the project endpoint with ref_type=branch:
Shell
curl --request GET \ --url 'https://app.fossa.com/api/projects/<project-locator>?ref_type=branch' \ --header 'Authorization: Bearer YOUR_API_KEY'Note
URL-encode the project locator, for example, custom+1234/example becomes custom%2B1234%2Fexample.
Reading the response
The response includes a references array. Each entry describes a branch and points to its latest revision:
| Field | Description |
|---|---|
id | The reference ID. |
type | The reference type (e.g. branch). |
name | The branch name. |
revision_id | The locator of the latest revision on that branch. |
project_id | The project locator. |
Use the revision_id value wherever a revision locator is required, for example, when downloading attribution reports or modifying release groups.