{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "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.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller lacks the label.apply permission.",
          "name": "Forbidden"
        },
        {
          "description": "No community exists at the given DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "No space exists at the given reference.",
          "name": "SpaceNotFound"
        },
        {
          "description": "The scope or val is not valid for the subject record.",
          "name": "InvalidRequest"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "reason": {
              "description": "Human-readable reason for the label.",
              "maxLength": 512,
              "type": "string"
            },
            "scope": {
              "description": "Narrows the label to specific URIs inside the subject record. Absent means the whole record.",
              "items": {
                "description": "A URI within the subject record.",
                "format": "uri",
                "type": "string"
              },
              "type": "array"
            },
            "space": {
              "description": "The space the labelled record lives in.",
              "format": "space-ref",
              "type": "string"
            },
            "subject": {
              "description": "The record to label.",
              "ref": "social.colibri.beta.label#subject",
              "type": "ref"
            },
            "val": {
              "description": "The label value. `hidden` withholds the record from reads. `spoiler` and `embeds-suppressed` are display hints.",
              "knownValues": [
                "hidden",
                "spoiler",
                "embeds-suppressed"
              ],
              "maxLength": 128,
              "type": "string"
            }
          },
          "required": [
            "space",
            "subject",
            "val"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "label": {
              "description": "The applied label.",
              "ref": "social.colibri.beta.community.defs#labelView",
              "type": "ref"
            }
          },
          "required": [
            "label"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.community.applyLabel",
  "lexicon": 1
}
