# dev.knotless.labelItem

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

✓ This is the authoritative definition for this NSID.

## Description

Puts a label on a pull or an issue, or takes it off, as the account logged in to this appview's pages.

## Links

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

## Definitions

### `dev.knotless.labelItem`

**Type**: `procedure`

Rewrites the dev.knotless.label record about a pull or an issue in the account logged in to this appview's web pages, as `knotless label` and `knotless unlabel` do: the repository's owner and collaborators put on any label it defines, and its triagers those of their scopes. Putting on an exclusive label takes the others of its scope off. Requires the session cookie the pages' login sets.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `label` | `string` | Yes | The name of a label the repository defines. |
| `removed` | `boolean` | No | True to take it off rather than put it on. |
| `repo` | `string` (at-uri) | Yes | The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it. |
| `subject` | `string` (at-uri) | Yes | The dev.knotless.pull or dev.knotless.issue. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `labels` | `array` | Yes | The labels it carries now, in the order the repository defines them. |

#### 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 the dev.knotless.label record about a pull or an issue in the account logged in to this appview's web pages, as `knotless label` and `knotless unlabel` do: the repository's owner and collaborators put on any label it defines, and its triagers those of their scopes. Putting on an exclusive label takes the others of its scope off. 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": {
            "label": {
              "description": "The name of a label the repository defines.",
              "maxGraphemes": 50,
              "maxLength": 100,
              "type": "string"
            },
            "removed": {
              "default": false,
              "description": "True to take it off rather than put it on.",
              "type": "boolean"
            },
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            },
            "subject": {
              "description": "The dev.knotless.pull or dev.knotless.issue.",
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "subject",
            "label"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "labels": {
              "description": "The labels it carries now, in the order the repository defines them.",
              "items": {
                "ref": "dev.knotless.repo#label",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "labels"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Puts a label on a pull or an issue, or takes it off, as the account logged in to this appview's pages.",
  "id": "dev.knotless.labelItem",
  "lexicon": 1
}
```
