---
title: "The branch's own commits, newest first, with Pando's trailers parsed"
description: "The commits on the branch that are not on the default branch (the\nones `ahead` counts), in git log's order: each commit before its\nparents. `trailers` holds the who-made-it lines\n(`Pando-Agent`, `Pando-Worktree`, `Pando-Machine`), read from\nthe message's last paragraph.\n"
---

> 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}/commits`

The commits on the branch that are not on the default branch (the
ones `ahead` counts), in git log's order: each commit before its
parents. `trailers` holds the who-made-it lines
(`Pando-Agent`, `Pando-Worktree`, `Pando-Machine`), read from
the message's last paragraph.

## Authentication

Requires one of the following:

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

## Path parameters

- `branchCommits.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}$`
- `branchCommits.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}$`
- `branchCommits.path.repo` (string, required) — The repo's `name` (`projects-web`).
- `branchCommits.path.branch` (string, required) — The branch name, `/` encoded as `%2F`.

## Query parameters

- `branchCommits.query.limit` (integer, optional) — At most 250.
  - min 1; max 250; default `250`

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/repos/string/branches/string/commits';
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/commits"

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "branch": "string",
  "head": "string",
  "base_branch": "string",
  "merge_base": "string",
  "total": 0,
  "truncated": true,
  "commits": [
    {
      "sha": "string",
      "parents": [
        "string"
      ],
      "title": "string",
      "message": "string",
      "author": {
        "name": "string",
        "email": "string",
        "date": "2019-08-24T14:15:22Z"
      },
      "committer": {
        "name": "string",
        "email": "string",
        "date": "2019-08-24T14:15:22Z"
      },
      "trailers": {
        "agent": "string",
        "worktree": "string",
        "machine": "string"
      },
      "co_authors": [
        {
          "name": "string",
          "email": "string"
        }
      ]
    }
  ]
}
```

- `branchCommits.response.200.branch` (string, required)
- `branchCommits.response.200.head` (string, required)
- `branchCommits.response.200.base_branch` (string, required)
- `branchCommits.response.200.merge_base` (string | null, required)
- `branchCommits.response.200.total` (integer, required) — Commits on the branch only; may be more than returned.
- `branchCommits.response.200.truncated` (boolean, required)
- `branchCommits.response.200.commits` (array<object>, required)
  - `branchCommits.response.200.commits.sha` (string, required)
  - `branchCommits.response.200.commits.parents` (array<string>, required)
  - `branchCommits.response.200.commits.title` (string, required) — The message's first line.
  - `branchCommits.response.200.commits.message` (string, required) — The full message, at most 4,096 characters.
  - `branchCommits.response.200.commits.author` (object, required)
    - `branchCommits.response.200.commits.author.name` (string | null, optional)
    - `branchCommits.response.200.commits.author.email` (string | null, optional)
    - `branchCommits.response.200.commits.author.date` (string | null, optional)
      - format `date-time`
  - `branchCommits.response.200.commits.committer` (object, required)
    - `branchCommits.response.200.commits.committer.name` (string | null, optional)
    - `branchCommits.response.200.commits.committer.email` (string | null, optional)
    - `branchCommits.response.200.commits.committer.date` (string | null, optional)
      - format `date-time`
  - `branchCommits.response.200.commits.trailers` (object, required)
    - `branchCommits.response.200.commits.trailers.agent` (string | null, required)
    - `branchCommits.response.200.commits.trailers.worktree` (string | null, required)
    - `branchCommits.response.200.commits.trailers.machine` (string | null, required)
  - `branchCommits.response.200.commits.co_authors` (array<object>, optional) — `Co-authored-by: Name <email>` lines from the message's trailers (its last paragraph), each once, as git and GitHub read them.
    - `branchCommits.response.200.commits.co_authors.name` (string, required)
    - `branchCommits.response.200.commits.co_authors.email` (string | null, required)

### 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"
        }
      ]
    }
  }
}
```

- `branchCommits.response.404.error` (object, required)
  - `branchCommits.response.404.error.code` (string, required)
  - `branchCommits.response.404.error.message` (string, required)
  - `branchCommits.response.404.error.paths` (array<string>, optional)
  - `branchCommits.response.404.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `branchCommits.response.404.error.checks.sha` (string | null, required)
    - `branchCommits.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"`
    - `branchCommits.response.404.error.checks.required` (array | null, required) — Null while unknown.
    - `branchCommits.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.
    - `branchCommits.response.404.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `branchCommits.response.404.error.checks.statuses.sha` (string, required)
      - `branchCommits.response.404.error.checks.statuses.context` (string, required)
      - `branchCommits.response.404.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `branchCommits.response.404.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `branchCommits.response.404.error.checks.statuses.target_url` (string | null, optional)
      - `branchCommits.response.404.error.checks.statuses.description` (string | null, optional)
      - `branchCommits.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.
      - `branchCommits.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.
    - `branchCommits.response.404.error.checks.missing` (array<string>, optional)


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