{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/transparent-pt/json-schema/transparent-pt-lead-in-schema.json",
  "title": "LeadIn",
  "description": "A lead submission. `consent` must be `true`, and at least one of `phone` / `email` must be\npresent. The `phone` field is smart-routed (email / messenger handle / phone number).\n",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/transparent-pt-openapi.yml#/components/schemas/LeadIn",
  "type": "object",
  "required": [
    "kind",
    "consent"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "contact",
        "call"
      ],
      "description": "Lead type. `contact` = message/enquiry, `call` = callback request."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 50,
      "description": "Phone number, or a single free-text contact field (email / @handle) that is routed server-side."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200,
      "format": "email"
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "item_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Id of the car the lead is about (from CarDetail.id)."
    },
    "lang": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 5,
      "description": "Visitor language (pt|en|ru|ua)."
    },
    "source": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 60,
      "description": "Originating form/context (e.g. car_page, contact)."
    },
    "value_eur": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Optional deal-value anchor, EUR."
    },
    "consent": {
      "type": "boolean",
      "default": false,
      "description": "Explicit opt-in to store the contact. Must be true or the request is rejected (422)."
    }
  }
}