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, stats, tree_oid }

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

repo: object { branch, host, name, owner }
branch: string
host: string
name: string
owner: string
sha: string
stats: object { additions, deletions, total }
additions: number
deletions: number
total: number
tree_oid: 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",
          "host": "host",
          "name": "name",
          "owner": "owner"
        },
        "sha": "sha",
        "stats": {
          "additions": 0,
          "deletions": 0,
          "total": 0
        },
        "tree_oid": "tree_oid"
      },
      "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",
          "host": "host",
          "name": "name",
          "owner": "owner"
        },
        "sha": "sha",
        "stats": {
          "additions": 0,
          "deletions": 0,
          "total": 0
        },
        "tree_oid": "tree_oid"
      },
      "latest_build_id": "latest_build_id",
      "object": "project_branch",
      "org": "org",
      "project": "project"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}