---
title: "The last commit that changed each entry of a folder"
description: "First parents (`git log -1 --first-parent -- <entry>`): on main, a\nchange merged from a branch is the merge, with `merged_branch`. A\ncomplete answer is stored (it never changes) and reused by later\ncommits' answers. A walk stops after about 40 Artifacts reads: the\nanswer then has `complete: false`, the entries found so far (null for\nthe rest), and `retry_after_ms`; a job finishes it. Entries unchanged\nwithin 10,000 commits stay null with `older.before`.\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 › repos

`GET /v1/monorepos/{owner}/{monorepo}/repos/{repo}/tree/last-commits`

First parents (`git log -1 --first-parent -- <entry>`): on main, a
change merged from a branch is the merge, with `merged_branch`. A
complete answer is stored (it never changes) and reused by later
commits' answers. A walk stops after about 40 Artifacts reads: the
answer then has `complete: false`, the entries found so far (null for
the rest), and `retry_after_ms`; a job finishes it. Entries unchanged
within 10,000 commits stay null with `older.before`.

## Authentication

Requires one of the following:

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

## Path parameters

- `getLastCommits.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}$`
- `getLastCommits.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}$`
- `getLastCommits.path.repo` (string, required) — The repo's `name` (`projects-web`).

## Query parameters

- `getLastCommits.query.ref` (string, optional)
- `getLastCommits.query.path` (string, optional)
- `getLastCommits.query.names` (string, optional) — Comma-separated entry names (a page of a large folder). Default: all.

## Code samples

### cURL

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

### TypeScript

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

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "ref": "string",
  "commit": "string",
  "path": "string",
  "complete": true,
  "entries": {
    "property1": {
      "sha": "string",
      "title": "string",
      "author": {
        "name": "string",
        "email": "string"
      },
      "at": "2019-08-24T14:15:22Z",
      "merged_branch": {
        "branch": "string",
        "title": "string"
      }
    },
    "property2": {
      "sha": "string",
      "title": "string",
      "author": {
        "name": "string",
        "email": "string"
      },
      "at": "2019-08-24T14:15:22Z",
      "merged_branch": {
        "branch": "string",
        "title": "string"
      }
    }
  },
  "older": {
    "before": "2019-08-24T14:15:22Z"
  },
  "retry_after_ms": 0
}
```

- `getLastCommits.response.200.ref` (string, required)
- `getLastCommits.response.200.commit` (string, required)
- `getLastCommits.response.200.path` (string, required)
- `getLastCommits.response.200.complete` (boolean, required)
- `getLastCommits.response.200.entries` (map<one of>, required)
- `getLastCommits.response.200.older` (object | null, required)
  - `getLastCommits.response.200.older.before` (string, optional)
    - format `date-time`
- `getLastCommits.response.200.retry_after_ms` (integer | 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"
        }
      ]
    }
  }
}
```

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


Source: https://docs.gitpando.com/api/repos/getLastCommits/index.md
