{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simpledock-ai/json-schema/simpledock-ai-create-appointment-schema.json",
  "title": "CreateAppointment",
  "description": "contactEmail is required unless quiet is true.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/simpledock-ai-openapi.yml#/components/schemas/CreateAppointment",
  "type": "object",
  "required": [
    "locationId",
    "appointmentTypeId",
    "startTime",
    "companyName"
  ],
  "properties": {
    "locationId": {
      "type": "string"
    },
    "appointmentTypeId": {
      "type": "string"
    },
    "startTime": {
      "type": "string",
      "format": "date-time"
    },
    "companyName": {
      "type": "string",
      "maxLength": 200
    },
    "contactEmail": {
      "type": "string",
      "format": "email"
    },
    "quiet": {
      "type": "boolean",
      "description": "When true, SimpleDock sends no confirmation email and no facility alert, and contactEmail may be left out. Calendar sync and webhooks still run. The driver check-in text still runs when the booking has a driver phone. Cannot be used with followApprovalRule: true (400)."
    },
    "externalSource": {
      "type": "string",
      "enum": [
        "ouroboros"
      ],
      "description": "Marks the booking as made by that system."
    },
    "externalRef": {
      "type": "string",
      "maxLength": 120,
      "description": "That system's id for the booking. It need not be unique. Needs externalSource (400 without it)."
    },
    "contactName": {
      "type": "string",
      "maxLength": 120
    },
    "contactPhone": {
      "type": "string",
      "maxLength": 40
    },
    "driverName": {
      "type": "string"
    },
    "driverPhone": {
      "type": "string"
    },
    "trailerNumber": {
      "type": "string"
    },
    "poReference": {
      "type": "string",
      "description": "One purchase order. Still accepted. When poNumbers is also sent, poNumbers wins."
    },
    "poNumbers": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every purchase order on the appointment. Prefer this when there is more than one."
    },
    "notes": {
      "type": "string",
      "description": "Operational instructions for staff, such as dock or load handling. Do not include personal or sensitive information."
    },
    "driverNotes": {
      "type": "string",
      "description": "Operational instructions for the driver, such as dock or load handling. Do not include personal or sensitive information."
    },
    "doorId": {
      "type": "string",
      "description": "Book on this door, at every location. Use a door from `freeDoorIds` in listAvailability with includeDoors. A door that is booked, closed off, closed, or does not take the type returns 409 with code `conflict` and details.reason = door_unavailable. The booking never moves to another door. When the whole slot is full or closed, the 409 has code `conflict` and no details.reason. An inactive door returns 400, and a door from another location returns 404. Omit it to let SimpleDock pick the door."
    },
    "customFields": {
      "type": "object",
      "maxProperties": 50,
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 4000
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "array",
            "maxItems": 40,
            "items": {
              "type": "string",
              "maxLength": 200
            }
          }
        ]
      },
      "description": "Operational load references such as seal or PO numbers. Do not include personal, payment, health, or government-ID data. Answers to the type's booking questions, keyed by fieldDefinitions[].key, e.g. { \"sealNumber\": \"A123\" }. A MULTI_TEXT question takes an array of strings, e.g. { \"customerPo\": [\"4501\", \"4502\"] }."
    },
    "followApprovalRule": {
      "type": "boolean",
      "description": "true = book the way the public link does. At a location that requires approval, or that reviews bookings made while it is closed, the appointment can be PENDING until staff approve or reject it, and appointment.approved or appointment.rejected fires then. Omit or false = CONFIRMED at once, including after hours."
    }
  }
}