# org.cairnsproto.draft.listBlocks

> Public block records, oldest first, optionally about one subject. A block changes no weight on its own; labelers weigh blocks as one signal.

- Kind: query
- Authority: draft.cairnsproto.org
- Lexicon: 1
- Published by [cairnsproto.org](https://lexicon.garden/identity/did:plc:np7ezqujtsry4bkogisaabul), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.listBlocks)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.listBlocks/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:np7ezqujtsry4bkogisaabul/org.cairnsproto.draft.listBlocks/analytics)

## Query (`org.cairnsproto.draft.listBlocks`)

Type: query · GET

### Parameters (query string)

- `cursor` (string)
  - Constraints: maxLength: 32
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 100, default: 50
- `subject` (string · did): Keep blocks of this DID.

### Output (application/json)

- `blocks` (array, required)
  - `items` (ref)
    - Reference: `#blockView`
- `cursor` (string)
  - Constraints: maxLength: 32

## #blockView (`org.cairnsproto.draft.listBlocks#blockView`)

Type: object

### Properties

- `author` (string · did, required)
- `cid` (string · cid, required)
- `record` (ref, required)
  - Reference: `org.cairnsproto.draft.block`
- `uri` (string · at-uri, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "blockView": {
      "properties": {
        "author": {
          "format": "did",
          "type": "string"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "record": {
          "ref": "org.cairnsproto.draft.block",
          "type": "ref"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "author",
        "record"
      ],
      "type": "object"
    },
    "main": {
      "description": "Public block records, oldest first, optionally about one subject. A block changes no weight on its own; labelers weigh blocks as one signal.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "blocks": {
              "items": {
                "ref": "#blockView",
                "type": "ref"
              },
              "type": "array"
            },
            "cursor": {
              "maxLength": 32,
              "type": "string"
            }
          },
          "required": [
            "blocks"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "maxLength": 32,
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "subject": {
            "description": "Keep blocks of this DID.",
            "format": "did",
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "org.cairnsproto.draft.listBlocks",
  "lexicon": 1
}
```
