{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ringkit-com/json-schema/ringkit-com-knowledge-profile-schema.json",
  "title": "KnowledgeProfile",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ringkit-com-openapi.json#/components/schemas/KnowledgeProfile",
  "type": "object",
  "properties": {
    "businessName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "tagline": {
      "type": "string",
      "maxLength": 200
    },
    "email": {
      "type": "string",
      "format": "email",
      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "serviceArea": {
      "type": "string",
      "maxLength": 1000
    },
    "credentials": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 300
      }
    },
    "estimateUrl": {
      "type": "string",
      "pattern": "^https?:\\/\\/"
    },
    "evidence": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": [
          "businessName",
          "tagline",
          "summary",
          "hours",
          "address",
          "phone",
          "email",
          "serviceArea",
          "credentials",
          "estimateUrl",
          "bookingUrl",
          "services",
          "staff",
          "faqs",
          "policies"
        ]
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "found",
              "inferred",
              "owner"
            ]
          },
          "sourceUrl": {
            "type": "string",
            "pattern": "^https?:\\/\\/"
          },
          "quote": {
            "type": "string",
            "maxLength": 1200
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      }
    },
    "summary": {
      "default": "",
      "type": "string",
      "maxLength": 1500
    },
    "hours": {
      "type": "object",
      "properties": {
        "regular": {
          "default": {},
          "type": "object",
          "propertyNames": {
            "type": "string",
            "enum": [
              "mon",
              "tue",
              "wed",
              "thu",
              "fri",
              "sat",
              "sun"
            ]
          },
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "open": {
                  "type": "string",
                  "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                },
                "close": {
                  "type": "string",
                  "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                }
              },
              "required": [
                "open",
                "close"
              ],
              "additionalProperties": false
            }
          }
        },
        "exceptions": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "windows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "open": {
                      "type": "string",
                      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                    },
                    "close": {
                      "type": "string",
                      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                    }
                  },
                  "required": [
                    "open",
                    "close"
                  ],
                  "additionalProperties": false
                }
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "windows"
            ],
            "additionalProperties": false
          }
        },
        "note": {
          "type": "string",
          "maxLength": 300
        }
      },
      "required": [
        "regular",
        "exceptions"
      ],
      "additionalProperties": false
    },
    "address": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string"
        },
        "line2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "default": "US",
          "type": "string"
        },
        "directions": {
          "type": "string",
          "maxLength": 500
        },
        "parking": {
          "type": "string",
          "maxLength": 300
        }
      },
      "required": [
        "line1",
        "city",
        "region",
        "postalCode",
        "country"
      ],
      "additionalProperties": false
    },
    "phone": {
      "type": "string",
      "pattern": "^\\+[1-9]\\d{6,14}$"
    },
    "bookingUrl": {
      "type": "string",
      "format": "uri"
    },
    "services": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "priceUsd": {
            "type": "number",
            "minimum": 0
          },
          "priceNote": {
            "type": "string",
            "maxLength": 120
          },
          "durationMin": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "bookingUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      }
    },
    "staff": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "bio": {
            "type": "string",
            "maxLength": 500
          },
          "schedule": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      }
    },
    "faqs": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "a": {
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": [
          "q",
          "a"
        ],
        "additionalProperties": false
      }
    },
    "policies": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": [
          "topic",
          "text"
        ],
        "additionalProperties": false
      }
    },
    "doNotSay": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 300
      }
    },
    "escalationContacts": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "when": {
            "type": "string",
            "maxLength": 300
          }
        },
        "required": [
          "label",
          "when"
        ],
        "additionalProperties": false
      }
    },
    "documents": {
      "default": [],
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 50000
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri"
          },
          "source": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "upload"
              },
              "documentId": {
                "type": "string",
                "pattern": "^doc_[0-9a-z]{8,32}$"
              },
              "fileName": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "uploadedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              }
            },
            "required": [
              "kind",
              "documentId",
              "fileName",
              "label",
              "uploadedAt"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "title",
          "text"
        ],
        "additionalProperties": false
      }
    },
    "greeting": {
      "type": "string",
      "maxLength": 300
    },
    "voiceNotes": {
      "type": "string",
      "maxLength": 1000
    },
    "vibe": {
      "type": "object",
      "properties": {
        "tones": {
          "minItems": 1,
          "maxItems": 2,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "warm",
              "professional",
              "upbeat",
              "calm",
              "luxury",
              "clinical",
              "friendly",
              "authoritative"
            ]
          }
        },
        "formality": {
          "type": "string",
          "enum": [
            "casual",
            "neutral",
            "formal"
          ]
        },
        "energy": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        "audience": {
          "type": "string",
          "maxLength": 60
        },
        "evidence": {
          "type": "string",
          "maxLength": 120
        }
      },
      "required": [
        "tones",
        "formality",
        "energy",
        "audience",
        "evidence"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "summary",
    "services",
    "staff",
    "faqs",
    "policies",
    "doNotSay",
    "escalationContacts",
    "documents"
  ],
  "additionalProperties": false
}