---
title: "Every code repo's main head (for followers; no Artifacts read)"
description: "Main as Pando last moved it: by the first push through the door, or by\na merge. Answered from the monorepo object's records. A repo made\nbefore Pando kept heads is read once from Artifacts and kept. `head` is\nnull for an empty repo. The meta layer's repo is not listed.\n\nA follower (`pando worktree follow`) calls this on connect, then opens\n`GET /v1/monorepos/{owner}/{monorepo}/events?topics=main&since=<seq>` (WebSocket) to\nhear each move, and calls it again every few minutes as a safety net.\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}/heads`

Main as Pando last moved it: by the first push through the door, or by
a merge. Answered from the monorepo object's records. A repo made
before Pando kept heads is read once from Artifacts and kept. `head` is
null for an empty repo. The meta layer's repo is not listed.

A follower (`pando worktree follow`) calls this on connect, then opens
`GET /v1/monorepos/{owner}/{monorepo}/events?topics=main&since=<seq>` (WebSocket) to
hear each move, and calls it again every few minutes as a safety net.

## Authentication

Requires one of the following:

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

## Path parameters

- `heads.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}$`
- `heads.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}$`

## Code samples

### cURL

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

### TypeScript

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

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "heads": [
    {
      "repo": "string",
      "path": "string",
      "default_branch": "string",
      "head": "string",
      "head_title": "string",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "seq": 0
}
```

- `heads.response.200.heads` (array<object>, required)
  - `heads.response.200.heads.repo` (string, required) — The repo's name in URLs.
  - `heads.response.200.heads.path` (string, required)
  - `heads.response.200.heads.default_branch` (string, required)
  - `heads.response.200.heads.head` (string | null, required)
  - `heads.response.200.heads.head_title` (string | null, required) — The head commit's title (its first line), recorded when main moved: a merge's message, or the first push's commit (shortly after the push, once its numbers are read). A main recorded before titles were shows the last merge's branch title. Null when unknown, never a title from another commit.
  - `heads.response.200.heads.updated_at` (string | null, required)
    - format `date-time`
- `heads.response.200.seq` (integer | null, required) — The event stream's newest seq when this was read; resume the socket from it. Null when the stream is off.


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