# dev.knotless.editItem

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

✓ This is the authoritative definition for this NSID.

## Description

Changes what a pull, an issue or a comment says, as its author, logged in to this appview's pages.

## Links

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

## Definitions

### `dev.knotless.editItem`

**Type**: `procedure`

Rewrites a dev.knotless.pull, dev.knotless.issue or dev.knotless.comment record in the account logged in to this appview's web pages, which must have written it, as `knotless edit` does: a pull's or an issue's title or body, or a comment's body, and whether a pull is a draft. An empty body takes a pull's or an issue's away; a comment keeps one. Requires the session cookie the pages' login sets.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `body` | `string` | No | Its new body, in Markdown. |
| `draft` | `boolean` | No | For a pull, make it a draft, or with false mark it ready to merge. Left as it is, when absent; any other item refuses it. |
| `images` | `array` | No | Pictures uploaded with dev.knotless.uploadImage for the new body. Of these and those it had, the new body's links decide which stay attached. |
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |
| `subject` | `string` (at-uri) | Yes | The pull, issue or comment to change. |
| `title` | `string` | No | A pull's or an issue's new title. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | The record changed. |

#### 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": "Rewrites a dev.knotless.pull, dev.knotless.issue or dev.knotless.comment record in the account logged in to this appview's web pages, which must have written it, as `knotless edit` does: a pull's or an issue's title or body, or a comment's body, and whether a pull is a draft. An empty body takes a pull's or an issue's away; a comment keeps one. 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": {
            "body": {
              "description": "Its new body, in Markdown.",
              "maxLength": 20000,
              "type": "string"
            },
            "draft": {
              "description": "For a pull, make it a draft, or with false mark it ready to merge. Left as it is, when absent; any other item refuses it.",
              "type": "boolean"
            },
            "images": {
              "description": "Pictures uploaded with dev.knotless.uploadImage for the new body. Of these and those it had, the new body's links decide which stay attached.",
              "items": {
                "ref": "dev.knotless.defs#image",
                "type": "ref"
              },
              "maxLength": 32,
              "type": "array"
            },
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            },
            "subject": {
              "description": "The pull, issue or comment to change.",
              "format": "at-uri",
              "type": "string"
            },
            "title": {
              "description": "A pull's or an issue's new title.",
              "maxGraphemes": 300,
              "maxLength": 3000,
              "type": "string"
            }
          },
          "required": [
            "repo",
            "subject"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "uri": {
              "description": "The record changed.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Changes what a pull, an issue or a comment says, as its author, logged in to this appview's pages.",
  "id": "dev.knotless.editItem",
  "lexicon": 1
}
```
