---
title: "One branch, as in the list"
description: "Answers from stored facts at once, like the list. It computes them first only when they have been stale for over 30 s, or with `?fresh=1`."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.gitpando.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Pando API › branches

`GET /v1/monorepos/{owner}/{monorepo}/repos/{repo}/branches/{branch}`

Answers from stored facts at once, like the list. It computes them first only when they have been stale for over 30 s, or with `?fresh=1`.

## Authentication

Requires one of the following:

- `credential`, http, header `Authorization`
- `session`, apiKey, in cookie

## Path parameters

- `getBranch.path.owner` (string, required) — The monorepo's owner, a namespace (a person's login or an organization). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
- `getBranch.path.monorepo` (string, required) — The monorepo's name within its owner (or an old name). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
- `getBranch.path.repo` (string, required) — The repo's `name` (`projects-web`).
- `getBranch.path.branch` (string, required) — The branch name, `/` encoded as `%2F`.

## Query parameters

- `getBranch.query.fresh` (string, optional) — `1`: compute ahead, behind and mergeable now if stale (about 1 s).
  - one of `"0"`, `"1"`; default `"0"`

## Code samples

### cURL

```curl
curl --request GET \
  --url https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "name": "string",
  "head": "string",
  "base": "string",
  "author": "string",
  "title": "string",
  "description": "string",
  "ahead": 0,
  "behind": 0,
  "mergeable": "clean",
  "stale": true,
  "last_mergeable": "string",
  "conflict_paths": [
    "string"
  ],
  "facts_at": "2019-08-24T14:15:22Z",
  "checks": {
    "sha": "string",
    "state": "success",
    "required": [
      "string"
    ],
    "checks_unknown": "string",
    "missing": [
      "string"
    ],
    "statuses": [
      {
        "sha": "string",
        "context": "string",
        "state": "pending",
        "target_url": "string",
        "description": "string",
        "creator": "string",
        "app": "string",
        "created_at": "2019-08-24T14:15:22Z"
      }
    ]
  },
  "state": "open",
  "merge_commit": "string",
  "merged_by": "string",
  "merged_at": "2019-08-24T14:15:22Z",
  "merged_machine": "string",
  "merged_agent": "string",
  "pushed_machine": "string",
  "forced": true,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```

- `getBranch.response.200.name` (string, required)
- `getBranch.response.200.head` (string, required)
- `getBranch.response.200.checks` (object, required) — GitHub's combined status, plus the required contexts and which are missing.
  - `getBranch.response.200.checks.sha` (string | null, required)
  - `getBranch.response.200.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
    - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
  - `getBranch.response.200.checks.required` (array | null, required) — Null while unknown.
  - `getBranch.response.200.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
  - `getBranch.response.200.checks.statuses` (array<object>, required) — The latest status per context.
    - `getBranch.response.200.checks.statuses.sha` (string, required)
    - `getBranch.response.200.checks.statuses.context` (string, required)
    - `getBranch.response.200.checks.statuses.state` (string, required)
      - one of `"pending"`, `"success"`, `"failure"`, `"error"`
    - `getBranch.response.200.checks.statuses.created_at` (string, required)
      - format `date-time`
    - `getBranch.response.200.checks.statuses.target_url` (string | null, optional)
    - `getBranch.response.200.checks.statuses.description` (string | null, optional)
    - `getBranch.response.200.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
    - `getBranch.response.200.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
  - `getBranch.response.200.checks.missing` (array<string>, optional)
- `getBranch.response.200.state` (string, required) — `merged` when the branch's current head was landed by a Pando merge.
  - one of `"open"`, `"merged"`
- `getBranch.response.200.base` (string | null, optional) — The merge base with the default branch; null when there is none.
- `getBranch.response.200.author` (string | null, optional) — The user whose first push (or createBranch) made the branch.
- `getBranch.response.200.title` (string | null, optional)
- `getBranch.response.200.description` (string | null, optional)
- `getBranch.response.200.ahead` (integer | null, optional) — Commits on the branch that are not on the default branch.
- `getBranch.response.200.behind` (integer | null, optional) — Commits on the default branch that are not on the branch.
- `getBranch.response.200.mergeable` (string, optional) — From the merge engine's dry run. `up_to_date`: the branch adds nothing. `pending`: not yet computed for the current main and head (see `last_mergeable`).
  - one of `"clean"`, `"conflicts"`, `"up_to_date"`, `"unknown"`, `"pending"`
- `getBranch.response.200.stale` (boolean, optional) — True while ahead, behind, base and mergeable are not yet for the current main and head.
- `getBranch.response.200.last_mergeable` (string | null, optional) — When stale: the last known mergeable answer.
- `getBranch.response.200.conflict_paths` (array | null, optional) — The paths changed differently on both sides, from the same dry run as `mergeable` (or `last_mergeable` while stale), so a branch page shows them before Merge is pressed. Null unless that answer is `conflicts`. No cap: the same list a refused merge's 409 carries in `paths`.
- `getBranch.response.200.facts_at` (string | null, optional) — When the facts were computed.
  - format `date-time`
- `getBranch.response.200.merge_commit` (string | null, optional)
- `getBranch.response.200.merged_by` (string | null, optional) — The user who merged (state merged only).
- `getBranch.response.200.merged_at` (string | null, optional)
  - format `date-time`
- `getBranch.response.200.merged_machine` (string | null, optional) — The name of the credential used to merge: the machine or sandbox.
- `getBranch.response.200.merged_agent` (string | null, optional) — The agent that merged, from X-Pando-Agent, if one said so.
- `getBranch.response.200.pushed_machine` (string | null, optional) — The name of the credential that last pushed the branch: the machine or sandbox.
- `getBranch.response.200.forced` (boolean | null, optional) — True when the merge went past red or missing checks with force=1.
- `getBranch.response.200.created_at` (string | null, optional)
  - format `date-time`
- `getBranch.response.200.updated_at` (string | null, optional)
  - format `date-time`

### 404

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `getBranch.response.404.error` (object, required)
  - `getBranch.response.404.error.code` (string, required)
  - `getBranch.response.404.error.message` (string, required)
  - `getBranch.response.404.error.paths` (array<string>, optional)
  - `getBranch.response.404.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `getBranch.response.404.error.checks.sha` (string | null, required)
    - `getBranch.response.404.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `getBranch.response.404.error.checks.required` (array | null, required) — Null while unknown.
    - `getBranch.response.404.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `getBranch.response.404.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `getBranch.response.404.error.checks.statuses.sha` (string, required)
      - `getBranch.response.404.error.checks.statuses.context` (string, required)
      - `getBranch.response.404.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `getBranch.response.404.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `getBranch.response.404.error.checks.statuses.target_url` (string | null, optional)
      - `getBranch.response.404.error.checks.statuses.description` (string | null, optional)
      - `getBranch.response.404.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `getBranch.response.404.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `getBranch.response.404.error.checks.missing` (array<string>, optional)


Source: https://docs.gitpando.com/api/branches/getBranch/index.md
