{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sitegpt-ai/json-schema/sitegpt-ai-lead-schema.json",
  "title": "Lead",
  "description": "A captured lead. The top-level email convenience field is present on lead endpoints; conversation payloads embed the same record without it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sitegpt-ai-leads-api-openapi.yml#/components/schemas/Lead",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string"
    },
    "chatbotId": {
      "type": "string"
    },
    "chatUser": {
      "$ref": "#/$defs/ChatUser"
    },
    "name": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "description": "Convenience copy of chatUser.email."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "customData": {
      "$ref": "#/$defs/GenericObject",
      "description": "Custom lead-form fields collected by the widget."
    },
    "important": {
      "type": "boolean"
    },
    "archived": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ChatUser": {
      "type": "object",
      "description": "A website visitor identified through the chat widget.",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "verified": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "GenericObject": {
      "type": "object",
      "additionalProperties": true
    }
  }
}