{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "InvalidSpace"
        },
        {
          "name": "InvalidRepo"
        },
        {
          "name": "InvalidCollections"
        },
        {
          "name": "InvalidActions"
        },
        {
          "name": "InvalidBlobPolicy"
        },
        {
          "name": "RegistrationRequired"
        },
        {
          "name": "DelegationExists"
        },
        {
          "name": "RateLimited"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "actions": {
              "items": {
                "enum": [
                  "create",
                  "update",
                  "delete"
                ],
                "type": "string"
              },
              "maxLength": 3,
              "minLength": 1,
              "type": "array"
            },
            "blob": {
              "ref": "party.whey.writeproxy.defs#blobPolicy",
              "type": "ref"
            },
            "collections": {
              "items": {
                "format": "nsid",
                "type": "string"
              },
              "maxLength": 100,
              "minLength": 1,
              "type": "array"
            },
            "contact": {
              "maxLength": 320,
              "type": "string"
            },
            "label": {
              "maxLength": 128,
              "type": "string"
            },
            "space": {
              "format": "space-ref",
              "type": "string"
            }
          },
          "required": [
            "space",
            "collections",
            "actions"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "authorizationUrl": {
              "format": "uri",
              "type": "string"
            },
            "clientMetadataUrl": {
              "format": "uri",
              "type": "string"
            },
            "delegation": {
              "ref": "party.whey.writeproxy.defs#delegation",
              "type": "ref"
            },
            "expiresAt": {
              "format": "datetime",
              "type": "string"
            }
          },
          "required": [
            "delegation",
            "authorizationUrl",
            "clientMetadataUrl",
            "expiresAt"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Create a pending write delegation for one (space, repo) pair and return an OAuth authorization URL for the delegator to open. The delegation starts with an empty caller allowlist.",
  "id": "party.whey.writeproxy.createDelegation",
  "lexicon": 1
}
