{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Creates an invitation code for a community.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The requesting user lacks the invitation.create permission.",
          "name": "Forbidden"
        },
        {
          "description": "No community exists with that DID.",
          "name": "CommunityNotFound"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "community": {
              "description": "The community to create an invitation for.",
              "format": "did",
              "type": "string"
            },
            "expiresAt": {
              "description": "When the invitation stops being redeemable, if ever.",
              "format": "datetime",
              "type": "string"
            },
            "maxUses": {
              "description": "How many times the invitation may be redeemed, if limited.",
              "minimum": 1,
              "type": "integer"
            }
          },
          "required": [
            "community"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "invitation": {
              "description": "The newly created invitation.",
              "ref": "social.colibri.beta.community.defs#invitationView",
              "type": "ref"
            }
          },
          "required": [
            "invitation"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.community.createInvitation",
  "lexicon": 1
}
