# dev.knotless.listBlocks

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

✓ This is the authoritative definition for this NSID.

## Description

The accounts the asking account blocks.

## Links

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

## Definitions

### `dev.knotless.listBlocks#block`

**Type**: `object`

One account blocked.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `repo` | `ref` → `dev.knotless.defs#repoViewBasic` | No | The one repository it is blocked from, under the name it has now; absent for all of them. |
| `subject` | `ref` → `dev.knotless.defs#actorView` | Yes | The account blocked. |
| `uri` | `string` (at-uri) | Yes | The dev.knotless.block record. |

### `dev.knotless.listBlocks`

**Type**: `query`

The accounts the asking account keeps out of its repositories, from the dev.knotless.block records in its own repo, so a block lists as soon as it is made: the latest first, each from all its repositories or from one. Blocks naming a private repository live in its space, and are not listed. Requires authentication: a service token, or the session cookie the pages' login sets.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `blocks` | `array` | Yes |  |

#### Errors

- **AuthenticationRequired**: No account asks.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "block": {
      "description": "One account blocked.",
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "repo": {
          "description": "The one repository it is blocked from, under the name it has now; absent for all of them.",
          "ref": "dev.knotless.defs#repoViewBasic",
          "type": "ref"
        },
        "subject": {
          "description": "The account blocked.",
          "ref": "dev.knotless.defs#actorView",
          "type": "ref"
        },
        "uri": {
          "description": "The dev.knotless.block record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "subject",
        "createdAt"
      ],
      "type": "object"
    },
    "main": {
      "description": "The accounts the asking account keeps out of its repositories, from the dev.knotless.block records in its own repo, so a block lists as soon as it is made: the latest first, each from all its repositories or from one. Blocks naming a private repository live in its space, and are not listed. Requires authentication: a service token, or the session cookie the pages' login sets.",
      "errors": [
        {
          "description": "No account asks.",
          "name": "AuthenticationRequired"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "blocks": {
              "items": {
                "ref": "#block",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "blocks"
          ],
          "type": "object"
        }
      },
      "type": "query"
    }
  },
  "description": "The accounts the asking account blocks.",
  "id": "dev.knotless.listBlocks",
  "lexicon": 1
}
```
