Skip to content
FeedbackDashboard

List project branches

get/v0/projects/{project}/branches

Retrieve a project branch by name.

Path ParametersExpand Collapse
project: optional string
Query ParametersExpand Collapse
cursor: optional string

Pagination cursor from a previous response

limit: optional number

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

exclusiveMinimum0
maximum100
ReturnsExpand Collapse
data: array of object { branch, config_commit, latest_build_id, 3 more }
branch: string

Branch name

config_commit: object { repo, sha }

A Git commit that points to the latest set of config files on a given branch.

repo: object { branch, name, owner }
branch: string
name: string
owner: string
sha: string
latest_build_id: string
object: "project_branch"
org: string
project: string

Project name

has_more: boolean
next_cursor: optional string
List project branches
curl https://api.stainless.com/v0/projects/$PROJECT/branches \
    -H "Authorization: Bearer $STAINLESS_API_KEY"
{
  "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"
}
Returns Examples
{
  "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"
}