Skip to content
FeedbackDashboard

List project branches

$client->projects->branches->list(string project, ?string cursor, ?float limit): Page<BranchListResponse>
GET/v0/projects/{project}/branches

Retrieve a project branch by name.

ParametersExpand Collapse
project: string
cursor?:optional string

Pagination cursor from a previous response

limit?:optional float

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

ReturnsExpand Collapse
string branch

Branch name

ConfigCommit configCommit

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

string latestBuildID
Object_ object
string org
string project

Project name

List project branches

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'staging');

$page = $client->projects->branches->list(
  project: 'project', cursor: 'cursor', limit: 1
);

var_dump($page);
{
  "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"
}