# dev.knotless.listItems

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

✓ This is the authoritative definition for this NSID.

## Description

A repository's pulls or issues.

## Links

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

## Definitions

### `dev.knotless.listItems`

**Type**: `query`

A repository's pulls or its issues, open or closed, newest first, a page at a time: follow `cursor` until it is absent. `q` filters them as GitHub's search does. 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 |
|----------|------|----------|-------------|
| `cursor` | `string` | No | How many the pages before held. |
| `kind` | `string` | Yes |  |
| `limit` | `integer` | No |  |
| `q` | `string` | No | A filter, in words: `label:<name>` (each must be on it), `-label:<name>`, `no:label`, `author:<handle or did>` (any of them), `state:open\|closed\|merged` (over `state`), `is:pull\|issue`, and words its title or body holds, ignoring case. Double quotes keep a value or words together; a qualifier it does not know is a word. The counts are of those it matches. |
| `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. |
| `state` | `string` | No | Open ones, or those closed and merged; open if absent. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `authors` | `array` | No | Who opened pulls or issues of its kind, in any state, the most recent first, for a filter to name. Absent when there are none. |
| `closedCount` | `integer` | Yes | How many of its kind are closed or merged, of those `q` matches. |
| `cursor` | `string` | No | Absent on the last page. |
| `items` | `array` | Yes |  |
| `labels` | `array` | No | The labels the repository defines, in its order, for a filter to name. Absent when it defines none. |
| `openCount` | `integer` | Yes | How many of its kind are open, of those `q` matches. |

#### Errors

- **NotFound**: No such repository; or this appview keeps no index, so it knows no pulls or issues.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A repository's pulls or its issues, open or closed, newest first, a page at a time: follow `cursor` until it is absent. `q` filters them as GitHub's search does. 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; or this appview keeps no index, so it knows no pulls or issues.",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "authors": {
              "description": "Who opened pulls or issues of its kind, in any state, the most recent first, for a filter to name. Absent when there are none.",
              "items": {
                "ref": "dev.knotless.defs#actorView",
                "type": "ref"
              },
              "type": "array"
            },
            "closedCount": {
              "description": "How many of its kind are closed or merged, of those `q` matches.",
              "minimum": 0,
              "type": "integer"
            },
            "cursor": {
              "description": "Absent on the last page.",
              "type": "string"
            },
            "items": {
              "items": {
                "ref": "dev.knotless.defs#itemView",
                "type": "ref"
              },
              "type": "array"
            },
            "labels": {
              "description": "The labels the repository defines, in its order, for a filter to name. Absent when it defines none.",
              "items": {
                "ref": "dev.knotless.repo#label",
                "type": "ref"
              },
              "type": "array"
            },
            "openCount": {
              "description": "How many of its kind are open, of those `q` matches.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "items",
            "openCount",
            "closedCount"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "How many the pages before held.",
            "maxLength": 32,
            "type": "string"
          },
          "kind": {
            "knownValues": [
              "pull",
              "issue"
            ],
            "maxLength": 16,
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "q": {
            "description": "A filter, in words: `label:<name>` (each must be on it), `-label:<name>`, `no:label`, `author:<handle or did>` (any of them), `state:open|closed|merged` (over `state`), `is:pull|issue`, and words its title or body holds, ignoring case. Double quotes keep a value or words together; a qualifier it does not know is a word. The counts are of those it matches.",
            "maxLength": 1024,
            "type": "string"
          },
          "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"
          },
          "state": {
            "description": "Open ones, or those closed and merged; open if absent.",
            "knownValues": [
              "open",
              "closed"
            ],
            "maxLength": 16,
            "type": "string"
          }
        },
        "required": [
          "repo",
          "kind"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "description": "A repository's pulls or issues.",
  "id": "dev.knotless.listItems",
  "lexicon": 1
}
```
