# dev.knotless.blockActor

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

✓ This is the authoritative definition for this NSID.

## Description

Blocks an account as the account logged in to this appview's pages.

## Links

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

## Definitions

### `dev.knotless.blockActor#block`

**Type**: `object`

Whom to block, and from what.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `repo` | `string` (at-uri) | No | The one repository to block it from, by its dev.knotless.repo record: one of the asker's own. All of them when absent. |
| `subject` | `string` (at-identifier) | Yes | The account to block, by DID or handle. |

### `dev.knotless.blockActor#blockState`

**Type**: `object`

Whether the account is blocked now, from what was asked.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `blocking` | `boolean` | Yes | Whether it is blocked now. |
| `subject` | `string` (did) | Yes | The account. |

### `dev.knotless.blockActor`

**Type**: `procedure`

Writes a dev.knotless.block record in the account logged in to this appview's web pages, as `knotless block` does, unless one is there already: nothing the account blocked writes about its repositories, or about the one repository named, shows. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account. Clients holding their own session write the record themselves.

#### Input

**Encoding**: `application/json`

#### Output

**Encoding**: `application/json`

#### Errors

- **InvalidRequest**: The account is the one asking, or the repository is not its own.
- **NotFound**: No such account.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "block": {
      "description": "Whom to block, and from what.",
      "properties": {
        "repo": {
          "description": "The one repository to block it from, by its dev.knotless.repo record: one of the asker's own. All of them when absent.",
          "format": "at-uri",
          "type": "string"
        },
        "subject": {
          "description": "The account to block, by DID or handle.",
          "format": "at-identifier",
          "type": "string"
        }
      },
      "required": [
        "subject"
      ],
      "type": "object"
    },
    "blockState": {
      "description": "Whether the account is blocked now, from what was asked.",
      "properties": {
        "blocking": {
          "description": "Whether it is blocked now.",
          "type": "boolean"
        },
        "subject": {
          "description": "The account.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "subject",
        "blocking"
      ],
      "type": "object"
    },
    "main": {
      "description": "Writes a dev.knotless.block record in the account logged in to this appview's web pages, as `knotless block` does, unless one is there already: nothing the account blocked writes about its repositories, or about the one repository named, shows. Requires the session cookie the pages' login sets: the appview writes with the session it keeps for that account. Clients holding their own session write the record themselves.",
      "errors": [
        {
          "description": "The account is the one asking, or the repository is not its own.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such account.",
          "name": "NotFound"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "ref": "#block",
          "type": "ref"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "ref": "#blockState",
          "type": "ref"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Blocks an account as the account logged in to this appview's pages.",
  "id": "dev.knotless.blockActor",
  "lexicon": 1
}
```
