{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Names the account among the triagers of the repository's dev.knotless.repo record, for the scopes given, in place of what it had, as `knotless triager add` does: its labels of those scopes count, below the owner's and collaborators'. Its owner can, logged in to this appview's web pages: the appview writes with the session it keeps for that account, which the pages' session cookie names. For an organization's repository, so can an admin who joined it, logged in to the pages or with a service token from their own PDS for this method: the appview's gateway, which the organization delegated its writes to, writes as the organization.",
      "errors": [
        {
          "description": "No such repository.",
          "name": "NotFound"
        },
        {
          "description": "No scopes were named, or there is no such account.",
          "name": "InvalidRequest"
        },
        {
          "description": "No account is logged in to the pages, or its session has ended.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "The account logged in is not the repository's owner.",
          "name": "Forbidden"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "repo": {
              "description": "The repository's dev.knotless.repo record, as dev.knotless.getRepo takes it.",
              "format": "at-uri",
              "type": "string"
            },
            "scopes": {
              "description": "The scopes of the labels it may put on, at least one.",
              "items": {
                "ref": "dev.knotless.repo#scope",
                "type": "ref"
              },
              "maxLength": 50,
              "type": "array"
            },
            "who": {
              "description": "The account, by handle or DID.",
              "format": "at-identifier",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "who",
            "scopes"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "triagers": {
              "description": "The repository's triagers now.",
              "items": {
                "ref": "dev.knotless.getRepoSettings#triagerView",
                "type": "ref"
              },
              "type": "array"
            },
            "warning": {
              "description": "Why the account was not told of a private repository it now triages, when it could not be invited to it; absent otherwise.",
              "type": "string"
            }
          },
          "required": [
            "triagers"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Names an account a triager of a repository.",
  "id": "dev.knotless.setTriager",
  "lexicon": 1
}
