Skip to content
  • Auto
  • Light
  • Dark

List

List project branches
projects.branches.list(BranchListParams**kwargs) -> SyncPage[branchstrconfig_commitCommitlatest_build_idstrobjectliteralorgstrprojectstrBranchListResponse]
get/v0/projects/{project}/branches

List project branches

Parameters
projectstr
optional
cursorstr
optional

Pagination cursor from a previous response

limitfloat
optional

Maximum number of items to return, defaults to 10 (maximum: 100)

exclusiveMinimum0
maximum100
Returns
BranchListResponseclass
Hide ParametersShow Parameters
branchstr
config_commitrepoReposhastrCommit
latest_build_idstr
objectliteral
Literal["project_branch"]
Hide ParametersShow Parameters
"project_branch"
orgstr
projectstr
from stainless_v0 import Stainless

client = Stainless(
    api_key="My API Key",
)
page = client.projects.branches.list(
    project="project",
)
page = page.data[0]
print(page.latest_build_id)
200 Example
{
  "data": [
    {
      "branch": "branch",
      "config_commit": {
        "repo": {
          "branch": "branch",
          "name": "name",
          "owner": "owner"
        },
        "sha": "sha"
      },
      "latest_build_id": "latest_build_id",
      "object": "project_branch",
      "org": "org",
      "project": "project"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}