{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Books a time. The guest needs no account. A signed-in guest is linked to the booking by DID.",
      "errors": [
        {
          "name": "EventTypeNotFound"
        },
        {
          "name": "ScheduleNotFound"
        },
        {
          "name": "SlotUnavailable"
        },
        {
          "name": "DurationNotOffered"
        },
        {
          "name": "InvalidAnswer"
        },
        {
          "name": "InvalidLocation"
        },
        {
          "name": "BookingLimitReached"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "answers": {
              "description": "Answers keyed by question key: a string, a boolean for checkbox, or a list of strings for multiselect.",
              "type": "unknown"
            },
            "duration": {
              "maximum": 1440,
              "minimum": 1,
              "type": "integer"
            },
            "email": {
              "maxLength": 320,
              "type": "string"
            },
            "eventType": {
              "format": "at-uri",
              "type": "string"
            },
            "guests": {
              "description": "Others to invite, by email.",
              "items": {
                "maxLength": 320,
                "type": "string"
              },
              "maxLength": 10,
              "type": "array"
            },
            "holder": {
              "description": "The hold on this time, if any.",
              "maxLength": 64,
              "type": "string"
            },
            "location": {
              "description": "Index into the event type's locations. Without one, the first.",
              "minimum": 0,
              "type": "integer"
            },
            "locationValue": {
              "description": "The guest's answer where the location asks for one, such as their phone number.",
              "maxLength": 2000,
              "type": "string"
            },
            "name": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            "notes": {
              "maxLength": 10000,
              "type": "string"
            },
            "start": {
              "format": "datetime",
              "type": "string"
            },
            "timeZone": {
              "description": "An IANA timezone name, such as Europe/Lisbon.",
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "eventType",
            "start",
            "name",
            "email",
            "timeZone"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "booking": {
              "ref": "ing.opn.booking.defs#bookingView",
              "type": "ref"
            },
            "token": {
              "description": "The booking's manage token, from the email sent to its guest. Not needed by the host.",
              "maxLength": 128,
              "type": "string"
            }
          },
          "required": [
            "booking",
            "token"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ing.opn.booking.create",
  "lexicon": 1
}
