# social.colibri.beta.community.applyLabel

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.applyLabel)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.applyLabel/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.applyLabel/examples)

## Definitions

### `social.colibri.beta.community.applyLabel`

**Type**: `procedure`

Applies a label to a record in one of the community's spaces. This is how content is hidden, marked as a spoiler, or has its link previews suppressed. The record itself is untouched, since it lives in its author's own repo, but a `hidden` label stops this AppView serving the record: it is withheld from reads and from the events socket, and replies to it see a deletedMessageView in its place. Moderators holding `label.apply` and the record's own author still see it.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `val` | `string` | Yes | The label value. `hidden` withholds the record from reads. `spoiler` and `embeds-suppressed` are display hints. |
| `scope` | `array` | No | Narrows the label to specific URIs inside the subject record. Absent means the whole record. |
| `space` | `string` (space-ref) | Yes | The space the labelled record lives in. |
| `reason` | `string` | No | Human-readable reason for the label. |
| `subject` | `ref` → `social.colibri.beta.label#subject` | Yes | The record to label. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `label` | `ref` → `social.colibri.beta.community.defs#labelView` | Yes | The applied label. |

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The caller lacks the label.apply permission.
- **CommunityNotFound**: No community exists at the given DID.
- **SpaceNotFound**: No space exists at the given reference.
- **InvalidRequest**: The scope or val is not valid for the subject record.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.

## Raw Schema

```json
{
  "id": "social.colibri.beta.community.applyLabel",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "space",
            "subject",
            "val"
          ],
          "properties": {
            "val": {
              "type": "string",
              "maxLength": 128,
              "description": "The label value. `hidden` withholds the record from reads. `spoiler` and `embeds-suppressed` are display hints.",
              "knownValues": [
                "hidden",
                "spoiler",
                "embeds-suppressed"
              ]
            },
            "scope": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uri",
                "description": "A URI within the subject record."
              },
              "description": "Narrows the label to specific URIs inside the subject record. Absent means the whole record."
            },
            "space": {
              "type": "string",
              "format": "space-ref",
              "description": "The space the labelled record lives in."
            },
            "reason": {
              "type": "string",
              "maxLength": 512,
              "description": "Human-readable reason for the label."
            },
            "subject": {
              "ref": "social.colibri.beta.label#subject",
              "type": "ref",
              "description": "The record to label."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthRequired",
          "description": "The request is missing, malformed, or unverifiable service auth."
        },
        {
          "name": "Forbidden",
          "description": "The caller lacks the label.apply permission."
        },
        {
          "name": "CommunityNotFound",
          "description": "No community exists at the given DID."
        },
        {
          "name": "SpaceNotFound",
          "description": "No space exists at the given reference."
        },
        {
          "name": "InvalidRequest",
          "description": "The scope or val is not valid for the subject record."
        },
        {
          "name": "CredentialsUnavailable",
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "label"
          ],
          "properties": {
            "label": {
              "ref": "social.colibri.beta.community.defs#labelView",
              "type": "ref",
              "description": "The applied label."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Applies a label to a record in one of the community's spaces. This is how content is hidden, marked as a spoiler, or has its link previews suppressed. The record itself is untouched, since it lives in its author's own repo, but a `hidden` label stops this AppView serving the record: it is withheld from reads and from the events socket, and replies to it see a deletedMessageView in its place. Moderators holding `label.apply` and the record's own author still see it."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
