# dev.knotless.listBranches

> 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.

- Kind: query
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.listBranches/analytics)

## Query (`dev.knotless.listBranches`)

Type: query · GET

### Parameters (query string)

- `commits` (boolean): 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.
  - Constraints: default: false
- `cursor` (string): How many branches the pages before held.
  - Constraints: maxLength: 32
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 1000, default: 100
- `repo` (string · at-uri, required): 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 (application/json)

- `branches` (array, required)
  - `items` (ref)
    - Reference: `#branchView`
- `cursor` (string): Absent on the last page.

### Errors

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

## #branchView (`dev.knotless.listBranches#branchView`)

Type: object

One branch.

### Properties

- `checks` (array): The newest run of each workflow at its tip, by the runners the repository names, when `commits` was asked.
  - `items` (ref)
    - Reference: `dev.knotless.defs#checkView`
- `commit` (ref): Its tip, when `commits` was asked.
  - Reference: `dev.knotless.defs#commitView`
- `name` (string, required): Its short name, without `refs/heads/`.

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