# dev.knotless.listBranches

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

A repository's branches.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches/examples)

## Definitions

### `dev.knotless.listBranches#branchView`

**Type**: `object`

One branch.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `checks` | `array` | No | The newest run of each workflow at its tip, by the runners the repository names, when `commits` was asked. |
| `commit` | `ref` → `dev.knotless.defs#commitView` | No | Its tip, when `commits` was asked. |
| `name` | `string` | Yes | Its short name, without `refs/heads/`. |

### `dev.knotless.listBranches`

**Type**: `query`

A repository's branches, the default first and the rest by name, a page at a time: follow `cursor` until it is absent. No authentication needed; asked as an account, with a service token or the pages' session cookie, a private repository it is a member of is read too, and the answer is that account's alone.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `commits` | `boolean` | No | Each branch's tip commit and its checks too, as a page of branches shows them, rather than its name alone, as a menu of them does. |
| `cursor` | `string` | No | How many branches the pages before held. |
| `limit` | `integer` | No |  |
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record. Its authority may be a handle; a name the repository had before, or an owner it moved from with its agreement, finds it under the name it has now. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `branches` | `array` | Yes |  |
| `cursor` | `string` | No | Absent on the last page. |

#### Errors

- **NotFound**: No such repository, revision, path or record.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "branchView": {
      "description": "One branch.",
      "properties": {
        "checks": {
          "description": "The newest run of each workflow at its tip, by the runners the repository names, when `commits` was asked.",
          "items": {
            "ref": "dev.knotless.defs#checkView",
            "type": "ref"
          },
          "type": "array"
        },
        "commit": {
          "description": "Its tip, when `commits` was asked.",
          "ref": "dev.knotless.defs#commitView",
          "type": "ref"
        },
        "name": {
          "description": "Its short name, without `refs/heads/`.",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "main": {
      "description": "A repository's branches, the default first and the rest by name, a page at a time: follow `cursor` until it is absent. No authentication needed; asked as an account, with a service token or the pages' session cookie, a private repository it is a member of is read too, and the answer is that account's alone.",
      "errors": [
        {
          "description": "No such repository, revision, path or record.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "branches": {
              "items": {
                "ref": "#branchView",
                "type": "ref"
              },
              "type": "array"
            },
            "cursor": {
              "description": "Absent on the last page.",
              "type": "string"
            }
          },
          "required": [
            "branches"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "commits": {
            "default": false,
            "description": "Each branch's tip commit and its checks too, as a page of branches shows them, rather than its name alone, as a menu of them does.",
            "type": "boolean"
          },
          "cursor": {
            "description": "How many branches the pages before held.",
            "maxLength": 32,
            "type": "string"
          },
          "limit": {
            "default": 100,
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "repo": {
            "description": "The repository's dev.knotless.repo record. Its authority may be a handle; a name the repository had before, or an owner it moved from with its agreement, finds it under the name it has now.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "repo"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "A repository's branches.",
  "id": "dev.knotless.listBranches",
  "lexicon": 1
}
```
