# dev.knotless.setItemState

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

✓ This is the authoritative definition for this NSID.

## Description

Closes or reopens a pull or an issue, or resolves a thread on a pull's lines or opens it again, as the account logged in to this appview's pages.

## Links

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

## Definitions

### `dev.knotless.setItemState`

**Type**: `procedure`

Writes a dev.knotless.state record in the account logged in to this appview's web pages, as `knotless close`, `reopen`, `resolve` and `unresolve` do. It counts if that account opened the pull or issue (or the thread), or owns or collaborates on the repository. Requires the session cookie the pages' login sets.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |
| `state` | `string` | Yes | What it is to be: `closed`, or `open` again; for a thread, `resolved`, or `open` again. Merging a pull is another thing. |
| `subject` | `string` (at-uri) | Yes | The dev.knotless.pull or dev.knotless.issue; or the dev.knotless.comment starting a thread on a pull's lines. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | The dev.knotless.state record written. |

#### Errors

- **NotFound**: No such repository.
- **AuthenticationRequired**: No account is logged in to the pages, or its session has ended.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Writes a dev.knotless.state record in the account logged in to this appview's web pages, as `knotless close`, `reopen`, `resolve` and `unresolve` do. It counts if that account opened the pull or issue (or the thread), or owns or collaborates on the repository. Requires the session cookie the pages' login sets.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            },
            "state": {
              "description": "What it is to be: `closed`, or `open` again; for a thread, `resolved`, or `open` again. Merging a pull is another thing.",
              "knownValues": [
                "open",
                "closed",
                "resolved"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "subject": {
              "description": "The dev.knotless.pull or dev.knotless.issue; or the dev.knotless.comment starting a thread on a pull's lines.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "subject",
            "state"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "uri": {
              "description": "The dev.knotless.state record written.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Closes or reopens a pull or an issue, or resolves a thread on a pull's lines or opens it again, as the account logged in to this appview's pages.",
  "id": "dev.knotless.setItemState",
  "lexicon": 1
}
```
