{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hou.realtor/schemas/listing.inquire.schema.json",
  "title": "listing.inquire",
  "description": "Ask questions about a specific listing. Information and proposals only. Nothing in a request is binding: offers, contracts, earnest money, and representation agreements require Tiffany Hua's own signature. Send by email to tiffany@hou.realtor with subject '[listing.inquire] <short summary>' and the request JSON as the body; natively delivery comes once hou.realtor's entity record is published (https://hou.realtor/agent.html).",
  "type": "object",
  "required": [
    "type",
    "schema_version",
    "agent",
    "contact",
    "property",
    "questions",
    "timing"
  ],
  "properties": {
    "type": {
      "const": "listing.inquire"
    },
    "schema_version": {
      "const": "0.1"
    },
    "sent_at": {
      "type": "string",
      "format": "date-time"
    },
    "agent": {
      "$ref": "#/$defs/agent"
    },
    "contact": {
      "$ref": "#/$defs/contact"
    },
    "property": {
      "$ref": "#/$defs/property"
    },
    "questions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "timing": {
      "$ref": "#/$defs/timing",
      "description": "The buyer's own timeline."
    },
    "notes": {
      "type": "string",
      "maxLength": 2000
    }
  },
  "$defs": {
    "agent": {
      "type": "object",
      "description": "The sending agent's identity, in natively agent-card shape (https://natively.io/BOOTSTRAP.html, card fields agent_key, principal, ledger). An agent without a natively identity yet sets agent_key and ledger to null; its request is then handled as unverified information.",
      "required": [
        "agent_key",
        "principal",
        "ledger"
      ],
      "properties": {
        "agent_key": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^ed25519:[A-Za-z0-9+/]{43}=$",
          "description": "Your Ed25519 public key, 'ed25519:' + base64 of the 32 raw bytes. Never send a private key."
        },
        "principal": {
          "type": "string",
          "minLength": 1,
          "description": "Key ref of the human you act for. Until your principal has a signer, use their email address."
        },
        "ledger": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "URL of your hash-chained ledger, or null if you do not keep one yet."
        },
        "name": {
          "type": "string",
          "description": "Optional display name for the agent."
        },
        "card_url": {
          "type": "string",
          "format": "uri",
          "description": "Optional URL of your published agent card."
        }
      }
    },
    "contact": {
      "type": "object",
      "description": "The human Tiffany would reply to. Give at least an email or a phone number.",
      "required": [
        "name"
      ],
      "anyOf": [
        {
          "required": [
            "email"
          ]
        },
        {
          "required": [
            "phone"
          ]
        }
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string",
          "minLength": 7
        },
        "preferred_channel": {
          "enum": [
            "email",
            "phone",
            "text",
            "natively"
          ]
        }
      }
    },
    "property": {
      "type": "object",
      "description": "A specific property. Give at least one of address, mls_number, or listing_url.",
      "anyOf": [
        {
          "required": [
            "address"
          ]
        },
        {
          "required": [
            "mls_number"
          ]
        },
        {
          "required": [
            "listing_url"
          ]
        }
      ],
      "properties": {
        "address": {
          "type": "string",
          "minLength": 5,
          "description": "Street, city, state, ZIP on one line."
        },
        "mls_number": {
          "type": "string",
          "minLength": 1
        },
        "listing_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "timing": {
      "type": "object",
      "required": [
        "horizon"
      ],
      "properties": {
        "horizon": {
          "enum": [
            "asap",
            "0-3 months",
            "3-6 months",
            "6-12 months",
            "12+ months",
            "unsure"
          ]
        },
        "earliest": {
          "type": "string",
          "format": "date"
        },
        "latest": {
          "type": "string",
          "format": "date"
        }
      }
    }
  },
  "examples": [
    {
      "type": "listing.inquire",
      "schema_version": "0.1",
      "sent_at": "2026-10-21T15:00:00Z",
      "agent": {
        "agent_key": null,
        "principal": "jordan@example.com",
        "ledger": null,
        "name": "Jordan's assistant"
      },
      "contact": {
        "name": "Jordan Example",
        "email": "jordan@example.com",
        "preferred_channel": "email"
      },
      "property": {
        "mls_number": "00000000"
      },
      "questions": [
        "Is the property still available?",
        "What are the HOA dues?"
      ],
      "timing": {
        "horizon": "0-3 months"
      }
    }
  ]
}
