{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/servicetitan/main/json-schema/servicetitan-appointment-schema.json",
  "title": "ServiceTitan Appointment",
  "description": "Job appointment (visit) for the JPM API. A job has 1..N appointments.",
  "type": "object",
  "required": ["id", "jobId", "start", "end"],
  "properties": {
    "id": { "type": "integer", "format": "int64" },
    "jobId": { "type": "integer", "format": "int64" },
    "appointmentNumber": { "type": "string" },
    "start": { "type": "string", "format": "date-time" },
    "end": { "type": "string", "format": "date-time" },
    "arrivalWindowStart": { "type": "string", "format": "date-time" },
    "arrivalWindowEnd": { "type": "string", "format": "date-time" },
    "status": { "type": "string", "enum": ["Scheduled", "Dispatched", "InProgress", "Hold", "Done", "Canceled"] },
    "specialInstructions": { "type": ["string", "null"] },
    "unused": { "type": "boolean", "description": "True if the appointment was created but not visited" },
    "customerId": { "type": "integer" },
    "createdOn": { "type": "string", "format": "date-time" },
    "modifiedOn": { "type": "string", "format": "date-time" }
  }
}
