{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Updates a category's name and the permissions its channels inherit.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller lacks the category.update permission, or grants visibility to a role at or above their own highest position.",
          "name": "Forbidden"
        },
        {
          "description": "No community exists at the given DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "No category exists at the given record key.",
          "name": "CategoryNotFound"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "allowedMembers": {
              "description": "Members allowed to post in the category's channels in addition to allowedRoles. Absent leaves the current value unchanged.",
              "items": {
                "description": "A member permitted to post.",
                "format": "did",
                "type": "string"
              },
              "type": "array"
            },
            "allowedRoles": {
              "description": "Roles allowed to post in the category's channels. Absent leaves the current value unchanged.",
              "items": {
                "description": "A role permitted to post.",
                "format": "record-key",
                "type": "string"
              },
              "type": "array"
            },
            "category": {
              "description": "The category's record key.",
              "format": "record-key",
              "type": "string"
            },
            "community": {
              "description": "The community the category belongs to.",
              "format": "did",
              "type": "string"
            },
            "name": {
              "description": "The category's new name.",
              "maxLength": 32,
              "minLength": 1,
              "type": "string"
            },
            "ownerOnly": {
              "description": "Whether only community admins may post in the category's channels. Absent leaves the current value unchanged.",
              "type": "boolean"
            },
            "visibleToMembers": {
              "description": "Members that may read the category's channels in addition to visibleToRoles. Absent leaves the current value unchanged.",
              "items": {
                "description": "A member permitted to read.",
                "format": "did",
                "type": "string"
              },
              "type": "array"
            },
            "visibleToRoles": {
              "description": "Roles that may read the category's channels. Absent leaves the current value unchanged.",
              "items": {
                "description": "A role permitted to read.",
                "format": "record-key",
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "community",
            "category"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "category": {
              "description": "The updated category.",
              "ref": "social.colibri.beta.community.defs#categoryView",
              "type": "ref"
            }
          },
          "required": [
            "category"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.category.update",
  "lexicon": 1
}
